I am finding the CSAs from a number of t1 brain and spinal cord scans. I’m specifically trying to look at C2 and what slice C2 Ends at. According to the Quality Control, the labelling is going very well, e.g.:
However, When I look at the CSV files generated and check the slices, the values given for example for vertebrae Level 3 do not match up to the scan.
I may shed some light with the slices problem. You are using sct_process_segmentation without the -vertfile flag, so then, SCT uses the ./label/template/PAM50_levels.nii.gz file which probably will be a little bit different from the _seg_labeled file that you calculated before.
So, if you want to try this and let’s see how it goes. Maybe the outputs are more similar to what you expect
Check the spelling for mistakes since i am not used to shell.
Although, all your results look weird… The mean areas should not be that different one from another, that’s if the numbers are correct, and it looks like the vertebrae 7 and 8 are located from slices 146 to 223 and from 436 to 51? This shouldn’t be.
With the “no values for Level 2” I can’t help you… Hopefully someone else can.
And if he can check what I’ve just said is right also!
I’m very sorry for the late response. As @Aran rightfully pointed out, the default vertebral level file used by sct_process_segmentation is ./label/template/PAM50_levels.nii.gz, which is slightly different than ${file}_seg_labeled.nii. That being said, the slight different should not explain the large discrepancy you are observing, and especially the strange split of z-slices for level 7, as pointed out by @Aran.
The first thing I noticed is that the script uses “…” instead of “…”, which is wrong syntax in shell. Instead of pointing to the parent directory, “…” results in an error, example:
**julien-macbook:** ~ $ cd ...
-bash: cd: ...: No such file or directory
**julien-macbook:** ~ $ cd ..
**julien-macbook:** /Users $
So, let’s try to debug step-by-step. First, could you please select the subject that gave the output CSV file you attached in your post above, and upload for this subject the following files:
${file}_seg.nii
./label/template/PAM50_levels.nii.gz
These are only segmentations, so there should not be any privacy issue.
Also: in the future, if you want to embed code, please use “~~~”, so that your code is not formatted, which could result in some of the mistakes mentioned above ("…" instead of “…”).
Thank you both for your help! Using the -vertfile flag has made the results accurate and also fixed the strange vertebrae slice locations, so this was definitely the solution. I am also getting values for C2 now instead of “None”.