Code covered by the BSD License  

Highlights from
NRRD Format File Reader

4.8 | 5 ratings Rate this file 74 Downloads (last 30 days) File Size: 2.67 KB File ID: #34653 Version: 1.1

NRRD Format File Reader


Jeff Mather (view profile)


18 Jan 2012 (Updated )

Read imagery and metadata from .nrrd medical imaging format files.

| Watch this File

File Information

Read volumetric data from the NRRD (.nrrd) medical imagery file format. This function returns the image volume and all of the metadata stored in the file.


This file inspired Nrrd Format File Reader, Nrrd Writer(Filename, Matrix, Pixelspacing, Origin, Encoding), and Nrrdmeta2num(Imgh).

Required Products MATLAB
MATLAB release MATLAB 7.13 (R2011b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (6)
22 Oct 2015 Ibraheem Al-Dhamari

Voxels values are not correct. Voxels values in Slicer3D and MITK are the same but in matlab are different.

Comment only
08 Jul 2015 Ibraheem Al-Dhamari

very useful,
it would be nice if the numeric meta data extracted as numbers instead of characters.

20 May 2015 Ilya Belevich  
28 Feb 2015 Nima Tajbakhsh

Good job! One limitation I encountered is that some temporary files that are created during the code execution are not deleted at the end. It can be a serious problem in the case of medical images where each temporary file is about 200MB. To fix this, I commented out the following line of the code

cleaner = onCleanup(@() fclose(fidTmp));

and added the followings at the end of "case {'gzip', 'gz'}."

system(['del ' tmpFile])
system(['del ' tmpBase])

01 Jul 2013 Roi mehrez

you might have a problam in the fopen. fileID in the function readData point the nhdr and the data file

30 Jul 2012 Maxime

Maxime (view profile)

03 Feb 2012 1.1

Removed "author" info.

Contact us