Label_vertebrae Fails


#1

Hello Julien,

Attached you will find the image which we are having problems with. After checking the forum, we believe that this has not been posted yet.

The segmentation runs perfectly and also the deepseg_lesion

Desktop/SCT_DR/Exemples/Lesions_Patients/121064/T2w$ sct_label_vertebrae -i 121064_Compo_t2_sag.nii -s 121064_Compo_t2_sag_seg.nii -c t2

--
Spinal Cord Toolbox (dev)


Create temporary folder (/tmp/sct-20191008081948.218769-label_vertebrae-mbev8qkl)...

Copying input data to tmp folder...

Straighten spinal cord...

Create temporary folder (/tmp/sct-20191008081948.324462-straighten_spinalcord-1sgcm6xx)...

Copy files to tmp folder...
Window length needs to be >= 3. Returning input signal.
Window length needs to be >= 3. Returning input signal.
Fitting centerline using B-spline approximation
Error on approximation = 374.1 mm
Error on approximation = 52.09 mm
Error on approximation = 97.01 mm
Error on approximation = 40.42 mm
Error on approximation = 20.31 mm
Error on approximation = 12.84 mm
Error on approximation = 12.87 mm
Error on approximation = 11.29 mm
Error on approximation = 9.34 mm
Error on approximation = 9.81 mm
Error on approximation = 10.13 mm
Error on approximation = 6.21 mm
Error on approximation = 3.67 mm
Error on approximation = 3.77 mm
Error on approximation = 5.04 mm
Error on approximation = 4.46 mm
Error on approximation = 2.85 mm
Error on approximation = 2.31 mm
Error on approximation = 2.19 mm
Error on approximation = 1.78 mm
Error on approximation = 1.9 mm
Error on approximation = 2.3 mm
Error on approximation = 1.89 mm
Error on approximation = 1.26 mm
Error on approximation = 1.43 mm
Error on approximation = 1.65 mm
Error on approximation = 1.16 mm
Error on approximation = 0.92 mm
Error on approximation = 1.04 mm
Error on approximation = 1.14 mm
Error on approximation = 0.99 mm
Error on approximation = 1.05 mm
Error on approximation = 1.17 mm
Error on approximation = 0.91 mm
Error on approximation = 0.62 mm
Error on approximation = 0.75 mm
Error on approximation = 1.1 mm
Error on approximation = 0.78 mm
Error on approximation = 0.71 mm
Error on approximation = 0.92 mm
Error on approximation = 0.94 mm
Error on approximation = 0.86 mm
Error on approximation = 0.6 mm
Error on approximation = 0.51 mm
Error on approximation = 0.67 mm
Error on approximation = 0.51 mm
Traceback (most recent call last):
  File "/home/extop/sct_dev/scripts/sct_label_vertebrae.py", line 427, in <module>
    main()
  File "/home/extop/sct_dev/scripts/sct_label_vertebrae.py", line 260, in main
    '-v', str(verbose),
  File "/home/extop/sct_dev/scripts/sct_straighten_spinalcord.py", line 272, in main
    fname_straight = sc_straight.straighten()
  File "/home/extop/sct_dev/spinalcordtoolbox/straightening.py", line 152, in straighten
    centerline = _get_centerline(img_ctl, self.param_centerline, verbose)
  File "/home/extop/sct_dev/spinalcordtoolbox/straightening.py", line 625, in _get_centerline
    _, arr_ctl, arr_ctl_der, _ = get_centerline(img, param_centerline, verbose=verbose)
  File "/home/extop/sct_dev/spinalcordtoolbox/centerline/core.py", line 173, in get_centerline
    z_ref] = 1
IndexError: shape mismatch: indexing arrays could not be broadcast together with shapes (616,) (616,) (617,) 

121064_Compo_t2_sag.nii.gz (3.7 MB)


#2

Hi @Aran

I cannot reproduce your issue, so I suspect this might be related to an old version of SCT you are running. Could you please install SCT using git (instead of downloading the zip of the master branch), so we know which version you are using?

Below is the syntax I used, with SCT master branch (commit: 6f50fd8e917e8e255a0004daa1966c4a1fec49bf):

sct_deepseg_sc -i /Users/julien/Desktop/121064_Compo_t2_sag.nii.gz -c t2
sct_label_vertebrae -i 121064_Compo_t2_sag.nii.gz -s 121064_Compo_t2_sag_seg.nii.gz -c t2

Below is the result:
image

Best
Julien