How to load 4D images in Slicer - fMRI or ASL datasets

Sorry, Andras! I have not seen your message! I will try it and get back as
soon as possible.
Thank you!

Importing of 3D+t volumes are implemented by MultiVolumeImporter plugin. Once you loaded the image, you can browse between the frames using MultiVolumeExplorer module.

1 Like

Great! MutliVolumeImporter solved the problem!

Thanks

I am interested in this topic. I have some Bruker cardiac data that I would like to look at in Slicer. I use a plugin in FIJI to convert the data from Bruker format to either Analyze or Nifti format. I looked at the MultiVolumeImporter and it seems to import nifti but the frames of the images are stacked in a single volume such that I cannot explore the multi-volumes. The advanced settings don’t make complete sense. Any pointers on this would be appreciated. Thanks
Doug

And I am actually quite surprised that Slicer does not have a generalized multi-volume/frame importer. It would be great to have to import framed PET data as well. If you know of resources showing how to do this, it would be appreciated as well.

There are not one but several ways of importing volume sequences.

If you have your volume as individual volume files in a folder then you have two main options:

Option A: If all volumes have the same geometry (origin, spacing, axis directions, extent)and they are all scalar volumes

Use MultiVolumeImporter module.

This module creates a Multivolume node. If you prefer volume sequence nodes (because you want to browse it along with other node types, have arbitrary number of time points extracted, etc.) then you can save the node as a nrrd file and when you load it into Slicer again, selecting Volume sequence in the Description column in Add data dialog.

Option B: In all other cases, for example volumes have different geometry or you want to import different data types (surface or volumetric meshes, point sets, tables, segmentations, etc)

  • Install Sequences extension.
  • Load your data set: drag-and-drop the folder to the Slicer application window, choose Any data, click OK, click OK.
  • Go to Sequences module.
  • Create a new Sequence node.
  • In Add/remove data nodes section, click on your first node of the sequence, click the green left arrow button.
  • Click the left arrow button until all nodes are added.

If you want to show the sequence playing in viewers:

  • Go to Sequence browser module
  • Select your sequence in the node selector at the top of Synchronized nodes section
  • Click the green + icon
  • You can click Rename checkbox to include index value in the proxy node name (that represents the selected sequence item in the scene)
  • Select the proxy node to be shown in slice viewer or volume renderer to see the volume

The latest version of the MultiVolumeImporter (as of just the last few days) will try to load 4D nifti data (xyzt) if it finds it as the only file in the import directory. This is new and we don’t have a lot of example data but it works for 4D data from the nifti site. The mac and linux nightly downloads are both broken today but it should work on windows or a local mac or linux build.

Thanks for the responses. I am still confused by this. The data I have are on the same grid as it was acquired with Intragate which retrospectively reconstructs phases of the heart cycle for a given acquisition. So technically, I should be using option A. The multivolumeImporter does identify the NIFTI format. But the image looks strange and it is such that I cannot cycle the heart phases. See attachment.

Thanks

Doug

I do have some additional suggestions, based on working in the preclinical area. Most datasets, dynamic framing or multivolume Cardiac data, comes in a single file. From a preclinical perspective, I like not having them as separate files for storage and retrieval. It would be cumbersome to have single files in individual directories. Most of the time a single directory has multiple nifti, raw or analyze files that are multi volume. Being able to select individual files would be a great thing to have.

Also having raw and analyze file imports would be great. Most image of the other image analysis software I use allows this flexibility and is intuitive (PMOD, Amira, FIJI, etc.). It is a bit surprising that this flexibility and intuitive import isn’t yet built into Slicer. This is what initially kept me from using Slicer.

Doug

1 Like

Can you share the dataset to reproduce the problem?

I am willing to send a dataset. The first message bounced back as the attachment was to large. I am trying it through the forum website.The attachment is a screen shot of the .nii properties from FIJI.

Capture

The forum doesn’t allow upload of .nii files. Only jpg, jpeg, png and gif. How can I get you the data?

Doug

You can put it on Dropbox, Box, MS Drive, Google Drive, etc and share a link

Thanks.

Hope this works.
Doug

Hi Doug -

Yes, this loaded for me as a 10 frame multivolume using a build of the current slicer source code (current nightly build for mac or windows should work, linux built from source would also work). So you can at play the frames and plot the pixel values.

HTH,
-Steve

@djrowland make sure you use the latest nightly

Thanks for checking it out. Does it work with the current stable release 4.8.1 for you? I have had issues with the nightly builds in the past and have kept to the stable release. It does not seem as though all the extensions are available in the nightly build, so it isn’t as useful to me.

I downloaded the nightly release and as you said it does work. Is there anyway to get the stable release to have this module working? The stable release in general is much more useful unless I am missing something with the extensions. But in general I don’t think I want to be using a nightly build or have to update on a daily or weekly basis by installing a nightly build.

Since the nightly build works, I tested having two nifti files in the same directory. It does not work well as it imports what looks to be the first frame of each multivolume and create it as a 2 frame multivolume. The project I am working on, we have already generated 40 separate images. I don’t want to have to create 40 separate directories for single nifti files. Will there be individual file support or will it remain as directory import?

Hi Doug -

This is a new feature, just added to the Nightly. There is a release planned in the next few weeks. It might be possible to use the newer code with the older release, I didn’t check.

Is there any chance you are a python programmer? Neither Andrey nor I have a particular use case for 4D nifti files but we added minimal support without planning to take on all possible uses. if you wanted to customize the interface to suit what’s most convenient that would be great.

Right now the code only tries to read a 4D nifti when there’s one file in the selected folder, but this could obviously be generalized to loop through and load all the files, but also some logic would be needed to tell when it’s a directory of 3D that should be one multivolume vs. a folder with more than one 4D volume. Perhaps the easiest would be just to add a file browser in addition to the directory browser, perhaps with a radio button to select which to use. None of this is especially hard to do, but it would be some work to implement, document, test, etc.

Again, thanks for all the help. Unfortunately, I am not a python programmer. I have had programming experience (Fortran for computations many years ago), but probably would take me a while to get to know the language and Slicer code. I could ask around here if someone is up to it.

I do like slicer now that I understand it a bit more. It was very helpful with some DTI reconstructions. I have been recommending it to our customers and I am trying to get it running for the group looking at the cardiac data. I think it will be very useful for them.
Doug

We hope you find it useful - I think everyone recognizes that Slicer is a bit of a beast and certainly not for everything.

Best,
Steve

4D cardiac DICOM import in Slicer is quite good. Probably one of the best among all open-source applications. If you find any problems with importing cardiac DICOM data then let us know.