@@ -71,7 +71,6 @@ segment_if_does_not_exist() {
71
71
# This allows you to add manual segmentations on a subject-by-subject basis without disrupting the pipeline.
72
72
# ##
73
73
local file=" ${1} "
74
- local contrast=" ${2} "
75
74
# Update global variable with segmentation file name
76
75
FILESEG=" ${file} " _seg
77
76
FILESEGMANUAL=" ${PATH_DATA} " /derivatives/labels/" ${SUBJECT} " /anat/" ${FILESEG} " .nii.gz
@@ -84,7 +83,7 @@ segment_if_does_not_exist() {
84
83
else
85
84
echo " Not found. Proceeding with automatic segmentation."
86
85
# Segment spinal cord
87
- sct_deepseg_sc - i " ${file} " .nii.gz -c " ${contrast} " -qc " ${PATH_QC} " -qc-subject " ${SUBJECT} "
86
+ sct_deepseg -task seg_sc_contrast_agnostic - i " ${file} " .nii.gz -qc " ${PATH_QC} " -qc-subject " ${SUBJECT} "
88
87
fi
89
88
}
90
89
@@ -111,8 +110,8 @@ rsync -avzh "${PATH_DATA}"/"${SUBJECT}" .
111
110
# ======================================================================================================================
112
111
cd " ${SUBJECT} " /anat/
113
112
file_t2=" ${SUBJECT} " _T2w
114
- # Segment spinal cord (only if it does not exist)
115
- segment_if_does_not_exist " ${file_t2} " " t2 "
113
+ # Segment spinal cord (only if it does not exist) using contrast-agnostic model
114
+ segment_if_does_not_exist " ${file_t2} "
116
115
file_t2_seg=" ${FILESEG} "
117
116
# Create labels in the cord at C2 and C5 mid-vertebral levels (only if it does not exist)
118
117
label_if_does_not_exist " ${file_t2} " " ${file_t2_seg} "
@@ -132,8 +131,8 @@ sct_process_segmentation -i "${file_t2_seg}".nii.gz -vert 2:3 -vertfile label_T2
132
131
# ======================================================================================================================
133
132
file_mt1=" ${SUBJECT} " _acq-MTon_MTS
134
133
file_mt0=" ${SUBJECT} " _acq-MToff_MTS
135
- # Segment spinal cord
136
- segment_if_does_not_exist " ${file_mt1} " " t2s "
134
+ # Segment spinal cord using contrast-agnostic model
135
+ segment_if_does_not_exist " ${file_mt1} "
137
136
file_mt1_seg=" ${FILESEG} "
138
137
# Create mask
139
138
sct_create_mask -i " ${file_mt1} " .nii.gz -p centerline," ${file_mt1_seg} " .nii.gz -size 45mm
0 commit comments