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:
reader = vtk.vtkDICOMImageReader() reader.SetDirectoryName("C:/tmp/00000005") reader.Update() selectTissue = vtk.vtkImageThreshold() ..... selectTissue.SetInputConnection(reader.GetOutputPort()) gaussian = vtk.vtkImageGaussianSmooth() ...... gaussian.SetInputConnection(selectTissue.GetOutputPort())
Someone could help me to understand the error or to fix my vtk pipeline?
Thanks a lot.