Hi There,
Is there a way to display 2D time series such as cine in 3D Slicer? I converted one 2D time series with 30 images into nii.gz but can only display one image in 3D Slicer.
Thanks,
Wei
Hi There,
Is there a way to display 2D time series such as cine in 3D Slicer? I converted one 2D time series with 30 images into nii.gz but can only display one image in 3D Slicer.
Thanks,
Wei
Hi, the Sequences module was developed for time series. I’ve been using it for time series of 2D ultrasound successfully. There is not a lot of support for importing different file formats as sequences, so if you have a video file, you may need to implement the importing process. And once you have the data in Slicer, it’s easiest to just save it as a Slicer scene. But some DICOM format time series already load as sequences, so it’s worth trying before you implement your own importer code.
you might need to save each timepoint as seperate nii.gz’s to load it into a sequence.
I tried it but it did not work for my data. Thank you for your suggestion!
To be able to load a time series directly to Slicer, a specially formatted NRRD is needed, see the CTP Cardio file for example (you can load it using the Sample Data module and the file will be in c:\Users\[You]\AppData\Local\slicer.org\Slicer\cache\SlicerIO
However, the best would probably be what @ungi suggests. You can make a sequence from a set of images with a bit of scripting. This is a script I created to read in a set of transforms into a sequence. You need to modify it just a bit to load the images into a sequence.
# Create a sequence node
sequenceNode = slicer.mrmlScene.AddNewNodeByClass("vtkMRMLSequenceNode", "GridTransforms")
sequenceNode.SetIndexName("time")
sequenceNode.SetIndexUnit("")
# Get all transform files in the directory
transformFiles = glob.glob(f"{transformFilesPath}/Transform_*.h5")
transformFiles.sort() # Sort to ensure correct order
# Process each file
for frameIndex, filePath in enumerate(transformFiles):
# Load the grid transform from HDF5
transformNode = slicer.util.loadTransform(filePath)
if transformNode is None:
print(f"Failed to load transform from {filePath}")
continue
# Add the transform node to the sequence
sequenceNode.SetDataNodeAtValue(transformNode, str(frameIndex))
slicer.mrmlScene.RemoveNode(transformNode)
# Create a sequence browser node
browserNode = slicer.mrmlScene.AddNewNodeByClass("vtkMRMLSequenceBrowserNode", "GridTransformsBrowser")
browserNode.AddSynchronizedSequenceNode(sequenceNode.GetID())