21 #ifndef MIRTK_FluidFreeFormTransformation_H 22 #define MIRTK_FluidFreeFormTransformation_H 24 #include "mirtk/MultiLevelTransformation.h" 26 #include "mirtk/Memory.h" 106 int &,
int &,
int &,
double = 1)
const;
120 int = 1,
double = .0);
130 virtual double Approximate(
const double *,
const double *,
const double *,
131 double *,
double *,
double *,
int,
132 int = 1,
double = .0);
142 virtual double Approximate(
const double *,
const double *,
const double *,
const double *,
143 double *,
double *,
double *,
int,
144 int = 1,
double = .0);
154 int = 1,
double = .0);
163 virtual double ApproximateAsNew(
const double *,
const double *,
const double *,
164 double *,
double *,
double *,
int,
165 int = 1,
double = .0);
174 virtual double ApproximateAsNew(
const double *,
const double *,
const double *,
const double *,
175 double *,
double *,
double *,
int,
176 int = 1,
double = .0);
181 virtual void ApproximateDOFs(
const double *,
const double *,
const double *,
const double *,
182 const double *,
const double *,
const double *,
int);
189 const double *,
const double *,
const double *,
int,
190 double *,
double = 1.0)
const;
203 virtual void Reset();
206 virtual void Clear();
217 virtual void Transform(
int,
int,
double &,
double &,
double &,
double = 0,
double = -1)
const;
220 virtual bool Inverse(
int,
int,
double &,
double &,
double &,
double = 0,
double = -1)
const;
276 double = -1,
double = 1)
const;
281 double *,
double = 0,
double = -1,
double = 1)
const;
290 virtual void Jacobian(
int,
int,
Matrix &,
double,
double,
double,
double = 0,
double = -1)
const;
293 virtual void Hessian(
int,
int,
Matrix [3],
double,
double,
double,
double = 0,
double = -1)
const;
344 int &i2,
int &j2,
int &k2,
double fraction)
const 348 const int n = DOFIndexToLocalTransformation(
this, dof, ffd, dof);
351 double x1, y1, z1, x2, y2, z2;
355 this->
Inverse(-1, n, x1, y1, z1);
356 this->
Inverse(-1, n, x2, y2, z2);
362 if (x2 < x1) swap(x1, x2);
363 if (y2 < y1) swap(y1, y2);
364 if (z2 < z1) swap(z1, z2);
367 i1 =
static_cast<int>(ceil (x1));
368 i2 =
static_cast<int>(floor(x2));
369 j1 =
static_cast<int>(ceil (y1));
370 j2 =
static_cast<int>(floor(y2));
371 k1 =
static_cast<int>(ceil (z1));
372 k2 =
static_cast<int>(floor(z2));
377 i1 = (i1 < 0 ? 0 : (i1 >= image->
X() ? image->
X() : i1));
378 i2 = (i2 < 0 ? -1 : (i2 >= image->
X() ? image->
X() - 1 : i2));
379 j1 = (j1 < 0 ? 0 : (j1 >= image->
Y() ? image->
Y() : j1));
380 j2 = (j2 < 0 ? -1 : (j2 >= image->
Y() ? image->
Y() - 1 : j2));
381 k1 = (k1 < 0 ? 0 : (k1 >= image->
Z() ? image->
Z() : k1));
382 k2 = (k2 < 0 ? -1 : (k2 >= image->
Z() ? image->
Z() - 1 : k2));
383 return i1 <= i2 && j1 <= j2 && k1 <= k2;
389 #endif // MIRTK_FluidFreeFormTransformation_H
void WorldToImage(double &, double &) const
World to image coordinate conversion with two doubles.
int Y() const
Returns the number of voxels in the y-direction.
int X() const
Returns the number of voxels in the x-direction.
int Z() const
Returns the number of voxels in the z-direction.