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 namespace elastix
29 {
30 
70 template< class TElastix >
71 class MetricBase : public BaseComponentSE< TElastix >
72 {
73 public:
74 
76  typedef MetricBase Self;
78 
80  itkTypeMacro( MetricBase, BaseComponentSE );
81 
83  typedef typename Superclass::ElastixType ElastixType;
89 
91  typedef typename ElastixType::FixedImageType FixedImageType;
92  typedef typename FixedImageType::PointType FixedPointType;
93  typedef typename FixedPointType::ValueType FixedPointValueType;
94  typedef typename ElastixType::MovingImageType MovingImageType;
95  typedef typename MovingImageType::PointType MovingPointType;
96  typedef typename MovingPointType::ValueType MovingPointValueType;
97 
99  typedef itk::SingleValuedCostFunction ITKBaseType;
102 
104  itkStaticConstMacro( FixedImageDimension, unsigned int, FixedImageType::ImageDimension );
106  itkStaticConstMacro( MovingImageDimension, unsigned int, MovingImageType::ImageDimension );
107 
109  typedef typename ITKBaseType::ParametersValueType CoordinateRepresentationType;
110  typedef itk::PointSet<
111  CoordinateRepresentationType, FixedImageDimension,
112  itk::DefaultStaticMeshTraits<
114  FixedImageDimension, FixedImageDimension,
117  typedef itk::PointSet<
118  CoordinateRepresentationType, MovingImageDimension,
119  itk::DefaultStaticMeshTraits<
121  MovingImageDimension, MovingImageDimension,
124 
127 
129  typedef typename ITKBaseType::MeasureType MeasureType;
130 
132  virtual ITKBaseType * GetAsITKBaseType( void )
133  {
134  return dynamic_cast< ITKBaseType * >( this );
135  }
136 
137 
139  virtual const ITKBaseType * GetAsITKBaseType( void ) const
140  {
141  return dynamic_cast< const ITKBaseType * >( this );
142  }
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 
195 
197  MetricBase();
199  virtual ~MetricBase() {}
200 
210  virtual MeasureType GetExactValue( const ParametersType & parameters );
211 
218 
219 private:
220 
222  MetricBase( const Self & ); // purposely not implemented
224  void operator=( const Self & ); // purposely not implemented
225 
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:84
Superclass::RegistrationType RegistrationType
Definition: elxMetricBase.h:87
ITKBaseType::MeasureType MeasureType
virtual MeasureType GetCurrentExactMetricValue(void) const
ElastixType::RegistrationBaseType RegistrationType
ElastixType::ConfigurationPointer ConfigurationPointer
Superclass::ConfigurationType ConfigurationType
Definition: elxMetricBase.h:85
ExactMetricImageSamplerPointer m_ExactMetricSampler
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
virtual ImageSamplerBaseType * GetAdvancedMetricImageSampler(void) const
virtual bool GetShowExactMetricValue(void) const
SmartPointer< Self > Pointer
itk::PointSet< CoordinateRepresentationType, FixedImageDimension, itk::DefaultStaticMeshTraits< CoordinateRepresentationType, FixedImageDimension, FixedImageDimension, CoordinateRepresentationType, CoordinateRepresentationType, CoordinateRepresentationType > > FixedPointSetType
InputImageType::OffsetType SampleGridSpacingType
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
ElastixType::FixedImageType FixedImageType
Definition: elxMetricBase.h:91
virtual void BeforeEachResolutionBase(void)
virtual void SelectNewSamples(void)
virtual ITKBaseType * GetAsITKBaseType(void)
RegistrationType * RegistrationPointer
This class is a base class for any image sampler.
MovingPointType::ValueType MovingPointValueType
Definition: elxMetricBase.h:96
BaseComponentSE< TElastix > Superclass
Definition: elxMetricBase.h:77
itk::ImageGridSampler< FixedImageType > ExactMetricImageSamplerType
ExactMetricImageSamplerType::Pointer ExactMetricImageSamplerPointer
MovingImageType::PointType MovingPointType
Definition: elxMetricBase.h:95
ITKBaseType::ParametersType ParametersType
FixedPointType::ValueType FixedPointValueType
Definition: elxMetricBase.h:93
MeasureType m_CurrentExactMetricValue
itk::AdvancedImageToImageMetric< FixedImageType, MovingImageType > AdvancedMetricType
FixedImageType::PointType FixedPointType
Definition: elxMetricBase.h:92
virtual void SetAdvancedMetricImageSampler(ImageSamplerBaseType *sampler)
Superclass::ElastixType ElastixType
Definition: elxMetricBase.h:80
itk::SingleValuedCostFunction ITKBaseType
Definition: elxMetricBase.h:99
itk::PointSet< CoordinateRepresentationType, MovingImageDimension, itk::DefaultStaticMeshTraits< CoordinateRepresentationType, MovingImageDimension, MovingImageDimension, CoordinateRepresentationType, CoordinateRepresentationType, CoordinateRepresentationType > > MovingPointSetType
ElastixType::MovingImageType MovingImageType
Definition: elxMetricBase.h:94
Superclass::RegistrationPointer RegistrationPointer
Definition: elxMetricBase.h:88
virtual bool GetAdvancedMetricUseImageSampler(void) const
virtual void AfterEachIterationBase(void)
ITKBaseType::ParametersValueType CoordinateRepresentationType
virtual const ITKBaseType * GetAsITKBaseType(void) const
Superclass::ConfigurationPointer ConfigurationPointer
Definition: elxMetricBase.h:86
ExactMetricImageSamplerType::SampleGridSpacingType ExactMetricSampleGridSpacingType
ExactMetricSampleGridSpacingType m_ExactMetricSampleGridSpacing
Samples image voxels on a regular grid.
virtual MeasureType GetExactValue(const ParametersType &parameters)
This class is the elastix base class for all Metrics.
Definition: elxMetricBase.h:71
void operator=(const Self &)


Generated on 11-03-2014 for elastix by doxygen 1.8.6 elastix logo