With vtkDICOMImageReader() I tried to read a single 3D DICOM file. Unfortunately, this reader does not handle multi-frames DICOM datasets (as documented https://vtk.org/doc/nightly/html/classvtkDICOMImageReader.html#details), which I think I have. How can I read a multi-frames DICOM dataset with VTK?
This don’t gives an error code, but when rendering, also don’t give an output visualization.
import vtk
dir = “soure to directory”
reader = vtk.vtkDICOMImageReader()
reader.SetDirectoryName(dir)
reader.Update()
vtk-dicom provides Python wrapping, but I don’t now if it is available on the Python Package Index or elsewhere.
If you work with medical imaging in Python then I would recommend to consider using a Python environment built specifically for this, such as 3D Slicer. It has lots of DICOM import/export tools, not just for images but for segmentation, registration, structured reports, RT objects, etc., lots of visualization and processing options, etc. You can run any Python scripts as in a generic Python environment and you can install all packages from the Python Package, but you also get lots of additional features.