0

I'm building a system for viewing DICOM files. DICOM files located in the specified folder are read with dcmread and put in a list. I check the metadata to separate the series by the series number in the information, then I create a dictionary with several lists, one for each series, which contain the respective scans. In the program, therefore, I can select which series to display with the 3D reconstruction. I noticed however that with vtkDICOMImageReader I can only specify a file or a directory. Can I also select a list containing DICOM files in some way?

Amit Joshi
  • 15,448
  • 21
  • 77
  • 141
Gibser
  • 197
  • 8
  • what does this have to do with pydicom? – Richard Nov 16 '20 at 21:31
  • @Richard I use pydicom.dcmread to read files from directories. The resulting array contains the scans read via this function, which I have to somehow view with vtk – Gibser Nov 16 '20 at 23:44

1 Answers1

0

vtkDICOMImageReader derives from vtkImageReader2, you can use the vtkImageReader2::SetFileNames(vtkStringArray *)


By design vtkImageReader2 needs to read the files from disk (think UpdateExtent != WholeExtent).

If you are looking to import a c-array as an image into VTK, you should instead start using:

malat
  • 12,152
  • 13
  • 89
  • 158
  • Correct me if I'm wrong, but SetFileNames() takes in an array of strings that contains the names of the files to be read on disk, while I have an array that contains the DICOM files already read from the disk with dcmread – Gibser Nov 16 '20 at 14:16