Hello. I am running into an error processing a medical image segmentation DICOM file from The Cancer Imaging Archive. When I call itk.imread() on the datapoint, the GDCMImageIo library is throwing an Unhandled PixelFormat: SamplesPerPixel :1 error.
The python SimpleITK library throws the same error.
1. itk.imread(seg_file)
Dicom mask file is loaded into an image.
Log from crash
>>> segpath
'/nvdata/NSCLC-Radiogenomics-Fresh/NSCLC Radiogenomics/R01-041/09-07-1992-CT THORAX WO DYE-33339/1000.000000-3D Slicer segmentation result-38898/1-1.dcm'
>>> itkseg = itk.imread(segpath)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/gagan/anaconda3/envs/monai/lib/python3.8/site-packages/itkExtras.py", line 645, in imread
reader = TemplateReaderType.New(**kwargs)
File "/home/gagan/anaconda3/envs/monai/lib/python3.8/site-packages/itkTemplate.py", line 469, in New
return self._NewImageReader(itk.ImageFileReader, False, 'FileName', *args, **kwargs)
File "/home/gagan/anaconda3/envs/monai/lib/python3.8/site-packages/itkTemplate.py", line 555, in _NewImageReader
imageIO.ReadImageInformation()
RuntimeError: /work/ITK-source/ITK/Modules/IO/GDCM/src/itkGDCMImageIO.cxx:465:
itk::ERROR: itk::ERROR: GDCMImageIO(0x5633c7065c20): Unhandled PixelFormat: SamplesPerPixel :1
BitsAllocated :1
BitsStored :1
HighBit :0
PixelRepresentation:0
ScalarType found :SINGLEBIT
I am using CT scan image data from this NSCLC Radiogenomics TCIA dataset. The error happens every time I try to a patients 3d chest ct segmentation .dcm file.
Debian Buster, Cmake == 3.16.3, itk == 5.1.1, python == 3.8.3
I want to use the GDCM SingleBit pixelformat in the GDCM docs, but I am not sure how to pass it in through itk.
I've learned the file is saved as a Dicom-RT file. I was able to load it with pydicom and got a pydicom.dataset.FileDataset file. Is it possible to do this with ITK?
@issakomi and/or @malaterre can best answer this.
Unfortunately _singlebit_ is not implemented in GDCM IO. It is defined in GDCM, should be not very difficult to add, AFAIK.
I'm not sure how to add the feature but I would be happy to test it out.
WIP
https://github.com/InsightSoftwareConsortium/ITK/pull/2004
Edit:
PR is ready, sample file and simple test s. post