@@ -71,7 +71,6 @@ segment_if_does_not_exist() {
7171 # This allows you to add manual segmentations on a subject-by-subject basis without disrupting the pipeline.
7272 # ##
7373 local file=" ${1} "
74- local contrast=" ${2} "
7574 # Update global variable with segmentation file name
7675 FILESEG=" ${file} " _seg
7776 FILESEGMANUAL=" ${PATH_DATA} " /derivatives/labels/" ${SUBJECT} " /anat/" ${FILESEG} " .nii.gz
@@ -84,7 +83,7 @@ segment_if_does_not_exist() {
8483 else
8584 echo " Not found. Proceeding with automatic segmentation."
8685 # 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} "
8887 fi
8988}
9089
@@ -111,8 +110,8 @@ rsync -avzh "${PATH_DATA}"/"${SUBJECT}" .
111110# ======================================================================================================================
112111cd " ${SUBJECT} " /anat/
113112file_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} "
116115file_t2_seg=" ${FILESEG} "
117116# Create labels in the cord at C2 and C5 mid-vertebral levels (only if it does not exist)
118117label_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
132131# ======================================================================================================================
133132file_mt1=" ${SUBJECT} " _acq-MTon_MTS
134133file_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} "
137136file_mt1_seg=" ${FILESEG} "
138137# Create mask
139138sct_create_mask -i " ${file_mt1} " .nii.gz -p centerline," ${file_mt1_seg} " .nii.gz -size 45mm
0 commit comments