21 #ifndef MIRTK_BSplineFreeFormTransformation4D_H 22 #define MIRTK_BSplineFreeFormTransformation4D_H 24 #include "mirtk/FreeFormTransformation4D.h" 26 #include "mirtk/FastCubicBSplineInterpolateImageFunction4D.h" 27 #include "mirtk/TransformationJacobian.h" 71 double,
double,
double,
double,
72 double,
double,
double,
double,
73 double *,
double *,
double *);
77 double = -1,
double = -1,
double = -1,
double = -1);
81 double,
double,
double,
double);
95 virtual void ApproximateDOFs(
const double *,
const double *,
const double *,
const double *,
96 const double *,
const double *,
const double *,
int);
103 const double *,
const double *,
const double *,
int,
104 double *,
double = 1.0)
const;
108 virtual void Interpolate(
const double *,
const double *,
const double *);
140 virtual void Subdivide(
bool =
true,
bool =
true,
bool =
true,
bool =
true);
145 virtual void BoundingBox(
int,
double &,
double &,
double = 1)
const;
150 virtual void BoundingBox(
int,
double &,
double &,
double &,
151 double &,
double &,
double &,
double = 1)
const;
156 virtual void BoundingBox(
int,
double &,
double &,
double &,
double &,
157 double &,
double &,
double &,
double &,
double = 1)
const;
163 void Evaluate(
double &,
double &,
double &,
double)
const;
181 double,
double,
double,
double)
const;
215 virtual void LocalTransform(
double &,
double &,
double &,
double,
double = NaN)
const;
228 virtual void LocalHessian(
Matrix [3],
double,
double,
double,
double,
double = NaN)
const;
231 virtual void JacobianDOFs(
Matrix &,
int,
int,
int,
int,
double,
double,
double,
double,
double = NaN)
const;
234 virtual void JacobianDOFs(
double [3],
int,
int,
int,
int,
double,
double,
double,
double,
double = NaN)
const;
244 double = NaN,
double = 1.0)
const;
254 virtual double BendingEnergy(
double,
double,
double,
double = 0,
double = NaN,
bool =
true)
const;
257 virtual double BendingEnergy(
bool =
false,
bool =
true)
const;
264 virtual void BendingEnergyGradient(
double *,
double = 1.0,
bool =
false,
bool =
true,
bool =
true)
const;
293 x = d.
_x, y = d.
_y, z = d.
_z;
301 x = d.
_x, y = d.
_y, z = d.
_z;
315 double x,
double y,
double z,
double t)
const 327 int i =
static_cast<int>(floor(x));
328 int j =
static_cast<int>(floor(y));
329 int k =
static_cast<int>(floor(z));
330 int l =
static_cast<int>(floor(t));
340 int ci, cj, ck, cl, xdof, ydof, zdof;
342 for (
int d = 0; d <= 3; ++d) {
344 if (0 <= cl && cl <
_t) {
346 for (
int c = 0; c <= 3; ++c) {
348 if (0 <= ck && ck <
_z) {
350 for (
int b = 0; b <= 3; ++b) {
352 if (0 <= cj && cj <
_y) {
354 for (
int a = 0; a <= 3; ++a) {
356 if (0 <= ci && ci <
_x) {
359 jac(xdof)._x = basis[0];
360 jac(ydof)._y = basis[0];
361 jac(zdof)._z = basis[0];
389 double dx = x, dy = y, dz = z;
395 x += dx, y += dy, z += dz;
431 double x,
double y,
double z,
double t,
double)
const 443 double x,
double y,
double z,
double t,
double t0)
const 467 #endif // MIRTK_BSplineFreeFormTransformation4D_H
static int VariableToIndex(TReal)
Returns the lookup table index for a given value in [0,1].
static MIRTKCU_API TReal Weight(TReal)
Returns the value of the B-spline function.
static MIRTK_Numerics_EXPORT TReal LookupTable[LookupTableSize][4]
Lookup table of B-spline basis function values.
void Initialize(int, int=-1, double *=NULL)
Initialize matrix with number of rows and columns.
virtual VoxelType GetInside(double, double, double, double) const