sct-pipeline / critical-ms-lesion

Detection of critical MS lesion in the spinal cord
GNU Lesser General Public License v2.1
0 stars 0 forks source link

Warning caused by `sct_process_segmentation` #5

Open plbenveniste opened 4 days ago

plbenveniste commented 4 days ago

Here is the warning message that I saw in the log file.

--
Spinal Cord Toolbox (git-master-72f072555f97e8417260869567b34f8d0c5f5166)

sct_process_segmentation -i sub-HC001_acq-sagCervCube_T2w_seg.nii.gz -vertfile sub-HC001_acq-sagCervCube_T2w_seg_labeled.nii.gz -perslice 1 -o /Users/plbenveniste/Documents/data/ms-mayo/output_pipeline/results/sub-HC001_CSA.csv -append 1 -qc /Users/plbenveniste/Documents/data/ms-mayo/output_pipeline/qc
--

/Users/plbenveniste/spinalcordtoolbox/python/envs/venv_sct/lib/python3.9/site-packages/numpy/core/fromnumeric.py:3504: RuntimeWarning: Mean of empty slice.
  return _methods._mean(a, axis=axis, dtype=dtype,
/Users/plbenveniste/spinalcordtoolbox/python/envs/venv_sct/lib/python3.9/site-packages/numpy/core/_methods.py:129: RuntimeWarning: invalid value encountered in scalar divide
  ret = ret.dtype.type(ret / rcount)
QC report only available for PMJ-based CSA. QC report not generated.

I will look into what it is and see whether it we can be easily fixed.

jcohenadad commented 4 days ago

Right, there is no QC for process_segmentation (unless if using PMJ-based CSA), so the warning message is normal. You can simply remove the "-qc" flag.

plbenveniste commented 3 days ago

Removing the QC indeed removed a part of the warning. However, I still have the following warning message:

/Users/plbenveniste/spinalcordtoolbox/python/envs/venv_sct/lib/python3.9/site-packages/numpy/core/fromnumeric.py:3504: RuntimeWarning: Mean of empty slice.
  return _methods._mean(a, axis=axis, dtype=dtype,
/Users/plbenveniste/spinalcordtoolbox/python/envs/venv_sct/lib/python3.9/site-packages/numpy/core/_methods.py:129: RuntimeWarning: invalid value encountered in scalar divide
  ret = ret.dtype.type(ret / rcount)