go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
elxMetricBase.h
Go to the documentation of this file.
1 /*======================================================================
2 
3  This file is part of the elastix software.
4 
5  Copyright (c) University Medical Center Utrecht. All rights reserved.
6  See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
7  details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notices for more information.
12 
13 ======================================================================*/
14 
15 #ifndef __elxMetricBase_h
16 #define __elxMetricBase_h
17 
19 #include "elxMacro.h"
20 
21 #include "elxBaseComponentSE.h"
23 #include "itkImageGridSampler.h"
24 #include "itkPointSet.h"
25 
26 #include "elxTimer.h"
27 
28 
29 namespace elastix
30 {
31 using namespace itk;
32 
72 template <class TElastix>
73 class MetricBase : public BaseComponentSE<TElastix>
74 {
75 public:
76 
78  typedef MetricBase Self;
80 
82  itkTypeMacro( MetricBase, BaseComponentSE );
83 
85  typedef typename Superclass::ElastixType ElastixType;
91 
93  typedef typename ElastixType::FixedImageType FixedImageType;
94  typedef typename FixedImageType::PointType FixedPointType;
95  typedef typename FixedPointType::ValueType FixedPointValueType;
96  typedef typename ElastixType::MovingImageType MovingImageType;
97  typedef typename MovingImageType::PointType MovingPointType;
98  typedef typename MovingPointType::ValueType MovingPointValueType;
99 
101  typedef SingleValuedCostFunction ITKBaseType;
104 
106  itkStaticConstMacro( FixedImageDimension, unsigned int, FixedImageType::ImageDimension );
108  itkStaticConstMacro( MovingImageDimension, unsigned int, MovingImageType::ImageDimension );
109 
111  typedef typename ITKBaseType::ParametersValueType CoordinateRepresentationType;
112  typedef PointSet<
113  CoordinateRepresentationType, FixedImageDimension,
114  DefaultStaticMeshTraits<
116  FixedImageDimension, FixedImageDimension,
119  typedef PointSet<
120  CoordinateRepresentationType, MovingImageDimension,
121  DefaultStaticMeshTraits<
123  MovingImageDimension, MovingImageDimension,
126 
129 
131  typedef typename ITKBaseType::MeasureType MeasureType;
132 
134  virtual ITKBaseType * GetAsITKBaseType( void )
135  {
136  return dynamic_cast<ITKBaseType *>( this );
137  }
138 
140  virtual const ITKBaseType * GetAsITKBaseType( void ) const
141  {
142  return dynamic_cast<const ITKBaseType *>( this );
143  }
144 
149  virtual void BeforeEachResolutionBase( void );
150 
154  virtual void AfterEachIterationBase( void );
155 
159  virtual void SelectNewSamples( void );
160 
164  virtual bool GetAdvancedMetricUseImageSampler( void ) const;
165 
170  virtual void SetAdvancedMetricImageSampler( ImageSamplerBaseType * sampler );
171 
176  virtual ImageSamplerBaseType * GetAdvancedMetricImageSampler( void ) const;
177 
179  virtual bool GetShowExactMetricValue( void ) const
180  { return this->m_ShowExactMetricValue; }
181 
184  { return this->m_CurrentExactMetricValue; }
185 
186 protected:
187 
189  typedef typename ITKBaseType::ParametersType ParametersType;
190 
193  typedef typename
195 
197  MetricBase();
199  virtual ~MetricBase() {}
200 
210  virtual MeasureType GetExactValue( const ParametersType& parameters );
217 
218 private:
219 
221  MetricBase( const Self& ); // purposely not implemented
223  void operator=( const Self& ); // purposely not implemented
224 
225 }; // end class MetricBase
226 
227 
228 } // end namespace elastix
229 
230 #ifndef ITK_MANUAL_INSTANTIATION
231 #include "elxMetricBase.hxx"
232 #endif
233 
234 #endif // end #ifndef __elxMetricBase_h
The BaseComponentSE class is a base class for elastix components that provides some basic functionali...
Superclass::ElastixPointer ElastixPointer
Definition: elxMetricBase.h:86
Superclass::RegistrationType RegistrationType
Definition: elxMetricBase.h:89
ITKBaseType::MeasureType MeasureType
virtual MeasureType GetCurrentExactMetricValue(void) const
ElastixType::RegistrationBaseType RegistrationType
ElastixType::ConfigurationPointer ConfigurationPointer
Superclass::ConfigurationType ConfigurationType
Definition: elxMetricBase.h:87
BaseComponentSE< TElastix > Superclass
Definition: elxMetricBase.h:79
ElastixType::Pointer ElastixPointer
ElastixType::ConfigurationType ConfigurationType
An extension of the ITK ImageToImageMetric. It is the intended base class for all elastix metrics...
AdvancedMetricType::ImageSamplerType ImageSamplerBaseType
AdvancedImageToImageMetric< FixedImageType, MovingImageType > AdvancedMetricType
virtual bool GetShowExactMetricValue(void) const
InputImageType::OffsetType SampleGridSpacingType
PointSet< CoordinateRepresentationType, MovingImageDimension, DefaultStaticMeshTraits< CoordinateRepresentationType, MovingImageDimension, MovingImageDimension, CoordinateRepresentationType, CoordinateRepresentationType, CoordinateRepresentationType > > MovingPointSetType
ElastixType::FixedImageType FixedImageType
Definition: elxMetricBase.h:93
SmartPointer< Self > Pointer
virtual ITKBaseType * GetAsITKBaseType(void)
RegistrationType * RegistrationPointer
PointSet< CoordinateRepresentationType, FixedImageDimension, DefaultStaticMeshTraits< CoordinateRepresentationType, FixedImageDimension, FixedImageDimension, CoordinateRepresentationType, CoordinateRepresentationType, CoordinateRepresentationType > > FixedPointSetType
This class is a base class for any image sampler.
MovingPointType::ValueType MovingPointValueType
Definition: elxMetricBase.h:98
ExactMetricImageSamplerType::Pointer m_ExactMetricSampler
SingleValuedCostFunction ITKBaseType
MovingImageType::PointType MovingPointType
Definition: elxMetricBase.h:97
ITKBaseType::ParametersType ParametersType
FixedPointType::ValueType FixedPointValueType
Definition: elxMetricBase.h:95
MeasureType m_CurrentExactMetricValue
FixedImageType::PointType FixedPointType
Definition: elxMetricBase.h:94
Superclass::ElastixType ElastixType
Definition: elxMetricBase.h:82
ElastixType::MovingImageType MovingImageType
Definition: elxMetricBase.h:96
Superclass::RegistrationPointer RegistrationPointer
Definition: elxMetricBase.h:90
itk::ImageGridSampler< FixedImageType > ExactMetricImageSamplerType
ITKBaseType::ParametersValueType CoordinateRepresentationType
virtual const ITKBaseType * GetAsITKBaseType(void) const
Superclass::ConfigurationPointer ConfigurationPointer
Definition: elxMetricBase.h:88
ExactMetricImageSamplerType::SampleGridSpacingType ExactMetricSampleGridSpacingType
ExactMetricSampleGridSpacingType m_ExactMetricSampleGridSpacing
Samples image voxels on a regular grid.
This class is the elastix base class for all Metrics.
Definition: elxMetricBase.h:73


Generated on 06-12-2013 for elastix by doxygen 1.8.5 elastix logo