Stateless decoder for NIfTI-1 single-file volumes (.nii and .nii.gz).
More...
#include <mri_nifti_io.h>
Static Public Member Functions | |
| static bool | read (const QString &niiFile, MriVolData &volData, bool verbose=false) |
| static bool | decompress (const QString &gzFile, QByteArray &rawData) |
Stateless decoder for NIfTI-1 single-file volumes (.nii and .nii.gz).
Parses the 348-byte fixed-size header, expands any voxel-type / endianness combination NIfTI-1 supports into the canonical 16-bit unsigned slice buffer produced by MriMghIO, and resolves voxel\u2192RAS via the sform/qform/pixdim priority chain. The class is a pure namespace of static methods so callers can use it without owning any state; the populated MriVolData carries the result.
Definition at line 72 of file mri_nifti_io.h.
|
static |
Decompresses a .nii.gz file into rawData.
Exposed for direct use by tests; read calls it transparently when the input path ends in .gz.
| [in] | gzFile | Path to the gzip-compressed input. |
| [out] | rawData | Output buffer. |
Definition at line 104 of file mri_nifti_io.cpp.
|
static |
Reads a NIfTI-1 single-file volume.
For .nii.gz inputs the file is decompressed in memory via zlib (re-using the same MAX_WBITS+16 strategy as MriMghIO).
| [in] | niiFile | Path to the .nii or .nii.gz file. |
| [out] | volData | Volume to populate. |
| [in] | verbose | Print header geometry on success. |
Definition at line 153 of file mri_nifti_io.cpp.