v2.0.0
Loading...
Searching...
No Matches
mri_vol_data.h
Go to the documentation of this file.
1//=============================================================================================================
41
42#ifndef MRI_VOL_DATA_H
43#define MRI_VOL_DATA_H
44
45//=============================================================================================================
46// INCLUDES
47//=============================================================================================================
48
49#include "mri_global.h"
50#include "mri_types.h"
51
53
54//=============================================================================================================
55// QT INCLUDES
56//=============================================================================================================
57
58#include <QString>
59#include <QVector>
60
61//=============================================================================================================
62// EIGEN INCLUDES
63//=============================================================================================================
64
65#include <Eigen/Core>
66
67//=============================================================================================================
68// DEFINE NAMESPACE MRILIB
69//=============================================================================================================
70
71namespace MRILIB
72{
73
74//=============================================================================================================
92{
93 QString fileName;
94 QVector<unsigned char> pixels;
95 QVector<unsigned short> pixelsWord;
96 QVector<float> pixelsFloat;
98 int width;
99 int height;
100 float dimx;
101 float dimy;
102 float scale;
104
105 //=========================================================================================================
110 : pixelFormat(1) // FIFFV_MRI_PIXEL_BYTE
111 , width(0)
112 , height(0)
115 , scale(1.0f)
116 {
117 }
118};
119
120//=============================================================================================================
148{
149public:
150 //=========================================================================================================
154 MriVolData();
155
156 //=========================================================================================================
168 bool read(const QString& path);
169
170 //=========================================================================================================
176 bool isValid() const;
177
178 //=========================================================================================================
182 int dimX() const
183 {
184 return width;
185 }
186
187 //=========================================================================================================
191 int dimY() const
192 {
193 return height;
194 }
195
196 //=========================================================================================================
200 int dimZ() const
201 {
202 return depth;
203 }
204
205 //=========================================================================================================
209 QVector<int> dims() const
210 {
211 return {width, height, depth};
212 }
213
214 //=========================================================================================================
224 QVector<float> voxelDataAsFloat() const;
225
226 //=========================================================================================================
238 Eigen::Matrix4f computeVox2Ras() const;
239
240 //=========================================================================================================
249 Eigen::Matrix4f computeVox2RasTkr() const;
250
251 //=========================================================================================================
252 // MGH Header Fields
253 //=========================================================================================================
254
255 QString fileName;
257 int width;
258 int height;
259 int depth;
261 int type;
262 int dof;
263 bool rasGood;
264 float xsize;
265 float ysize;
266 float zsize;
267 Eigen::Vector3f x_ras;
268 Eigen::Vector3f y_ras;
269 Eigen::Vector3f z_ras;
270 Eigen::Vector3f c_ras;
271
272 //=========================================================================================================
273 // Coordinate Transforms
274 //=========================================================================================================
275
277
278 //=========================================================================================================
279 // Optional Footer Data (scan parameters)
280 //=========================================================================================================
281
282 float TR;
283 float flipAngle;
284 float TE;
285 float TI;
286 float FoV;
287
288 //=========================================================================================================
289 // Talairach Transform
290 //=========================================================================================================
291
293
294 //=========================================================================================================
295 // Slice Data
296 //=========================================================================================================
297
298 QVector<MriSlice> slices;
299};
300
301} // namespace MRILIB
302
303#endif // MRI_VOL_DATA_H
4x4 affine FIFF coordinate transform (FIFF_COORD_TRANS) annotated with source/destination coordinate-...
Export/import macros and build-info accessors for MRILIB.
#define MRISHARED_EXPORT
Definition mri_global.h:39
Numeric type codes, layout constants, and sentinel values shared by every MRI reader.
Volume I/O, voxel geometry and slice resampling for structural MRI data inside mne-cpp.
constexpr float COR_PIXEL_SIZE
Definition mri_types.h:137
Labelled 4x4 FIFF affine: source frame, destination frame, rotation, translation and cached inverse.
QVector< unsigned char > pixels
FIFFLIB::FiffCoordTrans trans
QVector< unsigned short > pixelsWord
QVector< float > pixelsFloat
FIFFLIB::FiffCoordTrans voxelSurfRasT
Eigen::Vector3f y_ras
bool read(const QString &path)
QVector< int > dims() const
bool isValid() const
Eigen::Vector3f x_ras
QVector< MriSlice > slices
Eigen::Vector3f z_ras
Eigen::Vector3f c_ras