Error init-centerline viewer

Hi all!
I am trying to run segmentation on spinalcord data. Automatic segmentation failed as the centerline is not estimate correctly. I therefore tried to manually set the centerline using -init-centerline viewer. I can select points, but when the function continues I get an error. Anyone tips?

Spinal Cord Toolbox (5.8)

sct_propseg -i /project/3023009.09/evefra/sub-001/anat/s302300909_sub001-0019-00001-000192-01.nii -c t1 -qc /project/3023009.09/evefra/sub-001/spinalcord/segment_anat/qc -init-centerline viewer -o /project/3023009.09/evefra/sub-001/spinalcord/segment_anat/s302300909_sub001-0019-00001-000192-01.segmentation.nii
--

Creating temporary folder (/tmp/sct-20230628161453.515219-propseg-6xkg8alu)
Creating temporary folder (/tmp/sct-20230628161453.534859-label_vertebrae-lautc371)
File /project/3023009.09/evefra/sub-001/anat/s302300909_sub001-0019-00001-000192-01_labels_viewer.nii already exists. Will overwrite it.
/home/affneu/evefra/sct_5.8/bin/isct_propseg -t t1 -o /tmp/sct-20230628161453.515219-propseg-6xkg8alu -verbose -i /project/3023009.09/evefra/sub-001/anat/s302300909_sub001-0019-00001-000192-01.nii -init-centerline /project/3023009.09/evefra/sub-001/anat/s302300909_sub001-0019-00001-000192-01_labels_viewer.nii -centerline-binary # in /home/affneu/evefra/Spinalcord/scripts
mv /tmp/sct-20230628161453.515219-propseg-6xkg8alu/s302300909_sub001-0019-00001-000192-01_seg.nii /project/3023009.09/evefra/sub-001/spinalcord/segment_anat/s302300909_sub001-0019-00001-000192-01.segmentation.nii
mv /tmp/sct-20230628161453.515219-propseg-6xkg8alu/s302300909_sub001-0019-00001-000192-01_centerline.nii /project/3023009.09/evefra/sub-001/spinalcord/segment_anat/s302300909_sub001-0019-00001-000192-01_centerline.nii
cp /project/3023009.09/evefra/sub-001/anat/s302300909_sub001-0019-00001-000192-01_labels_viewer.nii /project/3023009.09/evefra/sub-001/spinalcord/segment_anat/s302300909_sub001-0019-00001-000192-01_labels_viewer.nii

Check consistency of segmentation...
Creating temporary folder (/tmp/sct-20230628161603.051746-propseg-a89s5fs9)
/tmp/sct-20230628161603.051746-propseg-a89s5fs9/tmp.segmentation.nii.gz
/tmp/sct-20230628161603.051746-propseg-a89s5fs9/tmp.centerline.nii.gz

Get data dimensions...
Traceback (most recent call last):
  File "/home/affneu/evefra/sct_5.8/spinalcordtoolbox/scripts/sct_propseg.py", line 700, in <module>
    main(sys.argv[1:])
  File "/home/affneu/evefra/sct_5.8/spinalcordtoolbox/scripts/sct_propseg.py", line 687, in main
    img_seg = propseg(img_input, arguments)
  File "/home/affneu/evefra/sct_5.8/spinalcordtoolbox/scripts/sct_propseg.py", line 656, in propseg
    check_and_correct_segmentation(fname_seg, fname_centerline, folder_output=folder_output, threshold_distance=3.0,
  File "/home/affneu/evefra/sct_5.8/spinalcordtoolbox/scripts/sct_propseg.py", line 87, in check_and_correct_segmentation
    minz_centerline = np.min(key_centerline)
  File "<__array_function__ internals>", line 180, in amin
  File "/home/affneu/evefra/sct_5.8/python/envs/venv_sct/lib/python3.8/site-packages/numpy/core/fromnumeric.py", line 2918, in amin
    return _wrapreduction(a, np.minimum, 'min', axis, None, out,
  File "/home/affneu/evefra/sct_5.8/python/envs/venv_sct/lib/python3.8/site-packages/numpy/core/fromnumeric.py", line 86, in _wrapreduction
    return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
ValueError: zero-size array to reduction operation minimum which has no identity

Hi @Evelyne,

Could you upload a screenshot of your image so I can get a sense of its quality/features. Ideally if you could upload the NIfTI itself it would be better (or email it to me in private).

Hi @jcohenadad, I tried using deepseg_sc instead and this works. The propseg still not, but I can work wth the deepseg

2 Likes