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 
71 template <class TElastix>
72 class MetricBase : public BaseComponentSE<TElastix>
73 {
74 public:
75 
77  typedef MetricBase Self;
79 
81  itkTypeMacro( MetricBase, BaseComponentSE );
82 
84  typedef typename Superclass::ElastixType ElastixType;
90 
92  typedef typename ElastixType::FixedImageType FixedImageType;
93  typedef typename FixedImageType::PointType FixedPointType;
94  typedef typename FixedPointType::ValueType FixedPointValueType;
95  typedef typename ElastixType::MovingImageType MovingImageType;
96  typedef typename MovingImageType::PointType MovingPointType;
97  typedef typename MovingPointType::ValueType MovingPointValueType;
98 
100  typedef itk::SingleValuedCostFunction ITKBaseType;
103 
105  itkStaticConstMacro( FixedImageDimension, unsigned int, FixedImageType::ImageDimension );
107  itkStaticConstMacro( MovingImageDimension, unsigned int, MovingImageType::ImageDimension );
108 
110  typedef typename ITKBaseType::ParametersValueType CoordinateRepresentationType;
111  typedef itk::PointSet<
112  CoordinateRepresentationType, FixedImageDimension,
113  itk::DefaultStaticMeshTraits<
115  FixedImageDimension, FixedImageDimension,
118  typedef itk::PointSet<
119  CoordinateRepresentationType, MovingImageDimension,
120  itk::DefaultStaticMeshTraits<
122  MovingImageDimension, MovingImageDimension,
125 
128 
130  typedef typename ITKBaseType::MeasureType MeasureType;
131 
133  virtual ITKBaseType * GetAsITKBaseType( void )
134  {
135  return dynamic_cast<ITKBaseType *>( this );
136  }
137 
139  virtual const ITKBaseType * GetAsITKBaseType( void ) const
140  {
141  return dynamic_cast<const ITKBaseType *>( this );
142  }
143 
148  virtual void BeforeEachResolutionBase( void );
149 
153  virtual void AfterEachIterationBase( void );
154 
158  virtual void SelectNewSamples( void );
159 
163  virtual bool GetAdvancedMetricUseImageSampler( void ) const;
164 
169  virtual void SetAdvancedMetricImageSampler( ImageSamplerBaseType * sampler );
170 
175  virtual ImageSamplerBaseType * GetAdvancedMetricImageSampler( void ) const;
176 
178  virtual bool GetShowExactMetricValue( void ) const
179  { return this->m_ShowExactMetricValue; }
180 
183  { return this->m_CurrentExactMetricValue; }
184 
185 protected:
186 
188  typedef typename ITKBaseType::ParametersType ParametersType;
189 
192  typedef typename
194 
196  MetricBase();
198  virtual ~MetricBase() {}
199 
209  virtual MeasureType GetExactValue( const ParametersType& parameters );
216 
217 private:
218 
220  MetricBase( const Self& ); // purposely not implemented
222  void operator=( const Self& ); // purposely not implemented
223 
224 }; // end class MetricBase
225 
226 
227 } // end namespace elastix
228 
229 #ifndef ITK_MANUAL_INSTANTIATION
230 #include "elxMetricBase.hxx"
231 #endif
232 
233 #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:85
Superclass::RegistrationType RegistrationType
Definition: elxMetricBase.h:88
ITKBaseType::MeasureType MeasureType
virtual MeasureType GetCurrentExactMetricValue(void) const
ElastixType::RegistrationBaseType RegistrationType
ElastixType::ConfigurationPointer ConfigurationPointer
Superclass::ConfigurationType ConfigurationType
Definition: elxMetricBase.h:86
BaseComponentSE< TElastix > Superclass
Definition: elxMetricBase.h:78
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
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:92
SmartPointer< Self > Pointer
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:97
ExactMetricImageSamplerType::Pointer m_ExactMetricSampler
MovingImageType::PointType MovingPointType
Definition: elxMetricBase.h:96
ITKBaseType::ParametersType ParametersType
FixedPointType::ValueType FixedPointValueType
Definition: elxMetricBase.h:94
MeasureType m_CurrentExactMetricValue
itk::AdvancedImageToImageMetric< FixedImageType, MovingImageType > AdvancedMetricType
FixedImageType::PointType FixedPointType
Definition: elxMetricBase.h:93
virtual void SetAdvancedMetricImageSampler(ImageSamplerBaseType *sampler)
Superclass::ElastixType ElastixType
Definition: elxMetricBase.h:81
itk::SingleValuedCostFunction ITKBaseType
itk::PointSet< CoordinateRepresentationType, MovingImageDimension, itk::DefaultStaticMeshTraits< CoordinateRepresentationType, MovingImageDimension, MovingImageDimension, CoordinateRepresentationType, CoordinateRepresentationType, CoordinateRepresentationType > > MovingPointSetType
ElastixType::MovingImageType MovingImageType
Definition: elxMetricBase.h:95
Superclass::RegistrationPointer RegistrationPointer
Definition: elxMetricBase.h:89
virtual bool GetAdvancedMetricUseImageSampler(void) const
virtual void AfterEachIterationBase(void)
itk::ImageGridSampler< FixedImageType > ExactMetricImageSamplerType
ITKBaseType::ParametersValueType CoordinateRepresentationType
virtual const ITKBaseType * GetAsITKBaseType(void) const
Superclass::ConfigurationPointer ConfigurationPointer
Definition: elxMetricBase.h:87
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:72
void operator=(const Self &)


Generated on 04-01-2014 for elastix by doxygen 1.8.5 elastix logo