dcmrtstruct2nii
dcmrtstruct2nii copied to clipboard
IndexError: index out of range
Hi again,
I also got this error for some files now (unrelated to memory consumption):
Traceback (most recent call last):
File "/gris/gris-f/homelv/me/anaconda3/envs/pytorch/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/gris/gris-f/homelv/me/anaconda3/envs/pytorch/lib/python3.8/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "mintLesion2Nifty.py", line 49, in convert_single
convert_data(single_data_dir, single_save_dir)
File "mintLesion2Nifty.py", line 57, in convert_data
dcmrtstruct2nii(rtss_file, image_slice_dir, save_dir)
File "/gris/gris-f/homelv/me/anaconda3/envs/pytorch/lib/python3.8/site-packages/dcmrtstruct2nii/facade/dcmrtstruct2nii.py", line 66, in dcmrtstruct2nii
rtstructs = rtreader.ingest(rtstruct_file)
File "/gris/gris-f/homelv/me/anaconda3/envs/pytorch/lib/python3.8/site-packages/dcmrtstruct2nii/adapters/input/contours/rtstructinputadapter.py", line 62, in ingest
'z': ([contour.ContourData[index + 2] for index in range(0, len(contour.ContourData), 3)] if hasattr(contour, 'ContourData') else None) # this is just a fancy way to separate x, y, z from the rtstruct point array
File "/gris/gris-f/homelv/me/anaconda3/envs/pytorch/lib/python3.8/site-packages/dcmrtstruct2nii/adapters/input/contours/rtstructinputadapter.py", line 62, in <listcomp>
'z': ([contour.ContourData[index + 2] for index in range(0, len(contour.ContourData), 3)] if hasattr(contour, 'ContourData') else None) # this is just a fancy way to separate x, y, z from the rtstruct point array
IndexError: index out of range
I would guess it has something to do with contours (the mask)?
Best Karol
Do you know anything about this error @Sikerdebaard? Is this simply a limitation of the library or are the files corrupted?
Best Karol
This might be related to #10. Try downgrading scikit-image using pip install --upgrade scikit-image==0.17.1. I'll get to testing and merging this bugfix as soon as time allows.
I tested with scikit-image version 0.17.1 and the main branch and with thomas-albrecht's branch and version 0.18. Sadly I still get the same error for both variants.
@Karol-G, I may be late to the party but... Maybe the file that fail are some other type than closed planar? I ran into a similar error today while testing #37.