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
29namespace elastix
30{
31
71template< class TElastix >
72class MetricBase : public BaseComponentSE< TElastix >
73{
74public:
75
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
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 void BeforeEachResolutionBase( void ) override;
152
156 void AfterEachIterationBase( void ) override;
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
188protected:
189
191 typedef typename ITKBaseType::ParametersType ParametersType;
192
197
201 ~MetricBase() override {}
202
212 virtual MeasureType GetExactValue( const ParametersType & parameters );
213
221
222private:
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
The BaseComponentSE class is a base class for elastix components that provides some basic functionali...
Configuration::Pointer ConfigurationPointer
itk::WeakPointer< ElastixType > ElastixPointer
RegistrationType * RegistrationPointer
ElastixType::RegistrationBaseType RegistrationType
A class that deals with user given parameters and command line arguments.
This class is the elastix base class for all Metrics.
Definition: elxMetricBase.h:73
itk::PointSet< CoordinateRepresentationType, MovingImageDimension, itk::DefaultStaticMeshTraits< CoordinateRepresentationType, MovingImageDimension, MovingImageDimension, CoordinateRepresentationType, CoordinateRepresentationType, CoordinateRepresentationType > > MovingPointSetType
ExactMetricSampleGridSpacingType m_ExactMetricSampleGridSpacing
itk::AdvancedImageToImageMetric< FixedImageType, MovingImageType > AdvancedMetricType
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
ExactMetricImageSamplerType::Pointer ExactMetricImageSamplerPointer
MetricBase(const Self &)
virtual ImageSamplerBaseType * GetAdvancedMetricImageSampler(void) const
ExactMetricImageSamplerPointer m_ExactMetricSampler
itk::SingleValuedCostFunction ITKBaseType
ITKBaseType::ParametersValueType CoordinateRepresentationType
~MetricBase() override
virtual void SetAdvancedMetricImageSampler(ImageSamplerBaseType *sampler)
Superclass::ConfigurationType ConfigurationType
Definition: elxMetricBase.h:86
void operator=(const Self &)
ITKBaseType::MeasureType MeasureType
unsigned int m_ExactMetricEachXNumberOfIterations
void AfterEachIterationBase(void) override
ExactMetricImageSamplerType::SampleGridSpacingType ExactMetricSampleGridSpacingType
virtual MeasureType GetCurrentExactMetricValue(void) const
Superclass::RegistrationPointer RegistrationPointer
Definition: elxMetricBase.h:89
ITKBaseType::ParametersType ParametersType
AdvancedMetricType::MovingImageDerivativeScalesType MovingImageDerivativeScalesType
itk::ImageGridSampler< FixedImageType > ExactMetricImageSamplerType
virtual MeasureType GetExactValue(const ParametersType &parameters)
Superclass::ElastixType ElastixType
Definition: elxMetricBase.h:84
MovingPointType::ValueType MovingPointValueType
Definition: elxMetricBase.h:97
FixedPointType::ValueType FixedPointValueType
Definition: elxMetricBase.h:94
virtual void SelectNewSamples(void)
ElastixType::MovingImageType MovingImageType
Definition: elxMetricBase.h:95
itk::PointSet< CoordinateRepresentationType, FixedImageDimension, itk::DefaultStaticMeshTraits< CoordinateRepresentationType, FixedImageDimension, FixedImageDimension, CoordinateRepresentationType, CoordinateRepresentationType, CoordinateRepresentationType > > FixedPointSetType
virtual bool GetShowExactMetricValue(void) const
virtual bool GetAdvancedMetricUseImageSampler(void) const
void BeforeEachResolutionBase(void) override
MeasureType m_CurrentExactMetricValue
virtual const ITKBaseType * GetAsITKBaseType(void) const
ElastixType::FixedImageType FixedImageType
Definition: elxMetricBase.h:92
Superclass::ConfigurationPointer ConfigurationPointer
Definition: elxMetricBase.h:87
AdvancedMetricType::ImageSamplerType ImageSamplerBaseType
itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension)
FixedImageType::PointType FixedPointType
Definition: elxMetricBase.h:93
BaseComponentSE< TElastix > Superclass
Definition: elxMetricBase.h:78
Superclass::RegistrationType RegistrationType
Definition: elxMetricBase.h:88
virtual ITKBaseType * GetAsITKBaseType(void)
MovingImageType::PointType MovingPointType
Definition: elxMetricBase.h:96
Superclass::ElastixPointer ElastixPointer
Definition: elxMetricBase.h:85
An extension of the ITK ImageToImageMetric. It is the intended base class for all elastix metrics.
Samples image voxels on a regular grid.
InputImageType::OffsetType SampleGridSpacingType
This class is a base class for any image sampler.


Generated on 1667476801 for elastix by doxygen 1.9.4 elastix logo