v2.0.0
Loading...
Searching...
No Matches
mri_mgh_io.h
Go to the documentation of this file.
1//=============================================================================================================
59
60#ifndef MRI_MGH_IO_H
61#define MRI_MGH_IO_H
62
63//=============================================================================================================
64// INCLUDES
65//=============================================================================================================
66
67#include "mri_global.h"
68#include "mri_vol_data.h"
69
70//=============================================================================================================
71// QT INCLUDES
72//=============================================================================================================
73
74#include <QString>
75#include <QVector>
76
77//=============================================================================================================
78// DEFINE NAMESPACE MRILIB
79//=============================================================================================================
80
81namespace MRILIB
82{
83
84//=============================================================================================================
104{
105public:
106 //=========================================================================================================
124 static bool read(const QString& mgzFile,
125 MriVolData& volData,
126 QVector<FIFFLIB::FiffCoordTrans>& additionalTrans,
127 const QString& subjectMriDir = QString(),
128 bool verbose = false);
129
130private:
131 //=========================================================================================================
140 static bool decompress(const QString& mgzFile, QByteArray& rawData);
141
142 //=========================================================================================================
152 static bool parseHeader(const QByteArray& data, MriVolData& volData, bool verbose);
153
154 //=========================================================================================================
163 static bool readVoxelData(const QByteArray& data, MriVolData& volData);
164
165 //=========================================================================================================
177 static bool parseFooter(const QByteArray& data,
178 MriVolData& volData,
179 QVector<FIFFLIB::FiffCoordTrans>& additionalTrans,
180 const QString& subjectMriDir,
181 bool verbose);
182
183 //=========================================================================================================
191 static int bytesPerVoxel(int type);
192};
193
194} // namespace MRILIB
195
196#endif // MRI_MGH_IO_H
Format-agnostic in-memory representation of a 3D MRI volume plus its slice decomposition.
Export/import macros and build-info accessors for MRILIB.
#define MRISHARED_EXPORT
Definition mri_global.h:39
Volume I/O, voxel geometry and slice resampling for structural MRI data inside mne-cpp.
Stateless decoder for FreeSurfer MGH and MGZ volume containers.
Definition mri_mgh_io.h:104
static bool read(const QString &mgzFile, MriVolData &volData, QVector< FIFFLIB::FiffCoordTrans > &additionalTrans, const QString &subjectMriDir=QString(), bool verbose=false)
Format-agnostic 3D MRI volume: header geometry, voxel buffer (as a vector of MriSlice),...