Problem with sct_label_vertebrae - ValueError

Hi! I am trying to label whole spinal cord, but I keep getting following error message:

Here is the command I am using:

sct_label_vertebrae -i whole_spine.nii.gz -s whole_spine_seg.nii.gz -c t2 -ofolder labeled_spine

whole_spine_seg.nii.gz was generated with PropSeg, where I’ve specified CSF flag as well, but I dont think thats important.

I should note that on some images I am not experiencing this issue. Is there any way to overcome it?

Hi @Stefan_Radonjic,

This issue has already been reported here, and has been fixed in this PR which is associated with release 5.1.0. I see you are using v5.0.1, so I recommend you install SCT’s latest version.

Best,
Julien

Hi @jcohenadad

Is there any way to fix the issue without changing the version?

Changing source code is an option as well. I was looking into link you provided me with, but not THAT Much information on what I would need to change.

yes, you could mask your segmentation (ie: replace ones by zero) at the location that corresponds to the label 20, so it will not look for it