ITK  6.0.0
Insight Toolkit
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject > Class Template Referenceabstract

#include <itkImageToSpatialObjectMetric.h>

Detailed Description

template<typename TFixedImage, typename TMovingSpatialObject>
class itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >

Computes similarity between a moving spatial object and an Image to be registered.

The ImageToSpatialObjectMetric is different from the rest of the registration framework in ITK regarding the interpretation of the Transform with respect to the Fixed and Moving objects. In most of the ITK registration framework, the Transform computed by the optimizer is the one that maps points from the space of the Fixed object into the space of the Moving object. This direction of the transform is the one that makes easier to resample the Moving object into the space of the Fixed object.

In the particular case of ImageToSpatialObject registration, the Transform to be computed is the one mapping points from the SpatialObject into the Image. This allows the SpatialObject to drive the location and geometry of the measurements made in the image - thereby if the spatial object is sparse and/or contains varying geometric features, the metric applied to measure how well that object matches with the image can be rapidly computed only at the sparse locations and using measures that match the local geometry that should be at those locations in the image. This is particularly useful for fast intra-operative registration when the pre-operative data is used to define a SpatialObject and can anticipate how that object will appear in the intra-operative images.

A full discussion of the Transform directions in the ITK registration framework can be found in the ITK Software Guide.

Examples
Examples/RegistrationITKv4/ModelToImageRegistration1.cxx.

Definition at line 60 of file itkImageToSpatialObjectMetric.h.

+ Inheritance diagram for itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >:
+ Collaboration diagram for itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >:

Public Types

using ConstPointer = SmartPointer< const Self >
 
using CoordinateRepresentationType = Superclass::ParametersValueType
 
using DerivativeType = Superclass::DerivativeType
 
using FixedImageConstPointer = typename FixedImageType::ConstPointer
 
using FixedImagePointer = typename FixedImageType::Pointer
 
using FixedImageType = TFixedImage
 
using InputPointType = typename TransformType::InputPointType
 
using InterpolatorPointer = typename InterpolatorType::Pointer
 
using InterpolatorType = LinearInterpolateImageFunction< TFixedImage, CoordinateRepresentationType >
 
using MeasureType = Superclass::MeasureType
 
using MovingSpatialObjectConstPointer = typename MovingSpatialObjectType::ConstPointer
 
using MovingSpatialObjectPointer = typename MovingSpatialObjectType::Pointer
 
using MovingSpatialObjectType = TMovingSpatialObject
 
using OutputPointType = typename TransformType::OutputPointType
 
using ParametersType = Superclass::ParametersType
 
using Pointer = SmartPointer< Self >
 
using Self = ImageToSpatialObjectMetric
 
using Superclass = SingleValuedCostFunction
 
using TransformJacobianType = typename TransformType::JacobianType
 
using TransformParametersType = typename TransformType::ParametersType
 
using TransformPointer = typename TransformType::Pointer
 
using TransformType = Transform< CoordinateRepresentationType, Self::ObjectDimension, Self::ImageDimension >
 
using VectorType = vnl_vector_fixed< double, Self::ObjectDimension >
 
- Public Types inherited from itk::SingleValuedCostFunction
using ConstPointer = SmartPointer< const Self >
 
using DerivativeType = Array< ParametersValueType >
 
using MeasureType = double
 
using ParametersType = Superclass::ParametersType
 
using ParametersValueType = Superclass::ParametersValueType
 
using Pointer = SmartPointer< Self >
 
using Self = SingleValuedCostFunction
 
using Superclass = CostFunction
 
- Public Types inherited from itk::CostFunctionTemplate< TInternalComputationValueType >
using ConstPointer = SmartPointer< const Self >
 
using ParametersType = OptimizerParameters< TInternalComputationValueType >
 
using ParametersValueType = TInternalComputationValueType
 
using Pointer = SmartPointer< Self >
 
using Self = CostFunctionTemplate
 
using Superclass = Object
 
- Public Types inherited from itk::Object
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = Object
 
using Superclass = LightObject
 
- Public Types inherited from itk::LightObject
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = LightObject
 

Public Member Functions

virtual const ParametersTypeGetLastTransformParameters () const
 
virtual InterpolatorTypeGetModifiableInterpolator ()
 
const char * GetNameOfClass () const override
 
unsigned int GetNumberOfParameters () const override
 
void GetValueAndDerivative (const ParametersType &parameters, MeasureType &Value, DerivativeType &Derivative) const override=0
 
virtual void Initialize ()
 
virtual void SetInterpolator (InterpolatorType *_arg)
 
virtual void SetTransform (TransformType *_arg)
 
virtual void SetFixedImage (const FixedImageType *_arg)
 
virtual const FixedImageTypeGetFixedImage () const
 
virtual void SetMovingSpatialObject (const MovingSpatialObjectType *_arg)
 
virtual const MovingSpatialObjectTypeGetMovingSpatialObject () const
 
- Public Member Functions inherited from itk::SingleValuedCostFunction
virtual void GetDerivative (const ParametersType &parameters, DerivativeType &derivative) const =0
 
virtual MeasureType GetValue (const ParametersType &parameters) const =0
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *cmd) const
 
unsigned long AddObserver (const EventObject &event, std::function< void(const EventObject &)> function) const
 
LightObject::Pointer CreateAnother () const override
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
MetaDataDictionaryGetMetaDataDictionary ()
 
const MetaDataDictionaryGetMetaDataDictionary () const
 
virtual ModifiedTimeType GetMTime () const
 
virtual const TimeStampGetTimeStamp () const
 
bool HasObserver (const EventObject &event) const
 
void InvokeEvent (const EventObject &)
 
void InvokeEvent (const EventObject &) const
 
virtual void Modified () const
 
void Register () const override
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag) const
 
void SetDebug (bool debugFlag) const
 
void SetReferenceCount (int) override
 
void UnRegister () const noexcept override
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
void SetMetaDataDictionary (MetaDataDictionary &&rrhs)
 
virtual void SetObjectName (std::string _arg)
 
virtual const std::string & GetObjectName () const
 
- Public Member Functions inherited from itk::LightObject
Pointer Clone () const
 
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
void Print (std::ostream &os, Indent indent=0) const
 

Static Public Attributes

static constexpr unsigned int ImageDimension = FixedImageType::ImageDimension
 
static constexpr unsigned int ObjectDimension = MovingSpatialObjectType::ObjectDimension
 

Protected Member Functions

 ImageToSpatialObjectMetric ()
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
 ~ImageToSpatialObjectMetric () override=default
 
- Protected Member Functions inherited from itk::SingleValuedCostFunction
 SingleValuedCostFunction ()=default
 
 ~SingleValuedCostFunction () override
 
- Protected Member Functions inherited from itk::CostFunctionTemplate< TInternalComputationValueType >
 CostFunctionTemplate ()=default
 
 ~CostFunctionTemplate () override=default
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &timeStamp)
 
 ~Object () override
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 

Protected Attributes

FixedImageConstPointer m_FixedImage {}
 
InterpolatorPointer m_Interpolator {}
 
ParametersType m_LastTransformParameters {}
 
MeasureType m_MatchMeasure { 0 }
 
DerivativeType m_MatchMeasureDerivatives {}
 
MovingSpatialObjectConstPointer m_MovingSpatialObject {}
 
TransformPointer m_Transform {}
 
- Protected Attributes inherited from itk::LightObject
std::atomic< int > m_ReferenceCount {}
 

Additional Inherited Members

- Static Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
 
static void GlobalWarningDisplayOff ()
 
static void GlobalWarningDisplayOn ()
 
static Pointer New ()
 
static void SetGlobalWarningDisplay (bool val)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 

Member Typedef Documentation

◆ ConstPointer

template<typename TFixedImage , typename TMovingSpatialObject >
using itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::ConstPointer = SmartPointer<const Self>

Definition at line 68 of file itkImageToSpatialObjectMetric.h.

◆ CoordinateRepresentationType

template<typename TFixedImage , typename TMovingSpatialObject >
using itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::CoordinateRepresentationType = Superclass::ParametersValueType

Type used for representing point components

Definition at line 77 of file itkImageToSpatialObjectMetric.h.

◆ DerivativeType

template<typename TFixedImage , typename TMovingSpatialObject >
using itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::DerivativeType = Superclass::DerivativeType

Type of the derivative of the match measure

Definition at line 106 of file itkImageToSpatialObjectMetric.h.

◆ FixedImageConstPointer

template<typename TFixedImage , typename TMovingSpatialObject >
using itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::FixedImageConstPointer = typename FixedImageType::ConstPointer

Const pointer type for the FixedImage

Definition at line 115 of file itkImageToSpatialObjectMetric.h.

◆ FixedImagePointer

template<typename TFixedImage , typename TMovingSpatialObject >
using itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::FixedImagePointer = typename FixedImageType::Pointer

Pointer type for the FixedImage

Definition at line 109 of file itkImageToSpatialObjectMetric.h.

◆ FixedImageType

template<typename TFixedImage , typename TMovingSpatialObject >
using itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::FixedImageType = TFixedImage

Type of the fixed image

Definition at line 71 of file itkImageToSpatialObjectMetric.h.

◆ InputPointType

template<typename TFixedImage , typename TMovingSpatialObject >
using itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::InputPointType = typename TransformType::InputPointType

Definition at line 89 of file itkImageToSpatialObjectMetric.h.

◆ InterpolatorPointer

template<typename TFixedImage , typename TMovingSpatialObject >
using itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::InterpolatorPointer = typename InterpolatorType::Pointer

Definition at line 97 of file itkImageToSpatialObjectMetric.h.

◆ InterpolatorType

template<typename TFixedImage , typename TMovingSpatialObject >
using itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::InterpolatorType = LinearInterpolateImageFunction<TFixedImage, CoordinateRepresentationType>

Type of the Interpolator Base class

Definition at line 95 of file itkImageToSpatialObjectMetric.h.

◆ MeasureType

template<typename TFixedImage , typename TMovingSpatialObject >
using itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::MeasureType = Superclass::MeasureType

Type of the match measure

Definition at line 103 of file itkImageToSpatialObjectMetric.h.

◆ MovingSpatialObjectConstPointer

template<typename TFixedImage , typename TMovingSpatialObject >
using itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::MovingSpatialObjectConstPointer = typename MovingSpatialObjectType::ConstPointer

Const pointer type for the MovingSpatialObject

Definition at line 118 of file itkImageToSpatialObjectMetric.h.

◆ MovingSpatialObjectPointer

template<typename TFixedImage , typename TMovingSpatialObject >
using itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::MovingSpatialObjectPointer = typename MovingSpatialObjectType::Pointer

Pointer type for the MovingSpatialObject

Definition at line 112 of file itkImageToSpatialObjectMetric.h.

◆ MovingSpatialObjectType

template<typename TFixedImage , typename TMovingSpatialObject >
using itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::MovingSpatialObjectType = TMovingSpatialObject

Type of the MovingSpatialObject

Definition at line 74 of file itkImageToSpatialObjectMetric.h.

◆ OutputPointType

template<typename TFixedImage , typename TMovingSpatialObject >
using itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::OutputPointType = typename TransformType::OutputPointType

Definition at line 90 of file itkImageToSpatialObjectMetric.h.

◆ ParametersType

template<typename TFixedImage , typename TMovingSpatialObject >
using itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::ParametersType = Superclass::ParametersType

ParametersType type alias. It defines a position in the optimization search space.

Definition at line 122 of file itkImageToSpatialObjectMetric.h.

◆ Pointer

template<typename TFixedImage , typename TMovingSpatialObject >
using itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::Pointer = SmartPointer<Self>

Definition at line 67 of file itkImageToSpatialObjectMetric.h.

◆ Self

template<typename TFixedImage , typename TMovingSpatialObject >
using itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::Self = ImageToSpatialObjectMetric

Definition at line 65 of file itkImageToSpatialObjectMetric.h.

◆ Superclass

template<typename TFixedImage , typename TMovingSpatialObject >
using itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::Superclass = SingleValuedCostFunction

Definition at line 66 of file itkImageToSpatialObjectMetric.h.

◆ TransformJacobianType

template<typename TFixedImage , typename TMovingSpatialObject >
using itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::TransformJacobianType = typename TransformType::JacobianType

Definition at line 92 of file itkImageToSpatialObjectMetric.h.

◆ TransformParametersType

template<typename TFixedImage , typename TMovingSpatialObject >
using itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::TransformParametersType = typename TransformType::ParametersType

Definition at line 91 of file itkImageToSpatialObjectMetric.h.

◆ TransformPointer

template<typename TFixedImage , typename TMovingSpatialObject >
using itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::TransformPointer = typename TransformType::Pointer

Definition at line 88 of file itkImageToSpatialObjectMetric.h.

◆ TransformType

template<typename TFixedImage , typename TMovingSpatialObject >
using itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::TransformType = Transform<CoordinateRepresentationType, Self::ObjectDimension, Self::ImageDimension>

Type of the Transform Base class

Definition at line 86 of file itkImageToSpatialObjectMetric.h.

◆ VectorType

template<typename TFixedImage , typename TMovingSpatialObject >
using itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::VectorType = vnl_vector_fixed<double, Self::ObjectDimension>

Typedef of the vector type to return derivatives

Definition at line 100 of file itkImageToSpatialObjectMetric.h.

Constructor & Destructor Documentation

◆ ImageToSpatialObjectMetric()

template<typename TFixedImage , typename TMovingSpatialObject >
itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::ImageToSpatialObjectMetric ( )
protected

◆ ~ImageToSpatialObjectMetric()

template<typename TFixedImage , typename TMovingSpatialObject >
itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::~ImageToSpatialObjectMetric ( )
overrideprotecteddefault

Member Function Documentation

◆ GetFixedImage()

template<typename TFixedImage , typename TMovingSpatialObject >
virtual const FixedImageType* itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::GetFixedImage ( ) const
virtual

Get/Set the FixedImage.

◆ GetLastTransformParameters()

template<typename TFixedImage , typename TMovingSpatialObject >
virtual const ParametersType& itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::GetLastTransformParameters ( ) const
virtual

Get the last transformation parameters visited by the optimizer. This function overload the superclass's one.

◆ GetModifiableInterpolator()

template<typename TFixedImage , typename TMovingSpatialObject >
virtual InterpolatorType* itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::GetModifiableInterpolator ( )
virtual

Get the Interpolator.

◆ GetMovingSpatialObject()

template<typename TFixedImage , typename TMovingSpatialObject >
virtual const MovingSpatialObjectType* itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::GetMovingSpatialObject ( ) const
virtual

Get/Set the MovingSpatialObject

◆ GetNameOfClass()

template<typename TFixedImage , typename TMovingSpatialObject >
const char* itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::GetNameOfClass ( ) const
overridevirtual

◆ GetNumberOfParameters()

template<typename TFixedImage , typename TMovingSpatialObject >
unsigned int itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::GetNumberOfParameters ( ) const
overridevirtual

Return the number of parameters required by the Transform.

Implements itk::CostFunctionTemplate< TInternalComputationValueType >.

◆ GetValueAndDerivative()

template<typename TFixedImage , typename TMovingSpatialObject >
void itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::GetValueAndDerivative ( const ParametersType parameters,
MeasureType Value,
DerivativeType Derivative 
) const
overridepure virtual

Get Value and Derivatives for MultipleValuedOptimizers

Reimplemented from itk::SingleValuedCostFunction.

Examples
Examples/RegistrationITKv4/ModelToImageRegistration1.cxx.

◆ Initialize()

template<typename TFixedImage , typename TMovingSpatialObject >
virtual void itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::Initialize ( )
virtual

Initialize the metric.

◆ PrintSelf()

template<typename TFixedImage , typename TMovingSpatialObject >
void itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
overrideprotectedvirtual

Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from itk::CostFunctionTemplate< TInternalComputationValueType >.

◆ SetFixedImage()

template<typename TFixedImage , typename TMovingSpatialObject >
virtual void itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::SetFixedImage ( const FixedImageType _arg)
virtual

Get/Set the FixedImage.

◆ SetInterpolator()

template<typename TFixedImage , typename TMovingSpatialObject >
virtual void itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::SetInterpolator ( InterpolatorType _arg)
virtual

Connect the Interpolator.

◆ SetMovingSpatialObject()

template<typename TFixedImage , typename TMovingSpatialObject >
virtual void itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::SetMovingSpatialObject ( const MovingSpatialObjectType _arg)
virtual

Get/Set the MovingSpatialObject

Examples
Examples/RegistrationITKv4/ModelToImageRegistration1.cxx.

◆ SetTransform()

template<typename TFixedImage , typename TMovingSpatialObject >
virtual void itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::SetTransform ( TransformType _arg)
virtual

Set/Get the Transform.

Member Data Documentation

◆ ImageDimension

template<typename TFixedImage , typename TMovingSpatialObject >
constexpr unsigned int itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::ImageDimension = FixedImageType::ImageDimension
staticconstexpr

Image dimension enumeration.

Definition at line 80 of file itkImageToSpatialObjectMetric.h.

◆ m_FixedImage

template<typename TFixedImage , typename TMovingSpatialObject >
FixedImageConstPointer itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::m_FixedImage {}
protected

Definition at line 177 of file itkImageToSpatialObjectMetric.h.

◆ m_Interpolator

template<typename TFixedImage , typename TMovingSpatialObject >
InterpolatorPointer itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::m_Interpolator {}
protected

Definition at line 174 of file itkImageToSpatialObjectMetric.h.

◆ m_LastTransformParameters

template<typename TFixedImage , typename TMovingSpatialObject >
ParametersType itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::m_LastTransformParameters {}
protected

Definition at line 178 of file itkImageToSpatialObjectMetric.h.

◆ m_MatchMeasure

template<typename TFixedImage , typename TMovingSpatialObject >
MeasureType itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::m_MatchMeasure { 0 }
protected

Definition at line 171 of file itkImageToSpatialObjectMetric.h.

◆ m_MatchMeasureDerivatives

template<typename TFixedImage , typename TMovingSpatialObject >
DerivativeType itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::m_MatchMeasureDerivatives {}
protected

Definition at line 172 of file itkImageToSpatialObjectMetric.h.

◆ m_MovingSpatialObject

template<typename TFixedImage , typename TMovingSpatialObject >
MovingSpatialObjectConstPointer itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::m_MovingSpatialObject {}
protected

Definition at line 176 of file itkImageToSpatialObjectMetric.h.

◆ m_Transform

template<typename TFixedImage , typename TMovingSpatialObject >
TransformPointer itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::m_Transform {}
mutableprotected

Definition at line 173 of file itkImageToSpatialObjectMetric.h.

◆ ObjectDimension

template<typename TFixedImage , typename TMovingSpatialObject >
constexpr unsigned int itk::ImageToSpatialObjectMetric< TFixedImage, TMovingSpatialObject >::ObjectDimension = MovingSpatialObjectType::ObjectDimension
staticconstexpr

Object dimension enumeration.

Definition at line 83 of file itkImageToSpatialObjectMetric.h.


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