Hi there. I’ve been using some code from the example section to read DICOM files. My code looks very similar to the one from this example. I’ve been using it successfully with DICOM files from the internet. Then I moved to our own DICOM files captured less than a month ago. And it fails with the error:
2021-10-25 13:07:26.402 ( 9.416s) [ ]vtkDICOMImageReader.cxx:325 ERR| vtkDICOMImageReader (0000016FC5505BA0): There was a problem retrieving data from: C:/tmp/00000005/00000001.dcm
2021-10-25 13:07:26.476 ( 9.491s) [ ] vtkExecutive.cxx:753 ERR| vtkCompositeDataPipeline (0000016FC832DAB0): Algorithm vtkDICOMImageReader(0000016FC5505BA0) returned failure for request: vtkInformation (0000016FC8252100)
Debug: Off
Modified Time: 211
Reference Count: 1
Registered Events: (none)
Request: REQUEST_DATA
FORWARD_DIRECTION: 0
ALGORITHM_AFTER_FORWARD: 1
FROM_OUTPUT_PORT: 0
I am confident that the DICOM files are not corrupted because I can open them and plot them using pydicom library. But I’d like to use VTK rendering. That’s why I tried to read the files with pydicom into a numpy array and then use the numpy_support.numpy_to_vtk to convert into a vtk array. But then I don’t know how to insert those images into my vtk pipeline that uses the reader.GetOutputPort() to initiate the pipeline:
Hi, I’m also facing a similar issue, when I try to read the DICOM file, I get an empty pop up screen. But it works if I use only a single image from the DICOM file but of course, volume rendering does not work then.
Did you manage to fix it or understand how to insert the vtk arrays into the vtk pipeline?
Hi, I just succeed to read my dicom files with pydicom. Compute HU units, normalize, sample and export to a numpy file as done here. And then import it into VTK using some code like this: