go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions
elastix::MetricBase< TElastix > Class Template Reference

#include <elxMetricBase.h>

Detailed Description

template<class TElastix>
class elastix::MetricBase< TElastix >

This class is the elastix base class for all Metrics.

This class contains the common functionality for all Metrics.

The parameters used in this class are:

Parameters:

ShowExactMetricValue: Flag that can set to "true" or "false". If "true" the metric computes the exact metric value (computed on all voxels rather than on the set of spatial samples) and shows it each iteration. Must be given for each resolution.
example: (ShowExactMetricValue "true" "true" "false")
Default is "false" for all resolutions.

ExactMetricSampleGridSpacing: Set an integer downsampling rate for computing the "exact" metric. Only meaningful if set in combination with the ShowExactMetricValue set to "true". In some cases, it might be an overkill to really compute the exact metric with the ShowExactMetricValue. The metric computed on a downsampled image might already be accurate enough to draw conclusions about the rate of convergence for example. The downsampling rate must be given for each resolution, for each dimension.
example: (ExactMetricSampleGridSpacing 1 1 2 2 )
This example for a 2D registration of 2 resolutions sets the downsampling rate to 1 in the first resolution (so: use really all pixels), and to 2 in the second resolution. Default: 1 in each resolution and each dimension.

CheckNumberOfSamples: Whether the metric checks if at least a certain fraction (default 1/4) of the samples map inside the moving image. Can be given for each resolution or for all resolutions at once.
example: (CheckNumberOfSamples "false" "true" "false")
The default is true. In general it is wise to set this to true, since it detects if the registration is going really bad.

RequiredRatioOfValidSamples: Defines the fraction needed in CheckNumberOfSamples.
example: (RequiredRatioOfValidSamples 0.1)
The default is 0.25.

Definition at line 73 of file elxMetricBase.h.

Inheritance diagram for elastix::MetricBase< TElastix >:
Inheritance graph
[legend]

Public Types

typedef itk::AdvancedImageToImageMetric< FixedImageType, MovingImageTypeAdvancedMetricType
 
typedef Superclass::ConfigurationPointer ConfigurationPointer
 
typedef Superclass::ConfigurationType ConfigurationType
 
typedef ITKBaseType::ParametersValueType CoordinateRepresentationType
 
typedef Superclass::ElastixPointer ElastixPointer
 
typedef Superclass::ElastixType ElastixType
 
typedef ElastixType::FixedImageType FixedImageType
 
typedef itk::PointSet< CoordinateRepresentationType, FixedImageDimension, itk::DefaultStaticMeshTraits< CoordinateRepresentationType, FixedImageDimension, FixedImageDimension, CoordinateRepresentationType, CoordinateRepresentationType, CoordinateRepresentationType > > FixedPointSetType
 
typedef FixedImageType::PointType FixedPointType
 
typedef FixedPointType::ValueType FixedPointValueType
 
typedef AdvancedMetricType::ImageSamplerType ImageSamplerBaseType
 
typedef itk::SingleValuedCostFunction ITKBaseType
 
typedef ITKBaseType::MeasureType MeasureType
 
typedef AdvancedMetricType::MovingImageDerivativeScalesType MovingImageDerivativeScalesType
 
typedef ElastixType::MovingImageType MovingImageType
 
typedef itk::PointSet< CoordinateRepresentationType, MovingImageDimension, itk::DefaultStaticMeshTraits< CoordinateRepresentationType, MovingImageDimension, MovingImageDimension, CoordinateRepresentationType, CoordinateRepresentationType, CoordinateRepresentationType > > MovingPointSetType
 
typedef MovingImageType::PointType MovingPointType
 
typedef MovingPointType::ValueType MovingPointValueType
 
typedef Superclass::RegistrationPointer RegistrationPointer
 
typedef Superclass::RegistrationType RegistrationType
 
typedef MetricBase Self
 
typedef BaseComponentSE< TElastix > Superclass
 
- Public Types inherited from elastix::BaseComponentSE< TElastix >
typedef ElastixType::ConfigurationPointer ConfigurationPointer
 
typedef ElastixType::ConfigurationType ConfigurationType
 
typedef ElastixType::Pointer ElastixPointer
 
typedef TElastix ElastixType
 
typedef RegistrationTypeRegistrationPointer
 
typedef ElastixType::RegistrationBaseType RegistrationType
 
typedef BaseComponentSE Self
 
typedef BaseComponent Superclass
 

Public Member Functions

virtual void AfterEachIterationBase (void)
 
virtual void BeforeEachResolutionBase (void)
 
virtual ImageSamplerBaseTypeGetAdvancedMetricImageSampler (void) const
 
virtual bool GetAdvancedMetricUseImageSampler (void) const
 
virtual ITKBaseTypeGetAsITKBaseType (void)
 
virtual const ITKBaseTypeGetAsITKBaseType (void) const
 
virtual const char * GetClassName () const
 
virtual MeasureType GetCurrentExactMetricValue (void) const
 
virtual bool GetShowExactMetricValue (void) const
 
 itkStaticConstMacro (FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
 
 itkStaticConstMacro (MovingImageDimension, unsigned int, MovingImageType::ImageDimension)
 
virtual void SelectNewSamples (void)
 
virtual void SetAdvancedMetricImageSampler (ImageSamplerBaseType *sampler)
 
- Public Member Functions inherited from elastix::BaseComponentSE< TElastix >
virtual ConfigurationTypeGetConfiguration (void) const
 
virtual ElastixTypeGetElastix (void) const
 
virtual RegistrationPointer GetRegistration (void) const
 
virtual void SetConfiguration (ConfigurationType *_arg)
 
virtual void SetElastix (ElastixType *_arg)
 
- Public Member Functions inherited from elastix::BaseComponent
virtual void AfterEachIteration (void)
 
virtual void AfterEachResolution (void)
 
virtual void AfterEachResolutionBase (void)
 
virtual void AfterRegistration (void)
 
virtual void AfterRegistrationBase (void)
 
virtual int BeforeAll (void)
 
virtual int BeforeAllBase (void)
 
virtual void BeforeEachResolution (void)
 
virtual void BeforeRegistration (void)
 
virtual void BeforeRegistrationBase (void)
 
std::string ConvertSecondsToDHMS (const double totalSeconds, const unsigned int precision) const
 
virtual const char * elxGetClassName (void) const
 
virtual const char * GetComponentLabel (void) const
 
virtual void SetComponentLabel (const char *label, unsigned int idx)
 

Protected Types

typedef ExactMetricImageSamplerType::Pointer ExactMetricImageSamplerPointer
 
typedef itk::ImageGridSampler< FixedImageTypeExactMetricImageSamplerType
 
typedef ExactMetricImageSamplerType::SampleGridSpacingType ExactMetricSampleGridSpacingType
 
typedef ITKBaseType::ParametersType ParametersType
 

Protected Member Functions

virtual MeasureType GetExactValue (const ParametersType &parameters)
 
 MetricBase ()
 
virtual ~MetricBase ()
 
- Protected Member Functions inherited from elastix::BaseComponentSE< TElastix >
 BaseComponentSE ()
 
virtual ~BaseComponentSE ()
 
- Protected Member Functions inherited from elastix::BaseComponent
 BaseComponent ()
 
virtual ~BaseComponent ()
 

Protected Attributes

MeasureType m_CurrentExactMetricValue
 
ExactMetricSampleGridSpacingType m_ExactMetricSampleGridSpacing
 
ExactMetricImageSamplerPointer m_ExactMetricSampler
 
bool m_ShowExactMetricValue
 
- Protected Attributes inherited from elastix::BaseComponentSE< TElastix >
ConfigurationPointer m_Configuration
 
ElastixPointer m_Elastix
 
RegistrationPointer m_Registration
 

Private Member Functions

 MetricBase (const Self &)
 
void operator= (const Self &)
 

Member Typedef Documentation

Definition at line 103 of file elxMetricBase.h.

template<class TElastix>
typedef Superclass::ConfigurationPointer elastix::MetricBase< TElastix >::ConfigurationPointer

Definition at line 88 of file elxMetricBase.h.

template<class TElastix>
typedef Superclass::ConfigurationType elastix::MetricBase< TElastix >::ConfigurationType

Definition at line 87 of file elxMetricBase.h.

template<class TElastix>
typedef ITKBaseType::ParametersValueType elastix::MetricBase< TElastix >::CoordinateRepresentationType

Typedefs for point sets.

Definition at line 112 of file elxMetricBase.h.

template<class TElastix>
typedef Superclass::ElastixPointer elastix::MetricBase< TElastix >::ElastixPointer

Definition at line 86 of file elxMetricBase.h.

template<class TElastix>
typedef Superclass::ElastixType elastix::MetricBase< TElastix >::ElastixType

Typedef's inherited from Elastix.

Definition at line 82 of file elxMetricBase.h.

template<class TElastix>
typedef ExactMetricImageSamplerType::Pointer elastix::MetricBase< TElastix >::ExactMetricImageSamplerPointer
protected

Definition at line 196 of file elxMetricBase.h.

template<class TElastix>
typedef itk::ImageGridSampler< FixedImageType > elastix::MetricBase< TElastix >::ExactMetricImageSamplerType
protected

The full sampler used by the GetExactValue method.

Definition at line 195 of file elxMetricBase.h.

Definition at line 197 of file elxMetricBase.h.

template<class TElastix>
typedef ElastixType::FixedImageType elastix::MetricBase< TElastix >::FixedImageType

Other typedef's.

Definition at line 93 of file elxMetricBase.h.

template<class TElastix>
typedef itk::PointSet< CoordinateRepresentationType, FixedImageDimension, itk::DefaultStaticMeshTraits< CoordinateRepresentationType, FixedImageDimension, FixedImageDimension, CoordinateRepresentationType, CoordinateRepresentationType, CoordinateRepresentationType > > elastix::MetricBase< TElastix >::FixedPointSetType

Definition at line 119 of file elxMetricBase.h.

template<class TElastix>
typedef FixedImageType::PointType elastix::MetricBase< TElastix >::FixedPointType

Definition at line 94 of file elxMetricBase.h.

template<class TElastix>
typedef FixedPointType::ValueType elastix::MetricBase< TElastix >::FixedPointValueType

Definition at line 95 of file elxMetricBase.h.

template<class TElastix>
typedef AdvancedMetricType::ImageSamplerType elastix::MetricBase< TElastix >::ImageSamplerBaseType

Typedefs for sampler support.

Definition at line 129 of file elxMetricBase.h.

template<class TElastix>
typedef itk::SingleValuedCostFunction elastix::MetricBase< TElastix >::ITKBaseType

ITKBaseType.

Definition at line 101 of file elxMetricBase.h.

template<class TElastix>
typedef ITKBaseType::MeasureType elastix::MetricBase< TElastix >::MeasureType

Return type of GetValue

Definition at line 132 of file elxMetricBase.h.

Definition at line 104 of file elxMetricBase.h.

template<class TElastix>
typedef ElastixType::MovingImageType elastix::MetricBase< TElastix >::MovingImageType

Definition at line 96 of file elxMetricBase.h.

template<class TElastix>
typedef itk::PointSet< CoordinateRepresentationType, MovingImageDimension, itk::DefaultStaticMeshTraits< CoordinateRepresentationType, MovingImageDimension, MovingImageDimension, CoordinateRepresentationType, CoordinateRepresentationType, CoordinateRepresentationType > > elastix::MetricBase< TElastix >::MovingPointSetType

Definition at line 126 of file elxMetricBase.h.

template<class TElastix>
typedef MovingImageType::PointType elastix::MetricBase< TElastix >::MovingPointType

Definition at line 97 of file elxMetricBase.h.

template<class TElastix>
typedef MovingPointType::ValueType elastix::MetricBase< TElastix >::MovingPointValueType

Definition at line 98 of file elxMetricBase.h.

template<class TElastix>
typedef ITKBaseType::ParametersType elastix::MetricBase< TElastix >::ParametersType
protected

The parameters type.

Definition at line 192 of file elxMetricBase.h.

template<class TElastix>
typedef Superclass::RegistrationPointer elastix::MetricBase< TElastix >::RegistrationPointer

Definition at line 90 of file elxMetricBase.h.

template<class TElastix>
typedef Superclass::RegistrationType elastix::MetricBase< TElastix >::RegistrationType

Definition at line 89 of file elxMetricBase.h.

template<class TElastix>
typedef MetricBase elastix::MetricBase< TElastix >::Self

Standard ITK stuff.

Definition at line 78 of file elxMetricBase.h.

template<class TElastix>
typedef BaseComponentSE< TElastix > elastix::MetricBase< TElastix >::Superclass

Definition at line 79 of file elxMetricBase.h.

Constructor & Destructor Documentation

template<class TElastix>
elastix::MetricBase< TElastix >::MetricBase ( )
protected

The constructor.

template<class TElastix>
virtual elastix::MetricBase< TElastix >::~MetricBase ( )
inlineprotectedvirtual

The destructor.

Definition at line 202 of file elxMetricBase.h.

template<class TElastix>
elastix::MetricBase< TElastix >::MetricBase ( const Self )
private

The private constructor.

Member Function Documentation

template<class TElastix>
virtual void elastix::MetricBase< TElastix >::AfterEachIterationBase ( void  )
virtual

Execute stuff after each iteration:

  • Optionally compute the exact metric value and plot it to screen.

Reimplemented from elastix::BaseComponent.

template<class TElastix>
virtual void elastix::MetricBase< TElastix >::BeforeEachResolutionBase ( void  )
virtual

Execute stuff before each resolution:

  • Check if the exact metric value should be computed (to monitor the progress of the registration).

Reimplemented from elastix::BaseComponent.

template<class TElastix>
virtual ImageSamplerBaseType* elastix::MetricBase< TElastix >::GetAdvancedMetricImageSampler ( void  ) const
virtual

Methods to get the image sampler. The image sampler is only used when the metric is of type AdvancedMetricType, and has UseImageSampler set to true. In other cases, the function returns 0.

template<class TElastix>
virtual bool elastix::MetricBase< TElastix >::GetAdvancedMetricUseImageSampler ( void  ) const
virtual

Returns whether the metric uses a sampler. When the metric is not of AdvancedMetricType, the function returns false immediately.

template<class TElastix>
virtual ITKBaseType* elastix::MetricBase< TElastix >::GetAsITKBaseType ( void  )
inlinevirtual

Cast to ITKBaseType.

Definition at line 135 of file elxMetricBase.h.

template<class TElastix>
virtual const ITKBaseType* elastix::MetricBase< TElastix >::GetAsITKBaseType ( void  ) const
inlinevirtual

Cast to ITKBaseType, to use in const functions.

Definition at line 142 of file elxMetricBase.h.

template<class TElastix>
virtual const char* elastix::MetricBase< TElastix >::GetClassName ( ) const
virtual
template<class TElastix>
virtual MeasureType elastix::MetricBase< TElastix >::GetCurrentExactMetricValue ( void  ) const
inlinevirtual

Get the last computed exact metric value

Definition at line 186 of file elxMetricBase.h.

template<class TElastix>
virtual MeasureType elastix::MetricBase< TElastix >::GetExactValue ( const ParametersType parameters)
protectedvirtual

Get the exact value. Mutual information computed over all points. It is meant in situations when you optimize using just a subset of pixels, but are interested in the exact value of the metric.

This method only works when the itkYourMetric inherits from the AdvancedMetricType. In other cases it returns 0. You may re-implement this method in the elxYourMetric, if you like.

template<class TElastix>
virtual bool elastix::MetricBase< TElastix >::GetShowExactMetricValue ( void  ) const
inlinevirtual

Get if the exact metric value is computed

Definition at line 182 of file elxMetricBase.h.

template<class TElastix>
elastix::MetricBase< TElastix >::itkStaticConstMacro ( FixedImageDimension  ,
unsigned  int,
FixedImageType::ImageDimension   
)

Get the dimension of the fixed image.

template<class TElastix>
elastix::MetricBase< TElastix >::itkStaticConstMacro ( MovingImageDimension  ,
unsigned  int,
MovingImageType::ImageDimension   
)

Get the dimension of the moving image.

template<class TElastix>
void elastix::MetricBase< TElastix >::operator= ( const Self )
private

The private copy constructor.

template<class TElastix>
virtual void elastix::MetricBase< TElastix >::SelectNewSamples ( void  )
virtual
template<class TElastix>
virtual void elastix::MetricBase< TElastix >::SetAdvancedMetricImageSampler ( ImageSamplerBaseType sampler)
virtual

Method to set the image sampler. The image sampler is only used when the metric is of type AdvancedMetricType, and has UseImageSampler set to true. In other cases, the function does nothing.

Field Documentation

template<class TElastix>
MeasureType elastix::MetricBase< TElastix >::m_CurrentExactMetricValue
protected

Definition at line 219 of file elxMetricBase.h.

template<class TElastix>
ExactMetricSampleGridSpacingType elastix::MetricBase< TElastix >::m_ExactMetricSampleGridSpacing
protected

Definition at line 220 of file elxMetricBase.h.

template<class TElastix>
ExactMetricImageSamplerPointer elastix::MetricBase< TElastix >::m_ExactMetricSampler
protected

Definition at line 218 of file elxMetricBase.h.

template<class TElastix>
bool elastix::MetricBase< TElastix >::m_ShowExactMetricValue
protected
Todo:
the method GetExactDerivative could as well be added here.

Definition at line 217 of file elxMetricBase.h.



Generated on 04-09-2015 for elastix by doxygen 1.8.9.1 elastix logo