go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkMultiInputImageToImageMetricBase.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 __itkMultiInputImageToImageMetricBase_h
19#define __itkMultiInputImageToImageMetricBase_h
20
22#include <vector>
23
25#define itkSetNumberOfMacro( name ) \
26 virtual void SetNumberOf##name##s( const unsigned int _arg ) \
27 { \
28 if( this->m_NumberOf##name##s != _arg ) \
29 { \
30 this->m_##name##Vector.resize( _arg ); \
31 this->m_NumberOf##name##s = _arg; \
32 this->Modified(); \
33 } \
34 } // comments for allowing ; after calling the macro
35
36namespace itk
37{
38
48template< class TFixedImage, class TMovingImage >
50 public AdvancedImageToImageMetric< TFixedImage, TMovingImage >
51{
52public:
53
58 typedef SmartPointer< const Self > ConstPointer;
59
62
64 itkStaticConstMacro( MovingImageDimension, unsigned int, TMovingImage::ImageDimension );
65 itkStaticConstMacro( FixedImageDimension, unsigned int, TFixedImage::ImageDimension );
66
98
99 typedef InterpolateImageFunction<
101 typedef typename FixedImageInterpolatorType::Pointer FixedImageInterpolatorPointer;
102
104 typedef std::vector< FixedImageConstPointer > FixedImageVectorType;
105 typedef std::vector< FixedImageMaskPointer > FixedImageMaskVectorType;
106 typedef std::vector< FixedImageRegionType > FixedImageRegionVectorType;
107 typedef std::vector< MovingImageConstPointer > MovingImageVectorType;
108 typedef std::vector< MovingImageMaskPointer > MovingImageMaskVectorType;
109 typedef std::vector< InterpolatorPointer > InterpolatorVectorType;
110 typedef std::vector< FixedImageInterpolatorPointer > FixedImageInterpolatorVectorType;
111
115 virtual void SetFixedImage( const FixedImageType * _arg, unsigned int pos );
116
118 void SetFixedImage( const FixedImageType * _arg ) override
119 {
120 this->SetFixedImage( _arg, 0 );
121 }
122
123
125 virtual const FixedImageType * GetFixedImage( unsigned int pos ) const;
126
128 const FixedImageType * GetFixedImage( void ) const override
129 {
130 return this->GetFixedImage( 0 );
131 }
132
133
135 itkSetNumberOfMacro( FixedImage );
136
138 itkGetConstMacro( NumberOfFixedImages, unsigned int );
139
143 virtual void SetFixedImageMask( FixedImageMaskType * _arg, unsigned int pos );
144
146 void SetFixedImageMask( FixedImageMaskType * _arg ) override
147 {
148 this->SetFixedImageMask( _arg, 0 );
149 }
150
151
153 virtual FixedImageMaskType * GetFixedImageMask( unsigned int pos ) const;
154
156 FixedImageMaskType * GetFixedImageMask( void ) const override
157 {
158 return this->GetFixedImageMask( 0 );
159 }
160
161
163 itkSetNumberOfMacro( FixedImageMask );
164
166 itkGetConstMacro( NumberOfFixedImageMasks, unsigned int );
167
171 virtual void SetFixedImageRegion( const FixedImageRegionType _arg, unsigned int pos );
172
174 void SetFixedImageRegion( const FixedImageRegionType _arg ) override
175 {
176 this->SetFixedImageRegion( _arg, 0 );
177 }
178
179
181 virtual const FixedImageRegionType & GetFixedImageRegion( unsigned int pos ) const;
182
184 const FixedImageRegionType & GetFixedImageRegion( void ) const override
185 {
186 return this->GetFixedImageRegion( 0 );
187 }
188
189
191 itkSetNumberOfMacro( FixedImageRegion );
192
194 itkGetConstMacro( NumberOfFixedImageRegions, unsigned int );
195
199 virtual void SetMovingImage( const MovingImageType * _arg, unsigned int pos );
200
202 void SetMovingImage( const MovingImageType * _arg ) override
203 {
204 this->SetMovingImage( _arg, 0 );
205 }
206
207
209 virtual const MovingImageType * GetMovingImage( unsigned int pos ) const;
210
212 const MovingImageType * GetMovingImage( void ) const override
213 {
214 return this->GetMovingImage( 0 );
215 }
216
217
219 itkSetNumberOfMacro( MovingImage );
220
222 itkGetConstMacro( NumberOfMovingImages, unsigned int );
223
227 virtual void SetMovingImageMask( MovingImageMaskType * _arg, unsigned int pos );
228
231 {
232 this->SetMovingImageMask( _arg, 0 );
233 }
234
235
237 virtual MovingImageMaskType * GetMovingImageMask( unsigned int pos ) const;
238
241 {
242 return this->GetMovingImageMask( 0 );
243 }
244
245
247 itkSetNumberOfMacro( MovingImageMask );
248
250 itkGetConstMacro( NumberOfMovingImageMasks, unsigned int );
251
257 virtual void SetInterpolator( InterpolatorType * _arg, unsigned int pos );
258
260 void SetInterpolator( InterpolatorType * _arg ) override
261 {
262 return this->SetInterpolator( _arg, 0 );
263 }
264
265
267 virtual InterpolatorType * GetInterpolator( unsigned int pos ) const;
268
270 InterpolatorType * GetInterpolator( void ) const override
271 {
272 return this->GetInterpolator( 0 );
273 }
274
275
277 itkSetNumberOfMacro( Interpolator );
278
280 itkGetConstMacro( NumberOfInterpolators, unsigned int );
281
283 itkGetConstMacro( InterpolatorsAreBSpline, bool );
284
290 virtual void SetFixedImageInterpolator( FixedImageInterpolatorType * _arg, unsigned int pos );
291
294 {
295 return this->SetFixedImageInterpolator( _arg, 0 );
296 }
297
298
300 virtual FixedImageInterpolatorType * GetFixedImageInterpolator( unsigned int pos ) const;
301
304 {
305 return this->GetFixedImageInterpolator( 0 );
306 }
307
308
310 itkSetNumberOfMacro( FixedImageInterpolator );
311
313 itkGetConstMacro( NumberOfFixedImageInterpolators, unsigned int );
314
318 void Initialize( void ) override;
319
320protected:
321
324
327
333
336 typedef typename BSplineInterpolatorType::Pointer BSplineInterpolatorPointer;
337 typedef std::vector< BSplineInterpolatorPointer > BSplineInterpolatorVectorType;
338
340 void InitializeImageSampler( void ) override;
341
345 virtual void CheckForBSplineInterpolators( void );
346
351 const MovingImagePointType & mappedPoint,
352 RealType & movingImageValue,
353 MovingImageDerivativeType * gradient ) const override;
354
357 const MovingImagePointType & mappedPoint ) const override;
358
367
370
371private:
372
373 MultiInputImageToImageMetricBase( const Self & ); // purposely not implemented
374 void operator=( const Self & ); // purposely not implemented
375
378
386
387};
388
389} // end namespace itk
390
391#undef itkSetNumberOfMacro
392
393#ifndef ITK_MANUAL_INSTANTIATION
394#include "itkMultiInputImageToImageMetricBase.hxx"
395#endif
396
397#endif // end #ifndef __itkMultiInputImageToImageMetricBase_h
An extension of the ITK ImageToImageMetric. It is the intended base class for all elastix metrics.
BSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double > BSplineInterpolatorType
Superclass::FixedImageConstPointer FixedImageConstPointer
Superclass::TransformParametersType TransformParametersType
Superclass::MovingImageConstPointer MovingImageConstPointer
Superclass::FixedImageMaskPointer FixedImageMaskPointer
InterpolatorType::ContinuousIndexType MovingImageContinuousIndexType
Superclass::GradientImageFilterPointer GradientImageFilterPointer
Superclass::GradientImageFilterType GradientImageFilterType
Superclass::TransformJacobianType TransformJacobianType
Superclass::GradientImagePointer GradientImagePointer
Superclass::TransformPointer TransformPointer
Superclass::CoordinateRepresentationType CoordinateRepresentationType
Superclass::InterpolatorPointer InterpolatorPointer
Superclass::MovingImageMaskPointer MovingImageMaskPointer
Superclass::MovingImageMaskType MovingImageMaskType
Superclass::GradientPixelType GradientPixelType
MovingImageType::IndexType MovingImageIndexType
Superclass::MovingImagePixelType MovingImagePixelType
BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
Superclass::FixedImageMaskType FixedImageMaskType
Superclass::GradientImageType GradientImageType
Superclass::InterpolatorType InterpolatorType
TransformType::OutputPointType MovingImagePointType
Superclass::FixedImageRegionType FixedImageRegionType
Implements a metric base class that takes multiple inputs.
BSplineInterpolatorType::Pointer BSplineInterpolatorPointer
FixedImageInterpolatorVectorType m_FixedImageInterpolatorVector
Superclass::MovingImageDerivativeType MovingImageDerivativeType
Superclass::TransformParametersType TransformParametersType
Superclass::MovingImageContinuousIndexType MovingImageContinuousIndexType
void SetFixedImageMask(FixedImageMaskType *_arg) override
virtual void SetFixedImageRegion(const FixedImageRegionType _arg, unsigned int pos)
FixedImageInterpolatorType::Pointer FixedImageInterpolatorPointer
virtual void CheckForBSplineInterpolators(void)
std::vector< MovingImageConstPointer > MovingImageVectorType
void SetMovingImage(const MovingImageType *_arg) override
virtual MovingImageMaskType * GetMovingImageMask(unsigned int pos) const
virtual const FixedImageRegionType & GetFixedImageRegion(unsigned int pos) const
std::vector< MovingImageMaskPointer > MovingImageMaskVectorType
virtual void SetFixedImageMask(FixedImageMaskType *_arg, unsigned int pos)
void SetMovingImageMask(MovingImageMaskType *_arg) override
virtual InterpolatorType * GetInterpolator(unsigned int pos) const
Superclass::FixedImageConstPointer FixedImageConstPointer
const FixedImageRegionType & GetFixedImageRegion(void) const override
bool EvaluateMovingImageValueAndDerivative(const MovingImagePointType &mappedPoint, RealType &movingImageValue, MovingImageDerivativeType *gradient) const override
void SetInterpolator(InterpolatorType *_arg) override
virtual const MovingImageType * GetMovingImage(unsigned int pos) const
FixedImageMaskType * GetFixedImageMask(void) const override
virtual const FixedImageType * GetFixedImage(unsigned int pos) const
const FixedImageType * GetFixedImage(void) const override
const MovingImageType * GetMovingImage(void) const override
void SetFixedImage(const FixedImageType *_arg) override
virtual void SetFixedImageInterpolator(FixedImageInterpolatorType *_arg, unsigned int pos)
virtual void SetMovingImage(const MovingImageType *_arg, unsigned int pos)
InterpolatorType * GetInterpolator(void) const override
Superclass::GradientImageFilterType GradientImageFilterType
Superclass::CoordinateRepresentationType CoordinateRepresentationType
virtual FixedImageInterpolatorType * GetFixedImageInterpolator(void) const
Superclass::FixedImageMaskPointer FixedImageMaskPointer
virtual FixedImageInterpolatorType * GetFixedImageInterpolator(unsigned int pos) const
std::vector< FixedImageRegionType > FixedImageRegionVectorType
itkStaticConstMacro(MovingImageDimension, unsigned int, TMovingImage::ImageDimension)
std::vector< BSplineInterpolatorPointer > BSplineInterpolatorVectorType
std::vector< FixedImageConstPointer > FixedImageVectorType
Superclass::BSplineInterpolatorType BSplineInterpolatorType
void SetFixedImageRegion(const FixedImageRegionType _arg) override
itkSetNumberOfMacro(FixedImageInterpolator)
Superclass::MovingImageConstPointer MovingImageConstPointer
Superclass::GradientImageFilterPointer GradientImageFilterPointer
Superclass::TransformJacobianType TransformJacobianType
AdvancedImageToImageMetric< TFixedImage, TMovingImage > Superclass
virtual FixedImageMaskType * GetFixedImageMask(unsigned int pos) const
itkStaticConstMacro(FixedImageDimension, unsigned int, TFixedImage::ImageDimension)
bool IsInsideMovingMask(const MovingImagePointType &mappedPoint) const override
std::vector< FixedImageMaskPointer > FixedImageMaskVectorType
virtual void SetInterpolator(InterpolatorType *_arg, unsigned int pos)
Superclass::MovingImageMaskPointer MovingImageMaskPointer
void InitializeImageSampler(void) override
virtual void SetFixedImageInterpolator(FixedImageInterpolatorType *_arg)
virtual void SetMovingImageMask(MovingImageMaskType *_arg, unsigned int pos)
InterpolateImageFunction< FixedImageType, CoordinateRepresentationType > FixedImageInterpolatorType
std::vector< FixedImageInterpolatorPointer > FixedImageInterpolatorVectorType
virtual void SetFixedImage(const FixedImageType *_arg, unsigned int pos)
std::vector< InterpolatorPointer > InterpolatorVectorType
MovingImageMaskType * GetMovingImageMask(void) const override


Generated on 1667476801 for elastix by doxygen 1.9.4 elastix logo