20 #ifndef MIRTK_TransformationUtils_H 21 #define MIRTK_TransformationUtils_H 23 #include "mirtk/Transformation.h" 24 #include "mirtk/GenericImage.h" 25 #include "mirtk/Parallel.h" 29 namespace TransformationUtils {
37 const double *_x, *_y, *_z, *_t;
38 double *_dx, *_dy, *_dz;
43 const double *x,
const double *y,
const double *z,
const double *t,
44 double *dx,
double *dy,
double *dz)
46 _Transformation(transformation), _x(x), _y(y), _z(z), _t(t), _dx(dx), _dy(dy), _dz(dz)
51 const double *x = _x + re.begin();
52 const double *y = _y + re.begin();
53 const double *z = _z + re.begin();
54 const double *t = _t + re.begin();
55 double *dx = _dx + re.begin();
56 double *dy = _dy + re.begin();
57 double *dz = _dz + re.begin();
60 for (
int idx = re.begin(); idx < re.end(); ++idx, ++x, ++y, ++z, ++t, ++dx, ++dy, ++dz) {
61 tx = *x, ty = *y, tz = *z;
63 *dx -= tx, *dy -= ty, *dz -= tz;
73 double *_x, *_y, *_z, _t0, _t1;
80 _Transformation(transformation),
81 _x(x), _y(y), _z(z), _t0(t0), _t1(t), _t(NULL)
86 _Transformation(transformation),
87 _x(x), _y(y), _z(z), _t0(t0), _t1(.0), _t(t)
92 double *x = _x + idx.begin();
93 double *y = _y + idx.begin();
94 double *z = _z + idx.begin();
95 for (
int i = idx.begin(); i != idx.end(); ++i, ++x, ++y, ++z) {
96 _Transformation->
Transform(*x, *y, *z, (_t ? _t[i] : _t1), _t0);
107 const int _NumberOfPoints;
123 wx = _Coords->
Data() + idx.begin();
124 wy = wx + _NumberOfPoints;
125 wz = wy + _NumberOfPoints;
126 for (
int i = idx.begin(); i != idx.end(); ++i, ++wx, ++wy, ++wz) {
127 _Transformation->
Transform(*wx, *wy, *wz, _t, _t0);
135 #endif // MIRTK_TransformationUtils_H VoxelType * Data(int=0)
Get raw pointer to contiguous image data.
double GetTOrigin() const
Get temporal origin.
int NumberOfSpatialVoxels() const
Returns the total number of spatial voxels.
double VoxelType
Voxel type.