extop@:/mnt/aran/Processes/Patients/CN_101$ sct_extract_metric -i n4_CN_101_SC.nii.gz -l 5
--
Spinal Cord Toolbox (dev)
Traceback (most recent call last):
File "/home/extop/sct_dev/scripts/sct_extract_metric.py", line 425, in <module>
perlevel=perlevel, verbose=verbose, combine_labels=combine_labels)
File "/home/extop/sct_dev/scripts/sct_extract_metric.py", line 289, in main
map_cluster in map_clusters].index(True))
ValueError: True is not in list
We are using the last version from GitHub. 4.2.2 updated
I am not able to reproduce your error using testing data. Could you please share the necessary files for us to try to reproduce your issue on our end? Namely: n4_CN_101_SC.nii.gz and the local label/ folder.
Indeed, the error is caused by the files you’ve added under label/atlas. As explained in the SCT Course page 95, the function sct_extract_metric uses a Gaussian mixture algorithm, which assumes that each voxel across labels sums to one. If you add labels, you violate this assumption and results will be incorrect. If you would like to add custom labels under label/atlas, you need to follow the mathematical assumption. I clarified it on page 98 of the course (I agree this was not explicit enough).
So for now, you need to remove the files you’ve added, and update the file info_label.txt as it was before.
If you would like to extract values in your custom labels without using Gaussian mixture algorithm, you can do so by simply pointing to the label file with flag -f: