v2.0.0
Loading...
Searching...
No Matches
mri_vol_data.h
Go to the documentation of this file.
1//=============================================================================================================
43
44#ifndef MRI_VOL_DATA_H
45#define MRI_VOL_DATA_H
46
47//=============================================================================================================
48// INCLUDES
49//=============================================================================================================
50
51#include "mri_global.h"
52#include "mri_types.h"
53
55
56//=============================================================================================================
57// QT INCLUDES
58//=============================================================================================================
59
60#include <QString>
61#include <QVector>
62
63//=============================================================================================================
64// EIGEN INCLUDES
65//=============================================================================================================
66
67#include <Eigen/Core>
68
69//=============================================================================================================
70// DEFINE NAMESPACE MRILIB
71//=============================================================================================================
72
73namespace MRILIB {
74
75//=============================================================================================================
88{
89 QString fileName;
90 QVector<unsigned char> pixels;
91 QVector<unsigned short> pixelsWord;
92 QVector<float> pixelsFloat;
94 int width;
95 int height;
96 float dimx;
97 float dimy;
98 float scale;
100
101 //=========================================================================================================
106 : pixelFormat(1) // FIFFV_MRI_PIXEL_BYTE
107 , width(0)
108 , height(0)
111 , scale(1.0f)
112 {}
113};
114
115//=============================================================================================================
149{
150public:
151 //=========================================================================================================
155 MriVolData();
156
157 //=========================================================================================================
169 bool read(const QString& path);
170
171 //=========================================================================================================
177 bool isValid() const;
178
179 //=========================================================================================================
183 int dimX() const { return width; }
184
185 //=========================================================================================================
189 int dimY() const { return height; }
190
191 //=========================================================================================================
195 int dimZ() const { return depth; }
196
197 //=========================================================================================================
201 QVector<int> dims() const { return {width, height, depth}; }
202
203 //=========================================================================================================
213 QVector<float> voxelDataAsFloat() const;
214
215 //=========================================================================================================
227 Eigen::Matrix4f computeVox2Ras() const;
228
229 //=========================================================================================================
230 // MGH Header Fields
231 //=========================================================================================================
232
233 QString fileName;
235 int width;
236 int height;
237 int depth;
239 int type;
240 int dof;
241 bool rasGood;
242 float xsize;
243 float ysize;
244 float zsize;
245 Eigen::Vector3f x_ras;
246 Eigen::Vector3f y_ras;
247 Eigen::Vector3f z_ras;
248 Eigen::Vector3f c_ras;
249
250 //=========================================================================================================
251 // Coordinate Transforms
252 //=========================================================================================================
253
255
256 //=========================================================================================================
257 // Optional Footer Data (scan parameters)
258 //=========================================================================================================
259
260 float TR;
261 float flipAngle;
262 float TE;
263 float TI;
264 float FoV;
265
266 //=========================================================================================================
267 // Talairach Transform
268 //=========================================================================================================
269
271
272 //=========================================================================================================
273 // Slice Data
274 //=========================================================================================================
275
276 QVector<MriSlice> slices;
277};
278
279} // namespace MRILIB
280
281#endif // MRI_VOL_DATA_H
MRI library export/import macros.
#define MRISHARED_EXPORT
Definition mri_global.h:50
MRI type definitions and constants.
FiffCoordTrans class declaration.
MRI volume and coordinate-system I/O (volumes, voxel geometry, transforms).
constexpr float COR_PIXEL_SIZE
Definition mri_types.h:143
Coordinate transformation description.
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