Skip to content

Commit e92fb1e

Browse files
authored
Add -dseg argument to sct_register_multimodal (#15)
* Improve log outputs in CI * This prevents the "Output full log" step from failing with file-not-found if the 'success' log file is absent. * It also shows the 'failure' log file if present, for easier debugging. * Add dseg argument to sct_register_multimodal It's necessary for the qc report, otherwise the command throws an error.
1 parent dde7a4b commit e92fb1e

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

.github/workflows/run_batch_script.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,19 @@ jobs:
5353
- name: Output full log for sanity checking
5454
run: |
5555
cd "${{ github.event.repository.name }}/multi_subject/output/log"
56-
cat process_data_sub-01.log
56+
for logfile in process_data_sub-01.log err.process_data_sub-01.log; do
57+
if [[ -e "${logfile}" ]]; then
58+
echo "=== Contents of ${logfile} ==="
59+
cat "${logfile}"
60+
else
61+
echo "=== No file ${logfile} ==="
62+
fi
63+
done
5764
5865
- name: Check that script executed without error
5966
run: |
6067
cd "${{ github.event.repository.name }}/multi_subject/output/log"
6168
[ "$(compgen -G "process_data_sub-0*.log")" ] # Log files should exist
6269
[ ! "$(compgen -G "err.process_data_sub-0*.log")" ] # Error files should NOT exist
6370
grep -iF "warning" process_data_sub-01.log
64-
grep -iF "error" process_data_sub-01.log
71+
grep -iF "error" process_data_sub-01.log

multi_subject/process_data.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,12 @@ file_mt1="${file_mt1}_crop"
145145
# Tips: here we only use rigid transformation because both images have very
146146
# similar sequence parameters. We don't want to use SyN/BSplineSyN to avoid
147147
# introducing spurious deformations.
148-
sct_register_multimodal -i "${file_mt0}.nii.gz" -d "${file_mt1}.nii.gz" \
148+
sct_register_multimodal -i "${file_mt0}.nii.gz" \
149+
-d "${file_mt1}.nii.gz" \
150+
-dseg "${file_mt1}_seg.nii.gz" \
149151
-param step=1,type=im,algo=rigid,slicewise=1,metric=CC \
150-
-x spline -qc "${PATH_QC}"
152+
-x spline \
153+
-qc "${PATH_QC}"
151154
# Register template->mt1
152155
# Tips: here we only use the segmentations due to poor SC/CSF contrast at the bottom slice.
153156
# Tips: First step: slicereg based on images, with large smoothing to capture

0 commit comments

Comments
 (0)