go home Home | Main Page | Topics | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
Loading...
Searching...
No Matches
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
75
76template <typename TElastix>
77class ITK_TEMPLATE_EXPORT MetricBase : public BaseComponentSE<TElastix>
78{
79public:
81
85
88
90 using typename Superclass::ElastixType;
91 using typename Superclass::RegistrationType;
92
94 using FixedImageType = typename ElastixType::FixedImageType;
95 using FixedPointType = typename FixedImageType::PointType;
96 using FixedPointValueType = typename FixedPointType::ValueType;
97 using MovingImageType = typename ElastixType::MovingImageType;
98 using MovingPointType = typename MovingImageType::PointType;
99 using MovingPointValueType = typename MovingPointType::ValueType;
100
102 using ITKBaseType = itk::SingleValuedCostFunction;
105
107 itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension);
109 itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension);
110
112 using CoordinateRepresentationType = typename ITKBaseType::ParametersValueType;
114 FixedImageDimension,
115 itk::DefaultStaticMeshTraits<CoordinateRepresentationType,
116 FixedImageDimension,
117 FixedImageDimension,
122 MovingImageDimension,
123 itk::DefaultStaticMeshTraits<CoordinateRepresentationType,
124 MovingImageDimension,
125 MovingImageDimension,
129
132
134 using MeasureType = typename ITKBaseType::MeasureType;
135
139 {
140 return &(this->GetSelf());
141 }
142
143
145 const ITKBaseType *
147 {
148 return &(this->GetSelf());
149 }
150
151
152 void
154
159 void
161
165 void
167
171 virtual void
173
177 virtual bool
179
184 virtual void
186
191 virtual ImageSamplerBaseType *
193
195 virtual bool
197 {
198 return this->m_ShowExactMetricValue;
199 }
200
202 virtual MeasureType
204 {
205 return this->m_CurrentExactMetricValue;
206 }
207
208protected:
210 using ParametersType = typename ITKBaseType::ParametersType;
211
216
218 MetricBase() = default;
220 ~MetricBase() override = default;
221
231 virtual MeasureType
232 GetExactValue(const ParametersType & parameters);
233
235
239 ExactMetricSampleGridSpacingType m_ExactMetricSampleGridSpacing{ itk::MakeFilled<ExactMetricSampleGridSpacingType>(
240 1) };
242
243private:
245};
246
247} // end namespace elastix
248
249#ifndef ITK_MANUAL_INSTANTIATION
250# include "elxMetricBase.hxx"
251#endif
252
253#endif // end #ifndef elxMetricBase_h
typename ElastixType::RegistrationBaseType RegistrationType
virtual const itk::Object & GetSelf() const =0
virtual bool GetShowExactMetricValue() const
ExactMetricSampleGridSpacingType m_ExactMetricSampleGridSpacing
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
itk::PointSet< CoordinateRepresentationType, MovingImageDimension, itk::DefaultStaticMeshTraits< CoordinateRepresentationType, MovingImageDimension, MovingImageDimension, CoordinateRepresentationType, CoordinateRepresentationType, CoordinateRepresentationType > > MovingPointSetType
ExactMetricImageSamplerPointer m_ExactMetricSampler
typename FixedImageType::PointType FixedPointType
typename FixedPointType::ValueType FixedPointValueType
void AfterEachIterationBase() override
itk::PointSet< CoordinateRepresentationType, FixedImageDimension, itk::DefaultStaticMeshTraits< CoordinateRepresentationType, FixedImageDimension, FixedImageDimension, CoordinateRepresentationType, CoordinateRepresentationType, CoordinateRepresentationType > > FixedPointSetType
virtual void SelectNewSamples()
virtual void SetAdvancedMetricImageSampler(ImageSamplerBaseType *sampler)
virtual bool GetAdvancedMetricUseImageSampler() const
unsigned int m_ExactMetricEachXNumberOfIterations
itk::SingleValuedCostFunction ITKBaseType
typename ExactMetricImageSamplerType::SampleGridSpacingType ExactMetricSampleGridSpacingType
typename ElastixType::FixedImageType FixedImageType
typename AdvancedMetricType::ImageSamplerType ImageSamplerBaseType
virtual ImageSamplerBaseType * GetAdvancedMetricImageSampler() const
ITKBaseType * GetAsITKBaseType()
~MetricBase() override=default
virtual MeasureType GetExactValue(const ParametersType &parameters)
ITK_DISALLOW_COPY_AND_MOVE(MetricBase)
elxDeclarePureVirtualGetSelfMacro(ITKBaseType)
virtual MeasureType GetCurrentExactMetricValue() const
const ITKBaseType * GetAsITKBaseType() const
typename ElastixType::MovingImageType MovingImageType
void BeforeRegistrationBase() override
void BeforeEachResolutionBase() override
BaseComponentSE< TElastix > Superclass
typename AdvancedMetricType::MovingImageDerivativeScalesType MovingImageDerivativeScalesType
typename MovingImageType::PointType MovingPointType
itkOverrideGetNameOfClassMacro(MetricBase)
typename ITKBaseType::ParametersValueType CoordinateRepresentationType
itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension)
typename MovingPointType::ValueType MovingPointValueType
itk::AdvancedImageToImageMetric< FixedImageType, MovingImageType > AdvancedMetricType
typename ITKBaseType::ParametersType ParametersType
itk::ImageGridSampler< FixedImageType > ExactMetricImageSamplerType
typename ExactMetricImageSamplerType::Pointer ExactMetricImageSamplerPointer
typename ITKBaseType::MeasureType MeasureType
An extension of the ITK ImageToImageMetric. It is the intended base class for all elastix metrics.
FixedArray< double, Self::MovingImageDimension > MovingImageDerivativeScalesType
Samples image voxels on a regular grid.
typename InputImageType::OffsetType SampleGridSpacingType


Generated on 1774142652 for elastix by doxygen 1.15.0 elastix logo