Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
mirtk::GenericRegistrationFilter Class Reference

#include <GenericRegistrationFilter.h>

Inheritance diagram for mirtk::GenericRegistrationFilter:
Inheritance graph
Collaboration diagram for mirtk::GenericRegistrationFilter:
Collaboration graph

Classes

struct  ConstraintInfo
 
struct  DisplacementInfo
 Structure storing information about cached displacements. More...
 
struct  ImageSimilarityInfo
 
struct  PointSetConstraintInfo
 
struct  PointSetDistanceInfo
 
struct  PointSetOutputInfo
 Structure storing information about transformed output point set. More...
 
struct  TransformationInfo
 Structure storing information about transformation instance. More...
 

Public Types

typedef RegisteredImage::DisplacementImageType DisplacementImageType
 Type of cached displacement field.
 
typedef Array< ResampledImageTypeResampledImageList
 List type storing images for one resolution pyramid level.
 
typedef RegisteredImage::InputImageType ResampledImageType
 Type of resolution pyramid images.
 
typedef ResampledImageType::VoxelType VoxelType
 Scalar type of resolution pyramid images.
 

Public Member Functions

void AddInput (const BaseImage *)
 
void AddInput (vtkPointSet *, double=.0)
 
double BackgroundValue (int) const
 Get background value of n-th input image (after registration done)
 
virtual void Clear ()
 Reset filter settings and input.
 
void ExtrapolationMode (enum ExtrapolationMode)
 Set common/default extrapolation mode for all input images.
 
enum ExtrapolationMode ExtrapolationMode (int=-1) const
 Get extrapolation mode of n-th input image or default mode, respectively.
 
void ExtrapolationMode (int, enum ExtrapolationMode)
 Set extrapolation mode of n-th input image.
 
 GenericRegistrationFilter ()
 Constructor.
 
virtual void GuessParameter ()
 
void Input (const BaseImage *, const BaseImage *)
 Set input images of the registration filter.
 
void Input (int, const BaseImage **)
 Set input images of the registration filter.
 
template<class TVoxel >
void Input (int, const GenericImage< TVoxel > **)
 Set input images of the registration filter.
 
void Input (vtkPointSet *, vtkPointSet *, double=.0, double=1.0)
 
void Input (int, vtkPointSet **, double *=NULL)
 
void InterpolationMode (enum InterpolationMode)
 Set common/default interpolation mode for all input images.
 
void InterpolationMode (int, enum InterpolationMode)
 Set interpolation mode of n-th input image.
 
enum InterpolationMode InterpolationMode (int=-1) const
 Get interpolation mode of n-th input image or default mode, respectively.
 
bool IsFixedImage (int) const
 Determine whether the specified input image remains untransformed.
 
bool IsFixedPointSet (int) const
 Determine whether the specified input point set remains untransformed.
 
bool IsMovingImage (int) const
 Determine whether the specified input image will be transformed.
 
bool IsMovingPointSet (int) const
 Determine whether the specified input point set will be transformed.
 
bool IsSourceImage (int) const
 
bool IsSourcePointSet (int) const
 
bool IsTargetImage (int) const
 
bool IsTargetPointSet (int) const
 
virtual TransformationMakeInitialGuess ()
 Make an initial guess of the (global) output transformation.
 
 mirtkPublicAggregateMacro (const Transformation, InitialGuess)
 Initial guess of optimal transformation.
 
 mirtkPublicAggregateMacro (const Transformation, TargetTransformation)
 Target transformation to be approximated by output transformation.
 
 mirtkPublicAggregateMacro (BinaryImage, Domain)
 Mask which defines where to evaluate the energy function.
 
 mirtkPublicAttributeMacro (int, NumberOfLevels)
 Number of resolution levels.
 
 mirtkPublicAttributeMacro (int, FinalLevel)
 Level at which to stop multi-resolution optimization.
 
 mirtkPublicAttributeMacro (MFFDMode, MultiLevelMode)
 Multi-level transformation mode.
 
 mirtkPublicAttributeMacro (Array< enum TransformationModel >, TransformationModel)
 Transformation model.
 
 mirtkPublicAttributeMacro (enum InterpolationMode, DefaultInterpolationMode)
 Default image interpolation mode.
 
 mirtkPublicAttributeMacro (enum ExtrapolationMode, DefaultExtrapolationMode)
 Default image extrapolation mode.
 
 mirtkPublicAttributeMacro (double, MaxRescaledIntensity)
 
 mirtkPublicAttributeMacro (bool, PrecomputeDerivatives)
 Whether to precompute image derivatives or compute them on the fly.
 
 mirtkPublicAttributeMacro (enum SimilarityMeasure, SimilarityMeasure)
 Default similarity measure.
 
 mirtkPublicAttributeMacro (enum PointSetDistanceMeasure, PointSetDistanceMeasure)
 Default polydata distance measure.
 
 mirtkPublicAttributeMacro (enum OptimizationMethod, OptimizationMethod)
 Optimization method.
 
 mirtkPublicAttributeMacro (bool, NormalizeWeights)
 Normalize weights of energy function terms.
 
 mirtkPublicAttributeMacro (string, TargetTransformationErrorName)
 Name of target transformation MSDE term.
 
 mirtkPublicAttributeMacro (double, TargetTransformationErrorWeight)
 Weight of target transformation MSDE term.
 
 mirtkPublicAttributeMacro (bool, MergeGlobalAndLocalTransformation)
 Whether to merge initial global transformation into (local) transformation.
 
 mirtkPublicAttributeMacro (bool, RegisterX)
 Whether to allow x coordinate transformation.
 
 mirtkPublicAttributeMacro (bool, RegisterY)
 Whether to allow y coordinate transformation.
 
 mirtkPublicAttributeMacro (bool, RegisterZ)
 Whether to allow z coordinate transformation.
 
 mirtkPublicAttributeMacro (bool, DirichletBoundaryCondition)
 
 mirtkPublicAttributeMacro (bool, AdaptiveRemeshing)
 Whether to adaptively remesh surfaces before each gradient step.
 
int NumberOfImages () const
 Number of input images.
 
int NumberOfPointSets () const
 Number of input point sets.
 
int NumberOfRequiredImages () const
 
int NumberOfRequiredPointSets () const
 
virtual ParameterList Parameter () const
 Get parameters as key/value as string map.
 
virtual ParameterList Parameter (int) const
 Get parameters as key/value as string map.
 
virtual void ParseEnergyFormula (int=-1, int=-1, int=-1)
 
virtual bool Read (istream &, bool=false)
 Read registration parameters from input stream.
 
virtual void Reset ()
 Reset filter settings, but keep input.
 
virtual void Run ()
 Run the multi-level registration.
 
virtual bool Set (const char *, const char *)
 Set named parameter from value as string.
 
virtual bool Set (const char *, const char *, int)
 Set named parameter from value as string.
 
virtual void TransformationModel (enum TransformationModel)
 Set (single) transformation model.
 
virtual void Write (const char *) const
 Write registration parameters to file.
 
virtual ~GenericRegistrationFilter ()
 Destructor.
 
- Public Member Functions inherited from mirtk::RegistrationFilter
void Output (Transformation **)
 Set pointer to output transformation.
 
TransformationOutput ()
 Get output transformation.
 
virtual bool Read (const char *, bool=false)
 Read registration parameters from input stream.
 
virtual ~RegistrationFilter ()=0
 Destructor.
 
- Public Member Functions inherited from mirtk::Observable
void AddObserver (Observer &)
 Add observer.
 
void Broadcast (Event, const void *=NULL)
 Broadcast event to observers.
 
void ClearObservers ()
 Delete all observers.
 
void DeleteObserver (Observer &)
 Delete observer.
 
void NotifyObservers (Event, const void *=NULL)
 Notify all observers about given event if this object has changed.
 
int NumberOfObservers () const
 Number of current observers.
 
virtual ~Observable ()
 Destructor.
 
- Public Member Functions inherited from mirtk::Object
virtual const char * NameOfClass () const =0
 Get name of class, which this object is an instance of.
 
bool Parameter (const ParameterList &)
 Set parameters from name/value pairs.
 
virtual ~Object ()
 Destructor.
 

Protected Member Functions

virtual void AddImageSimilarityTerm ()
 
virtual void AddPenaltyTerm ()
 
virtual void AddPointSetConstraintTerm ()
 
virtual void AddPointSetDistanceTerm ()
 
virtual void ApplyInitialGuess ()
 Initialize transformation parameters using provided initial guess.
 
bool AtFinalLevel () const
 Whether current level is the final resolution level.
 
bool AtInitialLevel () const
 Whether current level is the initial resolution level.
 
virtual Vector3D< double > AverageOutputResolution (int=-1) const
 Average resolution of (untransformed) target data sets at given level.
 
virtual void Finalize ()
 Finalize registration at current resolution.
 
virtual struct ImageAttributes ImageAttributes (int, int=-1) const
 Get attributes of n-th input image at specified resolution level.
 
virtual void Initialize ()
 Initialize registration at current resolution.
 
virtual void InitializeEnergy ()
 Initialize registration energy of registration at current resolution.
 
virtual void InitializeOptimizer ()
 Initialize optimizer used to solve registration problem.
 
virtual void InitializeOutput ()
 Initialize transformation for sub-registration at current resolution.
 
virtual void InitializePointSets ()
 Remesh/-sample input point sets.
 
virtual void InitializePyramid ()
 Initialize image resolution pyramid.
 
virtual void InitializeStatus (HomogeneousTransformation *)
 Initialize status of linear parameters.
 
virtual void InitializeStatus (FreeFormTransformation *)
 Initialize status of FFD parameters.
 
virtual void InitializeStatus ()
 Initialize status of transformation parameters.
 
virtual void InitializeTransformation ()
 Initialize new transformation instance.
 
virtual void MultiResolutionOptimization ()
 Run multi-resolution registration.
 
virtual int NumberOfFrames (double *=NULL, double *=NULL, double *=NULL) const
 Determine number of temporal frames and temporal sampling attributes.
 
RegisteredPointSetOutputPointSet (int, double, TransformationInfo)
 
virtual TransformationOutputTransformation (TransformationInfo)
 Get (partial/inverse) output transformation.
 
void PreUpdateCallback (bool)
 Callback function called by _Energy->Update(bool)
 
virtual struct ImageAttributes RegistrationDomain (int=-1) const
 Common attributes of (untransformed) input target data sets at specified resolution level.
 
virtual void SetInputOf (RegisteredImage *, const struct ImageAttributes &, int, TransformationInfo)
 Initialize output image corresponding to registered (transformed) image.
 
virtual enum TransformationType TransformationType ()
 Type of output transformation of sub-registration at current resolution.
 
- Protected Member Functions inherited from mirtk::RegistrationFilter
bool Output (Transformation *)
 Set current output transformation.
 
 RegistrationFilter ()
 Constructor.
 
- Protected Member Functions inherited from mirtk::Observable
 Observable ()
 Default constructor.
 
 Observable (const Observable &)
 Copy constructor.
 
Observableoperator= (const Observable &)
 Assignment operator.
 
- Protected Member Functions inherited from mirtk::Object
template<typename... Args>
void Throw (ErrorType err, const char *func, Args... args) const
 

Protected Attributes

Array< double > _Background
 Image background value.
 
Array< double > _Blurring [MAX_NO_RESOLUTIONS]
 Image blurring value.
 
int _Centering [MAX_NO_RESOLUTIONS]
 Whether to center foreground (if applicable)
 
Array< Point_Centroid
 Centroids of images.
 
Array< ConstraintInfo_ConstraintInfo
 Parsed constraint(s)
 
int _CropPadFFD
 Whether to crop/pad FFD lattice.
 
bool _CropPadImages
 Whether to crop/pad input images.
 
int _CurrentLevel
 Current resolution level.
 
enum TransformationModel _CurrentModel
 Current transformation model.
 
double _DefaultBackground
 Default background value.
 
Array< DisplacementInfo_DisplacementInfo
 Info of cached displacement fields.
 
bool _DownsampleWithPadding
 
RegistrationEnergy _Energy
 Registration energy.
 
string _EnergyFormula
 Registration energy formula as string.
 
EventDelegate _EventDelegate
 Forwards optimization events to observers.
 
Array< enum ExtrapolationMode_ExtrapolationMode
 Extrapolation mode of each input image.
 
Array< ResampledImageList_Image
 Resolution pyramid.
 
Array< ImageSimilarityInfo_ImageSimilarityInfo
 Parsed similarity measure(s)
 
Array< const BaseImage * > _Input
 Input images.
 
Array< enum InterpolationMode_InterpolationMode
 Interpolation mode of each input image.
 
Array< BinaryImage * > _Mask
 Domain on which to evaluate similarity.
 
double _MaxControlPointSpacing [MAX_NO_RESOLUTIONS][4]
 Control point spacing for FFDs.
 
Array< double > _MaxEdgeLength [MAX_NO_RESOLUTIONS]
 Maximum edge length in mm.
 
double _MinControlPointSpacing [MAX_NO_RESOLUTIONS][4]
 Control point spacing for FFDs.
 
Array< double > _MinEdgeLength [MAX_NO_RESOLUTIONS]
 Minimum edge length in mm.
 
LocalOptimizer_Optimizer
 Used optimizer.
 
ParameterList _Parameter [MAX_NO_RESOLUTIONS]
 
Array< Array< void * > > _PointSet
 Unused.
 
Array< PointSetConstraintInfo_PointSetConstraintInfo
 Unused.
 
Array< PointSetDistanceInfo_PointSetDistanceInfo
 Unused.
 
Array< void * > _PointSetInput
 Unused.
 
Array< void * > _PointSetOutput
 Unused.
 
Array< PointSetOutputInfo_PointSetOutputInfo
 Unused.
 
Array< double > _PointSetTime
 Unused.
 
RegistrationEnergy::PreUpdateFunctionType _PreUpdateDelegate
 Delegate of pre-update function.
 
struct ImageAttributes _RegistrationDomain
 
Array< Vector3D< double > > _Resolution [MAX_NO_RESOLUTIONS]
 Image resolution in mm.
 
Point _SourceOffset
 Source origin offset.
 
bool _Subdivide [MAX_NO_RESOLUTIONS][4]
 Whether to subdivide FFD.
 
Point _TargetOffset
 Target origin offset.
 
Transformation_Transformation
 Current estimate.
 
Array< TransformationInfo_TransformationInfo
 Meta-data of partial transformation.
 
Array< Transformation * > _TransformationInstance
 Partial transformations.
 
int _UseGaussianResolutionPyramid
 Whether resolution levels correspond to a Gaussian pyramid.
 

Additional Inherited Members

- Static Public Member Functions inherited from mirtk::Object
static const char * NameOfType ()
 Get name of this class type.
 
- Static Protected Member Functions inherited from mirtk::Object
template<typename... Args>
static void ThrowStatic (ErrorType err, const char *cls, const char *func, Args... args)
 

Detailed Description

Generic registration filter

Definition at line 72 of file GenericRegistrationFilter.h.

Member Function Documentation

§ AddImageSimilarityTerm()

virtual void mirtk::GenericRegistrationFilter::AddImageSimilarityTerm ( )
protectedvirtual

Instantiate new image similarity term for energy function

Note
The individual energy terms are destroyed by the energy function!

§ AddInput() [1/2]

void mirtk::GenericRegistrationFilter::AddInput ( const BaseImage )

Add filter input image

For registration filters which support multiple target/source images such as multiple channels and/or frames of a temporal image sequence. How the transformation is applied to which inputs depends on the respective transformation model and image registration method.

§ AddInput() [2/2]

void mirtk::GenericRegistrationFilter::AddInput ( vtkPointSet *  ,
double  = .0 
)

Add filter input point set

Note
Use only when MIRTK_Registration_WITH_PointSet is 1.

§ AddPenaltyTerm()

virtual void mirtk::GenericRegistrationFilter::AddPenaltyTerm ( )
protectedvirtual

Instantiate new regularization term for energy function

Note
The individual energy terms are destroyed by the energy function!

§ AddPointSetConstraintTerm()

virtual void mirtk::GenericRegistrationFilter::AddPointSetConstraintTerm ( )
protectedvirtual

Instantiate new point set constraint term for energy function

Note
The individual energy terms are destroyed by the energy function!

§ AddPointSetDistanceTerm()

virtual void mirtk::GenericRegistrationFilter::AddPointSetDistanceTerm ( )
protectedvirtual

Instantiate new point set distance term for energy function

Note
The individual energy terms are destroyed by the energy function!

§ GuessParameter()

virtual void mirtk::GenericRegistrationFilter::GuessParameter ( )
virtual

Guess proper setting for any yet unset parameter

Note
Optional to call explicitly as this method is called by Run.

§ Input() [1/2]

void mirtk::GenericRegistrationFilter::Input ( vtkPointSet *  ,
vtkPointSet *  ,
double  = .0,
double  = 1.0 
)

Set input point sets of the registration filter

Note
Use only when MIRTK_Registration_WITH_PointSet is 1.

§ Input() [2/2]

void mirtk::GenericRegistrationFilter::Input ( int  ,
vtkPointSet **  ,
double *  = NULL 
)

Set input point set of the registration filter

Note
Use only when MIRTK_Registration_WITH_PointSet is 1.

§ IsSourceImage()

bool mirtk::GenericRegistrationFilter::IsSourceImage ( int  ) const

Determine whether the specified input image will be transformed by the forward transformation or part of it such as in case of a symmetric energy.

§ IsSourcePointSet()

bool mirtk::GenericRegistrationFilter::IsSourcePointSet ( int  ) const

Determine whether the specified input point set either remains untransformed, or is transformed by the inverse transformation or a part of it such as in case of an inverse consistent and/or symmetric energy function.

§ IsTargetImage()

bool mirtk::GenericRegistrationFilter::IsTargetImage ( int  ) const

Determine whether the specified input image either remains untransformed, or is transformed by the inverse transformation or a part of it such as in case of an inverse consistent and/or symmetric energy function.

§ IsTargetPointSet()

bool mirtk::GenericRegistrationFilter::IsTargetPointSet ( int  ) const

Determine whether the specified input point set will be transformed by the forward transformation or part of it such as in case of a symmetric energy.

§ mirtkPublicAttributeMacro() [1/2]

mirtk::GenericRegistrationFilter::mirtkPublicAttributeMacro ( double  ,
MaxRescaledIntensity   
)

Rescale input image intensities from [imin, imax] to [0, omax]

Here [imin, imax] is the intensity range of the respective input image excluding the background (if specified) and omax is the maximum intensity of the rescaled intensities. This maximum value influences the relative weighting of image similarity gradient vs. the gradient of constraint terms such as the bending energy.

This normalization ensures that the magnitude of image derivatives used for energy gradient computation have comparable magnitude in order to prevent one image to have stronger influence than another. This is more important for symmetric, inverse consistent, or multi-modal settings.

By default, this parameter is set to inf and no rescaling is done.

§ mirtkPublicAttributeMacro() [2/2]

mirtk::GenericRegistrationFilter::mirtkPublicAttributeMacro ( bool  ,
DirichletBoundaryCondition   
)

Enforce Dirichlet boundary condition on FFD transformations

When this option is enabled, the status of control points at the boundary of the finite FFD lattice is set to Passive and the parameters of these control points set to zero. This is always the case for FFDs whose parameters are control point displacements. In case of FFDs parameterized by (stationary) velocities, the default extrapolation mode is nearest neighbor, however, and a layer of passive CPs with constant value is needed if the velocity should be forced to zero outside the finite domain on which the velocity field is defined. Alternatively, FFD extrapolation mode "Const" can be used.

§ NumberOfRequiredImages()

int mirtk::GenericRegistrationFilter::NumberOfRequiredImages ( ) const

Number of required input images

Note
Only valid after ParseEnergyFormula has been called!

§ NumberOfRequiredPointSets()

int mirtk::GenericRegistrationFilter::NumberOfRequiredPointSets ( ) const

Number of required input point sets

Note
Only valid after ParseEnergyFormula has been called!

§ OutputPointSet()

RegisteredPointSet* mirtk::GenericRegistrationFilter::OutputPointSet ( int  ,
double  ,
TransformationInfo   
)
protected

Get (new) registered output point set

Note
Use only when MIRTK_Registration_WITH_PointSet is 1.

§ ParseEnergyFormula()

virtual void mirtk::GenericRegistrationFilter::ParseEnergyFormula ( int  = -1,
int  = -1,
int  = -1 
)
virtual

Parse registration energy function

Note
Optional to call explicitly as this method is called by GuessParameter.

Member Data Documentation

§ _DownsampleWithPadding

bool mirtk::GenericRegistrationFilter::_DownsampleWithPadding
protected

Whether to take background into account during initialization of the image pyramid

Definition at line 359 of file GenericRegistrationFilter.h.

§ _Parameter

ParameterList mirtk::GenericRegistrationFilter::_Parameter[MAX_NO_RESOLUTIONS]
protected

Parameters not considered by the registration filter itself

These parameters are passed on to the sub-modules of the registration filter such as the image similarity measure(s), the registration constraint(s), and the optimizer. This way, the registration filter does not need to know which parameters its sub-modules accept and is better decoupled from the implementation of the respective image similarities, constraints, and optimizers.

Definition at line 395 of file GenericRegistrationFilter.h.

§ _RegistrationDomain

struct ImageAttributes mirtk::GenericRegistrationFilter::_RegistrationDomain
protected

Common attributes of (untransformed) input target data sets

These attributes are in particular used to initialize the control point grid of a free-form deformation such that the grid is large enough to be valid for every target point for which the transformation will be evaluated. It is therefore computed from the attributes of the input data sets rather than the downsampled data. If a _Domain mask is set, the attributes of this mask are copied instead.

Definition at line 331 of file GenericRegistrationFilter.h.


The documentation for this class was generated from the following file: