Loading of 4D nrrd data - Volume Sequence not available

Dear all,

I am trying to load a 4D nrrd file with size 256x256x120x20 (4D MRI data).

However, it seems that the fourth dimension is not detected.

The header of the file is the following:

NRRD0004
# Complete NRRD file format specification at:
# http://teem.sourceforge.net/nrrd/format.html
type: float
dimension: 4
sizes: 256 256 120 20
thicknesses: 1.7578125 1.7578125 1.8 6.9515382523280928e-310
kinds: space space space time
labels: "x" "y" "z" "t"
endian: little
encoding: raw
# PatientPos order is Sag, Cor, Tra in mm
ImageOffset:=-215.285, -214.737, 109.759
SliceOrientation:=0
PatientPos:=-215.285, -214.737, -108.859

Am I missing something?

Thanks in advance!

See how you can create a valid 4D volume here.

Note that the image geometry fields are not set correctly in your example above. You can drop the custom fields (ImageOffset, SliceOrientation, PatientPos) and properly set the image geometry in the standard space directions (from Image Position Patient of the first slice) and space origin fields (from Image Orientation Patient and Pixel Spacing DICOM tags and slice spacing that you compute from difference of Image Position Patient values in neighbor slices). The thicknesses field can be safely removed, too, as it is not used anywhere (slice thickness is not used when a 3D volume is reconstructed from slices). If the image header was generated by some software package and not just a result of your experimentation then notify the developer of that package that the changes are needed.

What kind of volume are you trying to load? A 4D cardiac CT, ultrasound, MRI…? Slicer should be able to load them correctly as a volume sequence.

1 Like

Dear Andras,

many thanks for your reply.

The data is 4D MRI reconstructed from a 3D MRI dataset.
Using your hints I will reiterate the generation of the data header within the reconstruction process.

Unfortunately, after changing the geometry fields as described, I am still not able to load the dataset into Slicer.
The header now is the following:

NRRD0005
# This NRRD file was generated by pynrrd
# on 2022-01-27 11:44:32(GMT).
# Complete NRRD file format specification at:
# http://teem.sourceforge.net/nrrd/format.html
type: float
dimension: 4
space: left-posterior-superior
sizes: 256 256 120 20
space directions: (1.7578100000000001,0,0) (0,1.7578100000000001,0) (0,0,1.7999999999999972) none
kinds: domain domain domain time
endian: little
encoding: gzip
space origin: (-215.285,-214.73699999999999,105.34099999999999)

Additionally, I took the original 3D MRI Dicom data, loaded it into Slicer and saved ist as .nrrd to check on the header which looks like this:

NRRD0004
# Complete NRRD file format specification at:
# http://teem.sourceforge.net/nrrd/format.html
type: unsigned short
dimension: 3
space: left-posterior-superior
sizes: 256 256 120
space directions: (1.7578099999999999,0,0) (0,1.7578099999999999,0) (0,0,1.7999999999999996)
kinds: domain domain domain
endian: little
encoding: gzip
space origin: (-215.285,-214.73699999999999,105.34099999999998)

For me (as a Slicer/nrrd beginner) the header that was generated for the 4D dataset looks reasonable.

Might there be any other issue with the header or data?

An additional information: using other tools like e.g. Matlab I was able to read the data, so that I can assume that the dataset is not corrupt.

I would be happy about any hints, thanks in advance.

This looks much better now! By default, NRRD fines are loaded as a 3D volume. You can either change the file extension to .seq.nrrd to change the default to “Volume Sequence” or select that in the Description column in the “Add data” window manually.

Have your tried to reconstruct the 4D data using SlicerIGSIO extension? See an example here:

Thanks for coming back again to this question.

Unfortunately, the option “Volume Seqeunce” is not listed in the Description column.


I tried to choose “Sequence” in the Description column which lead to the following error message:

The version of Slicer I am using is 4.11.20210226.

Thank you for suggesting the SlicerIGSIO. After having a quick look, I guess that for our case this is not applicable, since we extract breathing information from the data in the reconstruction phase to sort the data accordingly.

Please use the latest Slicer Preview Release and let us know if you still have questions.

Thank you for the suggestion.
Now using version 4.13.0-2022-01-28 the issue remains, still not showing the Option “Volume Sequence” but bringing up the following error message:

AddingDataFailed

One thing I was thinking about is, if the fourth entry “none” in space directions is correct?
I would assume yes, but running out of ideas here.