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  * Copyright UMC Utrecht and contributors
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __elxMetricBase_h
19 #define __elxMetricBase_h
20 
22 #include "elxMacro.h"
23 
24 #include "elxBaseComponentSE.h"
26 #include "itkImageGridSampler.h"
27 #include "itkPointSet.h"
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 
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;
104 
106  itkStaticConstMacro( FixedImageDimension, unsigned int, FixedImageType::ImageDimension );
108  itkStaticConstMacro( MovingImageDimension, unsigned int, MovingImageType::ImageDimension );
109 
111  typedef typename ITKBaseType::ParametersValueType CoordinateRepresentationType;
112  typedef itk::PointSet<
113  CoordinateRepresentationType, FixedImageDimension,
114  itk::DefaultStaticMeshTraits<
116  FixedImageDimension, FixedImageDimension,
119  typedef itk::PointSet<
120  CoordinateRepresentationType, MovingImageDimension,
121  itk::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 
139 
141  virtual const ITKBaseType * GetAsITKBaseType( void ) const
142  {
143  return dynamic_cast< const ITKBaseType * >( this );
144  }
145 
146 
151  virtual void BeforeEachResolutionBase( void );
152 
156  virtual void AfterEachIterationBase( void );
157 
161  virtual void SelectNewSamples( void );
162 
166  virtual bool GetAdvancedMetricUseImageSampler( void ) const;
167 
173 
179 
181  virtual bool GetShowExactMetricValue( void ) const
182  { return this->m_ShowExactMetricValue; }
183 
185  virtual MeasureType GetCurrentExactMetricValue( void ) const
186  { return this->m_CurrentExactMetricValue; }
187 
188 protected:
189 
191  typedef typename ITKBaseType::ParametersType ParametersType;
192 
197 
201  virtual ~MetricBase() {}
202 
212  virtual MeasureType GetExactValue( const ParametersType & parameters );
213 
221 
222 private:
223 
225  MetricBase( const Self & ); // purposely not implemented
227  void operator=( const Self & ); // purposely not implemented
228 
229 };
230 
231 } // end namespace elastix
232 
233 #ifndef ITK_MANUAL_INSTANTIATION
234 #include "elxMetricBase.hxx"
235 #endif
236 
237 #endif // end #ifndef __elxMetricBase_h
elastix::MetricBase::MovingImageDerivativeScalesType
AdvancedMetricType::MovingImageDerivativeScalesType MovingImageDerivativeScalesType
Definition: elxMetricBase.h:103
elastix::MetricBase::m_ExactMetricSampleGridSpacing
ExactMetricSampleGridSpacingType m_ExactMetricSampleGridSpacing
Definition: elxMetricBase.h:219
elastix::MetricBase::MetricBase
MetricBase()
elastix::MetricBase::ITKBaseType
itk::SingleValuedCostFunction ITKBaseType
Definition: elxMetricBase.h:100
elastix::MetricBase::MovingPointValueType
MovingPointType::ValueType MovingPointValueType
Definition: elxMetricBase.h:97
elastix::MetricBase::itkStaticConstMacro
itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension)
elastix::MetricBase::m_ExactMetricEachXNumberOfIterations
unsigned int m_ExactMetricEachXNumberOfIterations
Definition: elxMetricBase.h:220
elastix::MetricBase::RegistrationPointer
Superclass::RegistrationPointer RegistrationPointer
Definition: elxMetricBase.h:89
elastix::MetricBase::MovingPointType
MovingImageType::PointType MovingPointType
Definition: elxMetricBase.h:96
itkImageGridSampler.h
elastix::MetricBase::~MetricBase
virtual ~MetricBase()
Definition: elxMetricBase.h:201
SmartPointer< Self >
elastix::MetricBase
This class is the elastix base class for all Metrics.
Definition: elxMetricBase.h:73
itk::AdvancedImageToImageMetric
An extension of the ITK ImageToImageMetric. It is the intended base class for all elastix metrics.
Definition: itkAdvancedImageToImageMetric.h:81
elastix::MetricBase::m_ShowExactMetricValue
bool m_ShowExactMetricValue
Definition: elxMetricBase.h:216
elastix::MetricBase::itkStaticConstMacro
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
elastix::MetricBase::GetAsITKBaseType
virtual ITKBaseType * GetAsITKBaseType(void)
Definition: elxMetricBase.h:134
elastix::BaseComponentSE::RegistrationPointer
RegistrationType * RegistrationPointer
Definition: elxBaseComponentSE.h:63
elastix::MetricBase::SetAdvancedMetricImageSampler
virtual void SetAdvancedMetricImageSampler(ImageSamplerBaseType *sampler)
elastix::BaseComponentSE::ElastixType
TElastix ElastixType
Definition: elxBaseComponentSE.h:52
elastix::BaseComponentSE::ConfigurationPointer
ElastixType::ConfigurationPointer ConfigurationPointer
Definition: elxBaseComponentSE.h:57
elastix::MetricBase::SelectNewSamples
virtual void SelectNewSamples(void)
elastix::MetricBase::MovingPointSetType
itk::PointSet< CoordinateRepresentationType, MovingImageDimension, itk::DefaultStaticMeshTraits< CoordinateRepresentationType, MovingImageDimension, MovingImageDimension, CoordinateRepresentationType, CoordinateRepresentationType, CoordinateRepresentationType > > MovingPointSetType
Definition: elxMetricBase.h:125
elastix::BaseComponentSE
The BaseComponentSE class is a base class for elastix components that provides some basic functionali...
Definition: elxBaseComponentSE.h:44
elastix::MetricBase::ImageSamplerBaseType
AdvancedMetricType::ImageSamplerType ImageSamplerBaseType
Definition: elxMetricBase.h:128
elastix::MetricBase::m_CurrentExactMetricValue
MeasureType m_CurrentExactMetricValue
Definition: elxMetricBase.h:218
elastix::MetricBase::GetExactValue
virtual MeasureType GetExactValue(const ParametersType &parameters)
elastix::MetricBase::AdvancedMetricType
itk::AdvancedImageToImageMetric< FixedImageType, MovingImageType > AdvancedMetricType
Definition: elxMetricBase.h:102
elxBaseComponentSE.h
elastix::MetricBase::GetAdvancedMetricImageSampler
virtual ImageSamplerBaseType * GetAdvancedMetricImageSampler(void) const
elastix::MetricBase::GetCurrentExactMetricValue
virtual MeasureType GetCurrentExactMetricValue(void) const
Definition: elxMetricBase.h:185
elastix::MetricBase::CoordinateRepresentationType
ITKBaseType::ParametersValueType CoordinateRepresentationType
Definition: elxMetricBase.h:111
elastix::MetricBase::ExactMetricImageSamplerType
itk::ImageGridSampler< FixedImageType > ExactMetricImageSamplerType
Definition: elxMetricBase.h:194
elastix::MetricBase::MeasureType
ITKBaseType::MeasureType MeasureType
Definition: elxMetricBase.h:131
elastix::MetricBase::ConfigurationPointer
Superclass::ConfigurationPointer ConfigurationPointer
Definition: elxMetricBase.h:87
elastix::MetricBase::MetricBase
MetricBase(const Self &)
elastix::MetricBase::ExactMetricSampleGridSpacingType
ExactMetricImageSamplerType::SampleGridSpacingType ExactMetricSampleGridSpacingType
Definition: elxMetricBase.h:196
elastix::MetricBase::m_ExactMetricSampler
ExactMetricImageSamplerPointer m_ExactMetricSampler
Definition: elxMetricBase.h:217
elastix::MetricBase::operator=
void operator=(const Self &)
elastix::MetricBase::ExactMetricImageSamplerPointer
ExactMetricImageSamplerType::Pointer ExactMetricImageSamplerPointer
Definition: elxMetricBase.h:195
elastix::MetricBase::FixedPointSetType
itk::PointSet< CoordinateRepresentationType, FixedImageDimension, itk::DefaultStaticMeshTraits< CoordinateRepresentationType, FixedImageDimension, FixedImageDimension, CoordinateRepresentationType, CoordinateRepresentationType, CoordinateRepresentationType > > FixedPointSetType
Definition: elxMetricBase.h:118
elastix::MetricBase::GetAsITKBaseType
virtual const ITKBaseType * GetAsITKBaseType(void) const
Definition: elxMetricBase.h:141
elastix::MetricBase::GetShowExactMetricValue
virtual bool GetShowExactMetricValue(void) const
Definition: elxMetricBase.h:181
elastix::MetricBase::ConfigurationType
Superclass::ConfigurationType ConfigurationType
Definition: elxMetricBase.h:86
elastix::MetricBase::Self
MetricBase Self
Definition: elxMetricBase.h:77
elastix::MetricBase::Superclass
BaseComponentSE< TElastix > Superclass
Definition: elxMetricBase.h:78
elastix::BaseComponentSE::ElastixPointer
itk::WeakPointer< ElastixType > ElastixPointer
Definition: elxBaseComponentSE.h:53
elastix::MetricBase::ParametersType
ITKBaseType::ParametersType ParametersType
Definition: elxMetricBase.h:191
elastix::MetricBase::ElastixPointer
Superclass::ElastixPointer ElastixPointer
Definition: elxMetricBase.h:85
elastix::MetricBase::GetAdvancedMetricUseImageSampler
virtual bool GetAdvancedMetricUseImageSampler(void) const
elastix::MetricBase::FixedPointValueType
FixedPointType::ValueType FixedPointValueType
Definition: elxMetricBase.h:94
elastix::MetricBase::FixedImageType
ElastixType::FixedImageType FixedImageType
Definition: elxMetricBase.h:92
elastix::MetricBase::FixedPointType
FixedImageType::PointType FixedPointType
Definition: elxMetricBase.h:93
elastix::MetricBase::BeforeEachResolutionBase
virtual void BeforeEachResolutionBase(void)
itk::ImageGridSampler::SampleGridSpacingType
InputImageType::OffsetType SampleGridSpacingType
Definition: itkImageGridSampler.h:85
elastix::MetricBase::MovingImageType
ElastixType::MovingImageType MovingImageType
Definition: elxMetricBase.h:95
itk::ImageSamplerBase
This class is a base class for any image sampler.
Definition: itkImageSamplerBase.h:45
elastix::MetricBase::ElastixType
Superclass::ElastixType ElastixType
Definition: elxMetricBase.h:81
itk::ImageGridSampler
Samples image voxels on a regular grid.
Definition: itkImageGridSampler.h:46
elxMacro.h
elastix::BaseComponentSE::ConfigurationType
ElastixType::ConfigurationType ConfigurationType
Definition: elxBaseComponentSE.h:56
elastix::MetricBase::AfterEachIterationBase
virtual void AfterEachIterationBase(void)
elastix
Definition: elxFixedGenericPyramid.h:25
itkAdvancedImageToImageMetric.h
FixedArray< double, Self::MovingImageDimension >
elastix::MetricBase::RegistrationType
Superclass::RegistrationType RegistrationType
Definition: elxMetricBase.h:88
elastix::BaseComponentSE::RegistrationType
ElastixType::RegistrationBaseType RegistrationType
Definition: elxBaseComponentSE.h:62


Generated on OURCE_DATE_EPOCH for elastix by doxygen 1.8.18 elastix logo