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

This class is the elastix base class for all Metrics. More...

#include <elxMetricBase.h>

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

Public Types

typedef
AdvancedImageToImageMetric
< FixedImageType,
MovingImageType
AdvancedMetricType
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 PointSet
< CoordinateRepresentationType,
FixedImageDimension,
DefaultStaticMeshTraits
< CoordinateRepresentationType,
FixedImageDimension,
FixedImageDimension,
CoordinateRepresentationType,
CoordinateRepresentationType,
CoordinateRepresentationType > > 
FixedPointSetType
typedef FixedImageType::PointType FixedPointType
typedef FixedPointType::ValueType FixedPointValueType
typedef
AdvancedMetricType::ImageSamplerType 
ImageSamplerBaseType
typedef SingleValuedCostFunction ITKBaseType
typedef ITKBaseType::MeasureType MeasureType
typedef
ElastixType::MovingImageType 
MovingImageType
typedef PointSet
< CoordinateRepresentationType,
MovingImageDimension,
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 Member Functions

virtual void AfterEachIterationBase (void)
virtual void BeforeEachResolutionBase (void)
virtual ImageSamplerBaseTypeGetAdvancedMetricImageSampler (void) const
virtual bool GetAdvancedMetricUseImageSampler (void) const
virtual const ITKBaseTypeGetAsITKBaseType (void) const
virtual ITKBaseTypeGetAsITKBaseType (void)
virtual const char * GetClassName () const
virtual MeasureType GetCurrentExactMetricValue (void) const
virtual bool GetShowExactMetricValue (void) const
 itkStaticConstMacro (MovingImageDimension, unsigned int, MovingImageType::ImageDimension)
 itkStaticConstMacro (FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
virtual void SelectNewSamples (void)
virtual void SetAdvancedMetricImageSampler (ImageSamplerBaseType *sampler)

Protected Types

typedef itk::ImageGridSampler
< FixedImageType
ExactMetricImageSamplerType
typedef
ExactMetricImageSamplerType::SampleGridSpacingType 
ExactMetricSampleGridSpacingType
typedef ITKBaseType::ParametersType ParametersType

Protected Member Functions

virtual MeasureType GetExactValue (const ParametersType &parameters)
 MetricBase ()
virtual ~MetricBase ()

Protected Attributes

MeasureType m_CurrentExactMetricValue
ExactMetricSampleGridSpacingType m_ExactMetricSampleGridSpacing
ExactMetricImageSamplerType::Pointer m_ExactMetricSampler
bool m_ShowExactMetricValue

Private Member Functions

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

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.
Parameters:
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.
Parameters:
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.
Parameters:
RequiredRatioOfValidSamples: Defines the fraction needed in CheckNumberOfSamples.
example: (RequiredRatioOfValidSamples 0.1)
The default is 0.25.

Definition at line 73 of file elxMetricBase.h.


Member Typedef Documentation

Definition at line 103 of file elxMetricBase.h.

template<class TElastix>
typedef Superclass::ConfigurationPointer elastix::MetricBase< TElastix >::ConfigurationPointer
template<class TElastix>
typedef Superclass::ConfigurationType elastix::MetricBase< TElastix >::ConfigurationType
template<class TElastix>
typedef ITKBaseType::ParametersValueType elastix::MetricBase< TElastix >::CoordinateRepresentationType
template<class TElastix>
typedef Superclass::ElastixPointer elastix::MetricBase< TElastix >::ElastixPointer
template<class TElastix>
typedef Superclass::ElastixType elastix::MetricBase< TElastix >::ElastixType
template<class TElastix>
typedef itk::ImageGridSampler<FixedImageType> elastix::MetricBase< TElastix >::ExactMetricImageSamplerType [protected]

The full sampler used by the GetExactValue method.

Definition at line 192 of file elxMetricBase.h.

Definition at line 194 of file elxMetricBase.h.

template<class TElastix>
typedef ElastixType::FixedImageType elastix::MetricBase< TElastix >::FixedImageType
template<class TElastix>
typedef PointSet< CoordinateRepresentationType, FixedImageDimension, DefaultStaticMeshTraits< CoordinateRepresentationType, FixedImageDimension, FixedImageDimension, CoordinateRepresentationType, CoordinateRepresentationType, CoordinateRepresentationType > > elastix::MetricBase< TElastix >::FixedPointSetType
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 128 of file elxMetricBase.h.

template<class TElastix>
typedef SingleValuedCostFunction elastix::MetricBase< TElastix >::ITKBaseType
template<class TElastix>
typedef ITKBaseType::MeasureType elastix::MetricBase< TElastix >::MeasureType
template<class TElastix>
typedef ElastixType::MovingImageType elastix::MetricBase< TElastix >::MovingImageType
template<class TElastix>
typedef PointSet< CoordinateRepresentationType, MovingImageDimension, DefaultStaticMeshTraits< CoordinateRepresentationType, MovingImageDimension, MovingImageDimension, CoordinateRepresentationType, CoordinateRepresentationType, CoordinateRepresentationType > > elastix::MetricBase< TElastix >::MovingPointSetType
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]
template<class TElastix>
typedef Superclass::RegistrationPointer elastix::MetricBase< TElastix >::RegistrationPointer
template<class TElastix>
typedef Superclass::RegistrationType elastix::MetricBase< TElastix >::RegistrationType
template<class TElastix>
typedef MetricBase elastix::MetricBase< TElastix >::Self
template<class TElastix>
typedef BaseComponentSE<TElastix> elastix::MetricBase< TElastix >::Superclass

Reimplemented from elastix::BaseComponentSE< TElastix >.

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 ( ) [inline, protected, virtual]

The destructor.

Definition at line 199 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 const ITKBaseType* elastix::MetricBase< TElastix >::GetAsITKBaseType ( void  ) const [inline, virtual]

Cast to ITKBaseType, to use in const functions.

Definition at line 140 of file elxMetricBase.h.

template<class TElastix>
virtual ITKBaseType* elastix::MetricBase< TElastix >::GetAsITKBaseType ( void  ) [inline, virtual]

Cast to ITKBaseType.

Definition at line 134 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 [inline, virtual]

Get the last computed exact metric value

Definition at line 183 of file elxMetricBase.h.

template<class TElastix>
virtual MeasureType elastix::MetricBase< TElastix >::GetExactValue ( const ParametersType parameters) [protected, virtual]

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 [inline, virtual]

Get if the exact metric value is computed

Definition at line 179 of file elxMetricBase.h.

template<class TElastix>
elastix::MetricBase< TElastix >::itkStaticConstMacro ( FixedImageDimension  ,
unsigned  int,
FixedImageType::ImageDimension   
)
template<class TElastix>
elastix::MetricBase< TElastix >::itkStaticConstMacro ( MovingImageDimension  ,
unsigned  int,
MovingImageType::ImageDimension   
)
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]

Force the metric to base its computation on a new subset of image samples. Not every metric may have implemented this.

Reimplemented in elastix::CorrespondingPointsEuclideanDistanceMetric< TElastix >, and elastix::TransformRigidityPenalty< TElastix >.

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 215 of file elxMetricBase.h.

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

Definition at line 216 of file elxMetricBase.h.

template<class TElastix>
ExactMetricImageSamplerType::Pointer elastix::MetricBase< TElastix >::m_ExactMetricSampler [protected]

Definition at line 214 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 213 of file elxMetricBase.h.



Generated on 24-10-2011 for elastix by doxygen 1.7.4 elastix logo