v2.0.0
Loading...
Searching...
No Matches
MRILIB::MriNiftiIO Class Reference

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)

Detailed Description

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.

Member Function Documentation

◆ decompress()

bool MriNiftiIO::decompress ( const QString & gzFile,
QByteArray & rawData )
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.

Parameters
[in]gzFilePath to the gzip-compressed input.
[out]rawDataOutput buffer.
Returns
True on success.

Definition at line 104 of file mri_nifti_io.cpp.

◆ read()

bool MriNiftiIO::read ( const QString & niiFile,
MriVolData & volData,
bool verbose = false )
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).

Parameters
[in]niiFilePath to the .nii or .nii.gz file.
[out]volDataVolume to populate.
[in]verbosePrint header geometry on success.
Returns
True on success, false on parse / I/O error.

Definition at line 153 of file mri_nifti_io.cpp.


The documentation for this class was generated from the following files: