I think that’s a rather simple question but I just cannot get my head around how to solve this. I managed to use SimpleITK for displaying both DICOM files and folders and single Nifti (or other files) using slicer as viewer. But what about sending multiple nii-files (e.g. different sequences) to Slicer?
Having a time sequence as a series of files is not overly common. The usual way is to have a single image of higher dimension. You should be able to read them using series reader, but you need to construct the list of file names (std::vector<std::string>) yourself.
It’s less a time series saved as files but rather providing an overview of the available sequences so that I have the opportunity to spot major issues. I have about 4-10 sequences of nii-files in a folder, and I would like to work with them instead of downloading the DICOM files again. Actually, I tried stacking them in an additional dimension but I can tell you it’s not the most elegant thing I have ever coded.
Just so that I get you right, you mean something like:
file_names = [filename for filenamein os.listdir(nifti_dir)]
series_reader = sitk.ImageSeriesReader()
series_reader.SetFileNames(file_names)
Yet, that doesn’t work with sitk.Show. I am clearly missing something here. Thanks for your help.
I would not recommend using the Show function to view the images as it creates a copy of each image and then opens that file in your file viewer of choice (default is Fiji, which you already know).
With Slicer you can open them with the MultiVolumeImporter and view with the MultiVolumeExplorer (see discussion here). I’m not a slicer expert so not sure if you can do this programmatically/commandline.