So I have stumbled on example of vtkResliceCursor which uses a vtkDICOMImageReader function SetDirectoryName for generating output. And I have a set of DICOM Files.
reader = vtkDICOMImageReader();
reader.SetDirectoryName("CT");
reader.Update();
imageDims = reader.GetOutput().GetDimensions();
But it is kinda not very flexible (like if you put multiple series in one directory, it will not work). So I tried to make a workaround, with using function SetFileNames, except it is absolutely not working for me.
reader = vtkDICOMImageReader();
files_path = [sop_instance.path_prefix for sop_instance in series] #generates X:\X\1.dcm 2.dcm and etc
array = vtkStringArray()
for file_path in files_path:
array.InsertNextValue(file_path)
reader.SetFilesName(array);
reader.Update();
imageDims = reader.GetOutput().GetDimensions();
except its not working. Just getting empty window
So my basic question what am I doing wrong? Is vtkDICOMImageReader is a good way of generating volume (model) for reslice cursor? I think about other workaround, although its kinda lame (generating folder, putting there all .dcm files of one series)