Level-specific sct_extract_metric without atlas?

Can I use sct_extract_metric to estimate mean level-specific metrics from whole spinal cord cross-section without a necessity to co-register PAM50 template into the native image space?

I was trying command like:

sct_extract_metric -i dti_FA.nii.gz -vert 1:7 -vertfile dwi_mean_seg_labeled.nii.gz -perlevel 1 -append 0 -method wa -o FA_level-specific.csv

But I got error that label/atlas folder/file does not exist:

Traceback (most recent call last):
File “/usr/lib/sct/spinalcordtoolbox/scripts/sct_extract_metric.py”, line 397, in
main(sys.argv[1:])
File “/usr/lib/sct/spinalcordtoolbox/scripts/sct_extract_metric.py”, line 348, in main
raise RuntimeError(path_label + ’ does not exist’)
RuntimeError: label/atlas does not exist

Used SCT version: git-master-b97e0a58c47dafef2cb74a07eff1df6681422b94

Hi @rene.labounek

You need to indicate where in the axial plane the metric should be aggregated. This is defined with the flag -f, which by default points to the ./label/ folder (ie: warped PAM50 template), but if you wish to use your cord mask, then you can do:

sct_extract_metric -i dti_FA.nii.gz -f dwi_mean_seg.nii.gz -vert 1:7 -vertfile dwi_mean_seg_labeled.nii.gz -perlevel 1 -append 0 -method wa -o FA_level-specific.csv

Thanks @jcohenadad It did exactly what I neded.

1 Like