Loading multiple MRI series (T1, T2, FLAIR, ...) under one subject

Hello,

I am currently working on the BraTS dataset with different MRI sequences (T1, T2, FLAIR, T1CE) saved as separate *.nii.gz files. I am trying to write a script that can load all sequences under a subject so that the segmentation can be seen in all sequences. It is also possible that there is a better way to do this.

I found how to load a single sequence using

slicer.util.loadVolume(path_to_single_file)

But I’d like to create a parent subject that contains all segmentations (programmatically).

Thanks a lot for your help!

Slicer does not support reading 3D+t NIFTI files. You could convert them to 4D NRRD files (read using nibabel and write using pynrrd Python packages). However, since the BraTS image files contain unrelated 3D volumes (they are not a volume sequence but independent acquisitions with very different properties), it is probably more appropriate to save them as separate 3D images.

1 Like