Firstly, I am sorry if this is a naive question, but I’ve tried to find something on the web and until now I could not fix my problem.
I have a small dataset with ASL and fMRI (both as 4D nii files) which I want to use Slicer to process it. However, I cannot load it simply by the Load volume module (apparently only the first volume is loaded).
I’ve checked DWIConverter module since this module has a flag (–fMRI) that may help me on this occasion. Nevertheless, I did not have success.
I wondering if there is a simple way to load 4D images in Slicer and then process it with a specific image processing module. Is there already a module to do that? If not, is it interesting to be implemented to the community? (I’m asking this because I can invest some time to figure it out to a simple CLI module if this is an interesting to several people)
Please give an example of the files or look at the error log ( X in bottom right corner) and post any errors.
There is a Sequences module and a Multi-Volume module, but I don’t think either one has support for nifti specifically (for the latter: https://issues.slicer.org/view.php?id=2972). A CLI would be the simplest way to add support for your specific nifti flavor. Be aware that there is a difference in ITK between a vector image and a 4D image. This causes some complication in the i/o code, and may be a reason why Slicer’s readers don’t work for your data. Nifti 3d multivolume, 3d+t, and 3d+1 (no-op dimension) are all common, so any code may need user assistance to disambiguate.
You can create a NIFTI importer for Sequences similarly how it is done for a different format (sequence metafile format) - see here https://github.com/SlicerRt/Sequences/tree/master/MetafileImporter. If you are not sure how to get started or stuck at any point then let me know.
In fact, the Slicer error log does not show any type of error when I tried
to load my data, however, only the first volume is shown. My data is
actually a series of 3D volumes concatenated through time (3D+t), as
usually applied in fMRI datasets. A similar behaviour is found when I try
to load a raw DTI data (1 b0 volume and N gradients in FSL format, i.e. one
nifti file, one .bval and one .bvec text files). If I load only the nifti
file from the 4D DWI, only the first volume appears in the scene and no
errors are shown.
Fortunately, in DWI-DTI cases, there is the SlicerDMRI module that deal
with the conversion from FSL data to Nrrd files. That’s fine. However, I
have not seen anything similar to fMRI-like dataset conversion, i.e. only a
series of 3D volumes through time.
I’ve also checked out the modules that you commented before, but it seems
that is not exactly what I am looking for here. Maybe they only work on
DICOM conversion. Am I right?
I hope that I am not creating more confusing with my question!
Thank you again for the quick response and suggestions!
Importing of 3D+t volumes are implemented by MultiVolumeImporter plugin. Once you loaded the image, you can browse between the frames using MultiVolumeExplorer module.
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.
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.
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.
The forum doesn’t allow upload of .nii files. Only jpg, jpeg, png and gif. How can I get you the data?
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.
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?