Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: min() arg is an empty sequence on cord segmentation #17

Open
jcohenadad opened this issue May 5, 2021 · 0 comments
Open

Comments

@jcohenadad
Copy link
Collaborator

using bcf3064, I get this:

ValueError: min() arg is an empty sequence on cord segmentation
Terminal output
Error executing process > 'T2_Segment_SpinalCord (sub-06_ses-002_rec-dis2d)'

Caused by:
  Process `T2_Segment_SpinalCord (sub-06_ses-002_rec-dis2d)` terminated with an error exit status (1)

Command executed:

  sct_deepseg_sc -i sub-06_ses-002_rec-dis2d_bp-cspine_T2w.nii.gz -c t2 -qc /Users/julien/data/neuromod/derivatives/SCT/qc -qc-subject sub-06_ses-002_rec-dis2d

Command exit status:
  1

Command output:
  
  --
  Spinal Cord Toolbox (git-master-0e160998510b22bba054b783eb5fb02bad26bfd8)
  
  sct_deepseg_sc -i sub-06_ses-002_rec-dis2d_bp-cspine_T2w.nii.gz -c t2 -qc /Users/julien/data/neuromod/derivatives/SCT/qc -qc-subject sub-06_ses-002_rec-dis2d
  --
  
  Config deepseg_sc:
    Centerline algorithm: svm
    Brain in image: True
    Kernel dimension: 2d
    Contrast: t2
    Threshold: 0.7
  Creating temporary folder (/var/folders/s8/4qnm5q1n261ch35b5kkclsb00000gn/T/sct-20210504225942.700881-i93u_nns)
  Reorient the image to RPI, if necessary...
  Finding the spinal cord centerline...
  Creating temporary folder (/var/folders/s8/4qnm5q1n261ch35b5kkclsb00000gn/T/sct-20210504225950.755064-nakxuk5m)
  Remove temporary files...
  rm -rf /var/folders/s8/4qnm5q1n261ch35b5kkclsb00000gn/T/sct-20210504225950.755064-nakxuk5m
  Cropping the image around the spinal cord...
  Normalizing the intensity...
  Segmenting the spinal cord using deep learning on 2D patches...
  Reassembling the image...
  Resampling the segmentation to the native image resolution using linear interpolation...
  Binarizing the resampled segmentation...

Command error:
  Traceback (most recent call last):
    File "/Users/julien/code/sct/spinalcordtoolbox/scripts/sct_deepseg_sc.py", line 214, in <module>
      main(sys.argv[1:])
    File "/Users/julien/code/sct/spinalcordtoolbox/scripts/sct_deepseg_sc.py", line 199, in main
      threshold_seg=threshold, remove_temp_files=remove_temp_files, verbose=verbose)
    File "/Users/julien/code/sct/spinalcordtoolbox/deepseg_sc/core.py", line 557, in deep_segmentation_spinalcord
      im_seg_r_postproc = post_processing_volume_wise(im_seg_r)
    File "/Users/julien/code/sct/spinalcordtoolbox/deepseg_sc/postprocessing.py", line 145, in post_processing_volume_wise
      im_seg = _remove_isolated_voxels_on_the_edge(im_seg)
    File "/Users/julien/code/sct/spinalcordtoolbox/deepseg_sc/postprocessing.py", line 111, in _remove_isolated_voxels_on_the_edge
      metrics, _ = compute_shape(im_seg, angle_correction=False)
    File "/Users/julien/code/sct/spinalcordtoolbox/process_seg.py", line 56, in compute_shape
      min_z_index, max_z_index = min(Z), max(Z)
  ValueError: min() arg is an empty sequence

Work dir:
  /Users/julien/code/neuromod-anat-processing/work/40/8d4c7d2b0824e4902f10d35e5158e0

Tip: you can replicate the issue by changing to the process work dir and entering the command `bash .command.run`

The issue is caused by the pipeline using this image:

sub-06_ses-002_rec-dis2d_bp-cspine_T2w.nii.gz

instead of this one:

sub-06_ses-002_bp-cspine_T2w.nii.gz

And even more concerning is the look of the image:
image

It looks like a phantom and it has nothing to do there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant