Common base class for free-form-deformation-based warps. More...
#include <cmtkWarpXform.h>
Public Types | |
typedef WarpXform | Self |
This class. | |
typedef SmartPointer< Self > | SmartPtr |
Smart pointer to WarpXform. | |
typedef SmartConstPointer< Self > | SmartConstPtr |
Smart pointer to const WarpXform. | |
typedef FixedVector< 3, int > | IndexType |
Grid index type. | |
Public Member Functions | |
virtual Types::Coordinate | GetGlobalScaling () const |
Get global scaling factor. | |
cmtkGetSetMacro (AffineXform::SmartPtr, InitialAffineXform) | |
Initial affine transformation. | |
void | ReplaceInitialAffine (const AffineXform *newAffineXform=NULL) |
Replace initial affine transformation. | |
void | ConcatAffine (const AffineXform *affineXform) |
Concat affine transformation. | |
size_t | GetNumberOfControlPoints () const |
Get number of control points. | |
WarpXform () | |
Default constructor. | |
virtual | ~WarpXform () |
Destructor. | |
virtual void | InitGrid (const FixedVector< 3, Types::Coordinate > &domain, const Self::IndexType &dims) |
Initialized internal data structures for new control point grid. | |
virtual bool | InDomain (const Self::SpaceVectorType &v) const |
Check whether coordinate is in domain of transformation. | |
virtual void | Update (const bool exactDelta=false) |
Update internal representation. | |
virtual void | Refine () |
Refine control point grid, but maintain transformation exactly. | |
virtual Self::SpaceVectorType | Apply (const Self::SpaceVectorType &v) const |
Return warped vector. | |
virtual void | GetDerivativeLandmarksMSD (double &lowerMSD, double &upperMSD, const MatchedLandmarkList *ll, const unsigned int idx, const Types::Coordinate step) |
Return derivative of registration error with respect to one parameter. | |
virtual Types::Coordinate | GetInverseConsistencyError (const Self *inverse, const UniformVolume *volume, const UniformVolume::RegionType *voi=NULL) const |
Return inverse consistency. | |
virtual void | GetDerivativeInverseConsistencyError (double &lower, double &upper, const Self *inverse, const UniformVolume *volume, const UniformVolume::RegionType *voi, const unsigned int idx, const Types::Coordinate step) |
Return derivative of inverse consistency. | |
virtual void | GetOriginalControlPointPosition (Self::SpaceVectorType &cp, const Types::Coordinate x, const Types::Coordinate y, const Types::Coordinate z) const |
Get the original position of a control point. | |
virtual void | GetOriginalControlPointPositionByOffset (Self::SpaceVectorType &v, const size_t offset) const |
Get the original position of a control point by index. | |
virtual void | GetShiftedControlPointPosition (Self::SpaceVectorType &v, const int x, const int y, const int z) const |
Get shifted control point position. | |
virtual void | GetShiftedControlPointPositionByOffset (Self::SpaceVectorType &v, const size_t offset) const |
Get shifted control point position by offset. | |
virtual void | SetShiftedControlPointPositionByOffset (const Self::SpaceVectorType &v, const int x, const int y, const int z) const |
Set shifted control point position. | |
virtual void | SetShiftedControlPointPositionByOffset (const Self::SpaceVectorType &v, const size_t offset) const |
Set shifted control point position by offset. | |
virtual Types::Coordinate | GetParamStep (const size_t, const Self::SpaceVectorType &volSize, const Types::Coordinate mmStep=1) const |
Get parameter step given a transformed volume size. | |
void | DeleteParameterActiveFlags () |
Free bitset for active parameter flags if it exists. | |
void | SetParametersActive () |
Set all parameters as active. | |
void | SetParametersActive (const UniformVolume::RegionType &roi) |
Set only those parameters as active that influence a given ROI. | |
void | SetParametersActive (const int axis, const bool active=true) |
Set parameters for one spatial dimension as active or inactive. | |
void | SetParameterActive (const size_t index, const bool active=true) |
Set a particular parameter as active (or passive). | |
void | SetParameterInactive (const size_t index) |
Set a particular parameter as inactive. | |
void | SetParametersActive (const char *axes) |
Set parameters for spatial dimensions as active. | |
int | GetParameterActive (const size_t index) const |
Test whether a particular parameter is active. | |
Public Attributes | |
Self::IndexType | m_Dims |
Dimensions of control point grid. | |
FixedVector< 3, Types::Coordinate > | Domain |
Domain of control point grid in world coordinates. | |
Types::Coordinate | Spacing [3] |
Array of spacings between the control points. | |
Self::SpaceVectorType | m_Offset |
Array of spacings between the control points. | |
Protected Member Functions | |
cmtkGetSetMacro (unsigned int, IgnoreEdge) | |
Number of edge planes in the control point grid to keep unmoved. | |
cmtkGetSetMacroDefault (bool, FastMode, true) | |
Flag for fast but inaccurate computation. | |
Protected Attributes | |
size_t | NumberOfControlPoints |
Number of control points. | |
Types::Coordinate | InverseSpacing [3] |
Inverted spacings between the control points. | |
Types::Coordinate | GlobalScaling |
Precomputed global scaling of initial affine transformation. | |
Types::Coordinate | InverseAffineScaling [3] |
Stored scale factors of the initial affine transformation. | |
int | nextI |
Offset of next control grid column. | |
int | nextJ |
Offset of next control grid row. | |
int | nextIJ |
Offset for next row and column. | |
int | nextK |
Offset for next plane. | |
int | nextIK |
Offset for next plane and column. | |
int | nextJK |
Offset for next plane and row. | |
int | nextIJK |
Offset for next plane, row, and column. | |
Private Member Functions | |
cmtkGetSetMacro (BitVector::SmartPtr, ActiveFlags) | |
Flags for active (and passive) parameters. | |
Friends | |
class | SplineWarpXformUniformVolume |
Friend declaration. |
Common base class for free-form-deformation-based warps.
Definition at line 64 of file cmtkWarpXform.h.
typedef FixedVector<3,int> cmtk::WarpXform::IndexType |
Grid index type.
Definition at line 79 of file cmtkWarpXform.h.
typedef WarpXform cmtk::WarpXform::Self |
This class.
Reimplemented from cmtk::Xform.
Reimplemented in cmtk::DeformationField, and cmtk::SplineWarpXform.
Definition at line 70 of file cmtkWarpXform.h.
Smart pointer to const WarpXform.
Reimplemented from cmtk::Xform.
Reimplemented in cmtk::SplineWarpXform.
Definition at line 76 of file cmtkWarpXform.h.
typedef SmartPointer<Self> cmtk::WarpXform::SmartPtr |
Smart pointer to WarpXform.
Reimplemented from cmtk::Xform.
Reimplemented in cmtk::DeformationField, and cmtk::SplineWarpXform.
Definition at line 73 of file cmtkWarpXform.h.
cmtk::WarpXform::WarpXform | ( | ) | [inline] |
Default constructor.
Definition at line 162 of file cmtkWarpXform.h.
virtual cmtk::WarpXform::~WarpXform | ( | ) | [inline, virtual] |
Destructor.
Definition at line 173 of file cmtkWarpXform.h.
virtual Self::SpaceVectorType cmtk::WarpXform::Apply | ( | const Self::SpaceVectorType & | v ) | const [inline, virtual] |
cmtk::WarpXform::cmtkGetSetMacro | ( | AffineXform::SmartPtr | , |
InitialAffineXform | |||
) |
Initial affine transformation.
cmtk::WarpXform::cmtkGetSetMacro | ( | unsigned | int, |
IgnoreEdge | |||
) | [protected] |
Number of edge planes in the control point grid to keep unmoved.
cmtk::WarpXform::cmtkGetSetMacro | ( | BitVector::SmartPtr | , |
ActiveFlags | |||
) | [private] |
Flags for active (and passive) parameters.
This bitset contains one bit for each parameter in this transformation. Every parameter is considered an active (variable) of passive (fixed) parameter. Passive parameters are not considered for gradient computations etc. and can therefore save a significant amount of computation time.
cmtk::WarpXform::cmtkGetSetMacroDefault | ( | bool | , |
FastMode | , | ||
true | |||
) | [protected] |
Flag for fast but inaccurate computation.
virtual Types::Coordinate cmtk::WarpXform::GetGlobalScaling | ( | ) | const [inline, virtual] |
Get global scaling factor.
Reimplemented from cmtk::Xform.
Definition at line 94 of file cmtkWarpXform.h.
Referenced by cmtk::ReformatVolume::GetTransformedReferenceJacobianAvgThread().
size_t cmtk::WarpXform::GetNumberOfControlPoints | ( | ) | const [inline] |
Get number of control points.
Definition at line 112 of file cmtkWarpXform.h.
Referenced by cmtk::SplineWarpGroupwiseRegistrationRMIFunctional::UpdateControlPointSchedule(), and cmtk::SplineWarpXformITKIO::Write().
virtual void cmtk::WarpXform::GetOriginalControlPointPosition | ( | Self::SpaceVectorType & | cp, |
const Types::Coordinate | x, | ||
const Types::Coordinate | y, | ||
const Types::Coordinate | z | ||
) | const [inline, virtual] |
Get the original position of a control point.
Definition at line 216 of file cmtkWarpXform.h.
virtual void cmtk::WarpXform::GetOriginalControlPointPositionByOffset | ( | Self::SpaceVectorType & | v, |
const size_t | offset | ||
) | const [inline, virtual] |
Get the original position of a control point by index.
Definition at line 224 of file cmtkWarpXform.h.
Referenced by cmtk::SplineWarpXformITKIO::Write().
virtual void cmtk::WarpXform::GetShiftedControlPointPosition | ( | Self::SpaceVectorType & | v, |
const int | x, | ||
const int | y, | ||
const int | z | ||
) | const [inline, virtual] |
Get shifted control point position.
Definition at line 230 of file cmtkWarpXform.h.
virtual void cmtk::WarpXform::GetShiftedControlPointPositionByOffset | ( | Self::SpaceVectorType & | v, |
const size_t | offset | ||
) | const [inline, virtual] |
Get shifted control point position by offset.
Definition at line 236 of file cmtkWarpXform.h.
Referenced by cmtk::SplineWarpXformITKIO::Write().
virtual bool cmtk::WarpXform::InDomain | ( | const Self::SpaceVectorType & | v ) | const [inline, virtual] |
Check whether coordinate is in domain of transformation.
Reimplemented from cmtk::Xform.
Definition at line 179 of file cmtkWarpXform.h.
Referenced by GetInverseConsistencyError(), and cmtk::SplineWarpXform::GetInverseConsistencyError().
virtual void cmtk::WarpXform::Refine | ( | ) | [inline, virtual] |
Refine control point grid, but maintain transformation exactly.
Reimplemented in cmtk::SplineWarpXform.
Definition at line 191 of file cmtkWarpXform.h.
virtual void cmtk::WarpXform::SetShiftedControlPointPositionByOffset | ( | const Self::SpaceVectorType & | v, |
const size_t | offset | ||
) | const [inline, virtual] |
Set shifted control point position by offset.
Definition at line 249 of file cmtkWarpXform.h.
virtual void cmtk::WarpXform::SetShiftedControlPointPositionByOffset | ( | const Self::SpaceVectorType & | v, |
const int | x, | ||
const int | y, | ||
const int | z | ||
) | const [inline, virtual] |
Set shifted control point position.
Definition at line 243 of file cmtkWarpXform.h.
friend class SplineWarpXformUniformVolume [friend] |
Friend declaration.
Reimplemented in cmtk::SplineWarpXform.
Definition at line 305 of file cmtkWarpXform.h.
Domain of control point grid in world coordinates.
Definition at line 85 of file cmtkWarpXform.h.
Referenced by cmtk::SplineWarpXform::CloneVirtual(), and cmtk::ClassStream::PutWarp().
Types::Coordinate cmtk::WarpXform::GlobalScaling [protected] |
Precomputed global scaling of initial affine transformation.
Definition at line 134 of file cmtkWarpXform.h.
Referenced by cmtk::SplineWarpXform::CloneVirtual(), cmtk::SplineWarpXform::GetJacobianConstraintThread(), and cmtk::SplineWarpXform::GetJacobianFoldingConstraintThread().
Types::Coordinate cmtk::WarpXform::InverseAffineScaling[3] [protected] |
Stored scale factors of the initial affine transformation.
Definition at line 137 of file cmtkWarpXform.h.
Types::Coordinate cmtk::WarpXform::InverseSpacing[3] [protected] |
Inverted spacings between the control points.
These values are used for multiplication instead of division by those in Spacing[].
Definition at line 125 of file cmtkWarpXform.h.
Referenced by cmtk::SplineWarpXform::CloneVirtual(), and cmtk::SplineWarpXformUniformVolume::RegisterVolume().
Dimensions of control point grid.
Definition at line 82 of file cmtkWarpXform.h.
Referenced by cmtk::SplineWarpXform::CloneVirtual(), cmtk::ClassStream::PutWarp(), cmtk::SplineWarpXformUniformVolume::RegisterVolume(), cmtk::SplineWarpGroupwiseRegistrationRMIFunctional::UpdateControlPointSchedule(), and cmtk::SplineWarpXformITKIO::Write().
Array of spacings between the control points.
Definition at line 91 of file cmtkWarpXform.h.
Referenced by cmtk::SplineWarpXform::CloneVirtual(), cmtk::ClassStream::PutWarp(), and cmtk::SplineWarpXformITKIO::Write().
int cmtk::WarpXform::nextI [protected] |
Offset of next control grid column.
Definition at line 140 of file cmtkWarpXform.h.
Referenced by cmtk::SplineWarpXform::CloneVirtual(), cmtk::SplineWarpXformUniformVolume::GetTransformedGridRow(), and cmtk::SplineWarpXformUniformVolume::RegisterVolume().
int cmtk::WarpXform::nextIJ [protected] |
Offset for next row and column.
Definition at line 146 of file cmtkWarpXform.h.
Referenced by cmtk::SplineWarpXform::CloneVirtual().
int cmtk::WarpXform::nextIJK [protected] |
Offset for next plane, row, and column.
Definition at line 158 of file cmtkWarpXform.h.
Referenced by cmtk::SplineWarpXform::CloneVirtual().
int cmtk::WarpXform::nextIK [protected] |
Offset for next plane and column.
Definition at line 152 of file cmtkWarpXform.h.
Referenced by cmtk::SplineWarpXform::CloneVirtual().
int cmtk::WarpXform::nextJ [protected] |
Offset of next control grid row.
Definition at line 143 of file cmtkWarpXform.h.
Referenced by cmtk::SplineWarpXform::CloneVirtual(), cmtk::SplineWarpXformUniformVolume::GetTransformedGrid(), and cmtk::SplineWarpXformUniformVolume::RegisterVolume().
int cmtk::WarpXform::nextJK [protected] |
Offset for next plane and row.
Definition at line 155 of file cmtkWarpXform.h.
Referenced by cmtk::SplineWarpXform::CloneVirtual().
int cmtk::WarpXform::nextK [protected] |
Offset for next plane.
Definition at line 149 of file cmtkWarpXform.h.
Referenced by cmtk::SplineWarpXform::CloneVirtual(), cmtk::SplineWarpXformUniformVolume::GetTransformedGrid(), and cmtk::SplineWarpXformUniformVolume::RegisterVolume().
size_t cmtk::WarpXform::NumberOfControlPoints [protected] |
Number of control points.
Definition at line 119 of file cmtkWarpXform.h.
Referenced by cmtk::SplineWarpXform::CloneVirtual().
Array of spacings between the control points.
Definition at line 88 of file cmtkWarpXform.h.
Referenced by cmtk::SplineWarpXform::CloneVirtual(), cmtk::ImagePairNonrigidRegistration::InitRegistration(), cmtk::ElasticRegistration::InitRegistration(), and cmtk::SplineWarpXformITKIO::Write().