Skip to content

Commit 60ebdeb

Browse files
batch_single_subject.sh: Revert back to _gmseg
Keeping the old syntax will be better for ensuring backwards compatibility with the course data .zips, since we package up the _gmseg and _wmseg files to be used in other tutorials.
1 parent cd149da commit 60ebdeb

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

single_subject/batch_single_subject.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -246,14 +246,14 @@ sct_register_to_template -i t2_lumbar.nii.gz -s t2_lumbar_seg.nii.gz -ldisc t2_l
246246
# Go to T2*-weighted data, which has good GM/WM contrast and high in-plane resolution
247247
cd ../t2s
248248
# Segment gray matter (check QC report afterwards)
249-
sct_deepseg graymatter -i t2s.nii.gz -qc ~/qc_singleSubj
249+
sct_deepseg graymatter -i t2s.nii.gz -o t2s_gmseg.nii.gz -qc ~/qc_singleSubj
250250
# Spinal cord segmentation
251251
sct_deepseg spinalcord -i t2s.nii.gz -qc ~/qc_singleSubj
252252
# Subtract GM segmentation from cord segmentation to obtain WM segmentation
253253
# Note that we use the flag -thr 0 in case some voxels in the GM segmentation are *not* included in the cord
254254
# segmentation. That would results in voxels in the WM segmentation having the value “-1”, which would cause issues
255255
# with the registration.
256-
sct_maths -i t2s_seg.nii.gz -sub t2s_gm_seg.nii.gz -thr 0 -o t2s_wm_seg.nii.gz
256+
sct_maths -i t2s_seg.nii.gz -sub t2s_gmseg.nii.gz -thr 0 -o t2s_wmseg.nii.gz
257257

258258

259259

@@ -263,15 +263,15 @@ sct_maths -i t2s_seg.nii.gz -sub t2s_gm_seg.nii.gz -thr 0 -o t2s_wm_seg.nii.gz
263263
# Compute cross-sectional area (CSA) of the gray and white matter for all slices in the volume.
264264
# Note: Here we use the flag -angle-corr 0, because we do not want to correct the computed CSA by the cosine of the
265265
# angle between the cord centerline and the S-I axis: we assume that slices were acquired orthogonally to the cord.
266-
sct_process_segmentation -i t2s_wm_seg.nii.gz -o csa_wm.csv -perslice 1 -angle-corr 0
267-
sct_process_segmentation -i t2s_gm_seg.nii.gz -o csa_gm.csv -perslice 1 -angle-corr 0
266+
sct_process_segmentation -i t2s_wmseg.nii.gz -o csa_wm.csv -perslice 1 -angle-corr 0
267+
sct_process_segmentation -i t2s_gmseg.nii.gz -o csa_gm.csv -perslice 1 -angle-corr 0
268268

269269
# You can also use the binary masks to extract signal intensity from MRI data.
270270
# The example below will show how to use the GM and WM segmentations to quantify T2* signal intensity, as done in
271271
# [Martin et al. PLoS One 2018].
272272
# Quantify average WM and GM signal between slices 2 and 12.
273-
sct_extract_metric -i t2s.nii.gz -f t2s_wm_seg.nii.gz -method bin -z 2:12 -o t2s_value.csv
274-
sct_extract_metric -i t2s.nii.gz -f t2s_gm_seg.nii.gz -method bin -z 2:12 -o t2s_value.csv -append 1
273+
sct_extract_metric -i t2s.nii.gz -f t2s_wmseg.nii.gz -method bin -z 2:12 -o t2s_value.csv
274+
sct_extract_metric -i t2s.nii.gz -f t2s_gmseg.nii.gz -method bin -z 2:12 -o t2s_value.csv -append 1
275275
# Note: the flag -append enables to append a new result at the end of an already-existing csv file.
276276

277277

@@ -281,7 +281,7 @@ sct_extract_metric -i t2s.nii.gz -f t2s_gm_seg.nii.gz -method bin -z 2:12 -o t2s
281281

282282
# Register template->t2s (using warping field generated from template<->t2 registration)
283283
# Tips: Here we use the WM seg for the iseg/dseg fields in order to account for both the cord and the GM shape.
284-
sct_register_multimodal -i "${SCT_DIR}"/data/PAM50/template/PAM50_t2s.nii.gz -iseg "${SCT_DIR}"/data/PAM50/template/PAM50_wm.nii.gz -d t2s.nii.gz -dseg t2s_wm_seg.nii.gz -initwarp ../t2/warp_template2anat.nii.gz -initwarpinv ../t2/warp_anat2template.nii.gz -owarp warp_template2t2s.nii.gz -owarpinv warp_t2s2template.nii.gz -param step=1,type=seg,algo=rigid:step=2,type=seg,metric=CC,algo=bsplinesyn,slicewise=1,iter=3:step=3,type=im,metric=CC,algo=syn,slicewise=1,iter=2 -qc ~/qc_singleSubj
284+
sct_register_multimodal -i "${SCT_DIR}"/data/PAM50/template/PAM50_t2s.nii.gz -iseg "${SCT_DIR}"/data/PAM50/template/PAM50_wm.nii.gz -d t2s.nii.gz -dseg t2s_wmseg.nii.gz -initwarp ../t2/warp_template2anat.nii.gz -initwarpinv ../t2/warp_anat2template.nii.gz -owarp warp_template2t2s.nii.gz -owarpinv warp_t2s2template.nii.gz -param step=1,type=seg,algo=rigid:step=2,type=seg,metric=CC,algo=bsplinesyn,slicewise=1,iter=3:step=3,type=im,metric=CC,algo=syn,slicewise=1,iter=2 -qc ~/qc_singleSubj
285285
# Warp template
286286
sct_warp_template -d t2s.nii.gz -w warp_template2t2s.nii.gz -qc ~/qc_singleSubj
287287

0 commit comments

Comments
 (0)