NRRD vs NIFTI: which one to choose?

Loading speed: Loading a 3D array from nrrd or nifti is just as fast as loading from npy/npz file. You may have compared uncompressed npy loading time to compressed nrrd/nifti loading times. All these formats can optionally use compression, which typically cuts required disk space by half and increases loading time by 5-10x. Loading from DICOM files (single-frame-per-file) takes about 100x more time than loading the same volume from nrrd/nifty/npy (regardless of compression).

Fast loading of course is not the only factor consider, so normally you will use all three kind of data representations: DICOM, research file formats (nrrd, nifti), and tensor files (numpy npy/npz arrays or other specialized hypercube storage). Each file format has its own very important role:

  • DICOM: long-term archival format, preserves all metadata and UIDs; usable across projects and institutions; very slow and complicated.
  • Research file formats (nrrd, nifti): preserves essential metadata (i.e., image geometry); suitable for representing a single cohort, usable across experiments within a single project, by a small group of collaborators; fast and simple, suitable for images only.
  • Numpy array (npy, npz): does not preserve metadata, therefore it is only usable for a single experiment, by one or few closely collaborating researchers; fast and very simple, supports arbitrary dimensions and can represent non-image vector data.
1 Like