matnrrd is a MATLAB library that provides easy-to-use functions for loading and saving NRRD files. One feature that sets matnrrd apart from other NRRD readers is that it parses the metadata fields into sensible datatypes.
matnrrd can be found on MATLAB File Exchange as well.
Download this repository and copy/paste nrrdread.m and nrrdwrite.m somewhere in your MATLAB path. You are ready to go!
Download the entire repository and run test.m script.
[data, metadata] = nrrdread('data/test1d_ascii.nrrd');
metadata.encoding = 'raw';
nrrdwrite('test.nrrd', data, metadata);
See help of nrrdread and nrrdwrite for more information on how to use these functions.
See LICENSE