Error during CSA computation


Please if someone could lend me a hand,
I am trying to compute the CSA from a T2 weighted MRI but I am certain I am getting wrong results due to it been as high as a MEAN (area) of 1500.
I run the following scripts:

sct_propseg -i t2.nii.gz -c t2
sct_label_vertebrae -i t2.nii.gz -s t2_seg.nii.gz -c t2
sct_register_to_template -i t2.nii.gz -s t2_seg.nii.gz -l t2_seg_labeled.nii.gz -c
sct_warp_template -d t2.nii.gz -w warp_template2anat.nii.gz -a 0
sct_process_segmentation -i t2_seg.nii.gz -vert 3:8 -perlevel 1 -o results.csv


thank you for reaching out.

issue here:

sct_register_to_template -i t2.nii.gz -s t2_seg.nii.gz -l t2_seg_labeled.nii.gz -c

the flag “-l” accepts labels (points), not label segmentation. See the SCT course and tutorial.

Moreover, the flag “-c” requires a value.

Moreover: if your goal is only to compute CSA at specific levels, you do not need to register to the PAM50 template. You can simply do this:

sct_process_segmentation -i t2_seg.nii.gz -vert 3:8 -perlevel 1 -vertfile t2_seg_labeled.nii.gz -o results.csv

Also, in the future, to display code, please use the characters “```” ans specify SCT version, as indicated in the forum rules: