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  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 #ifndef __itkMultiInputImageToImageMetricBase_h
15 #define __itkMultiInputImageToImageMetricBase_h
16 
18 #include <vector>
19 
21 #define itkSetNumberOfMacro( name ) \
22  virtual void SetNumberOf##name##s( const unsigned int _arg ) \
23  { \
24  if( this->m_NumberOf##name##s != _arg ) \
25  { \
26  this->m_##name##Vector.resize( _arg ); \
27  this->m_NumberOf##name##s = _arg; \
28  this->Modified(); \
29  } \
30  } // comments for allowing ; after calling the macro
31 
32 namespace itk
33 {
34 
44 template< class TFixedImage, class TMovingImage >
46  public AdvancedImageToImageMetric< TFixedImage, TMovingImage >
47 {
48 public:
49 
53  typedef SmartPointer< Self > Pointer;
54  typedef SmartPointer< const Self > ConstPointer;
55 
58 
60  itkStaticConstMacro( MovingImageDimension, unsigned int, TMovingImage::ImageDimension );
61  itkStaticConstMacro( FixedImageDimension, unsigned int, TFixedImage::ImageDimension );
62 
81  typedef typename Superclass::RealType RealType;
94 
95  typedef InterpolateImageFunction<
97  typedef typename FixedImageInterpolatorType::Pointer FixedImageInterpolatorPointer;
98 
100  typedef std::vector< FixedImageConstPointer > FixedImageVectorType;
101  typedef std::vector< FixedImageMaskPointer > FixedImageMaskVectorType;
102  typedef std::vector< FixedImageRegionType > FixedImageRegionVectorType;
103  typedef std::vector< MovingImageConstPointer > MovingImageVectorType;
104  typedef std::vector< MovingImageMaskPointer > MovingImageMaskVectorType;
105  typedef std::vector< InterpolatorPointer > InterpolatorVectorType;
106  typedef std::vector< FixedImageInterpolatorPointer > FixedImageInterpolatorVectorType;
107 
111  virtual void SetFixedImage( const FixedImageType * _arg, unsigned int pos );
112 
114  virtual void SetFixedImage( const FixedImageType * _arg )
115  {
116  this->SetFixedImage( _arg, 0 );
117  }
118 
119 
121  virtual const FixedImageType * GetFixedImage( unsigned int pos ) const;
122 
124  virtual const FixedImageType * GetFixedImage( void ) const
125  {
126  return this->GetFixedImage( 0 );
127  }
128 
129 
131  itkSetNumberOfMacro( FixedImage );
132 
134  itkGetConstMacro( NumberOfFixedImages, unsigned int );
135 
139  virtual void SetFixedImageMask( FixedImageMaskType * _arg, unsigned int pos );
140 
142  virtual void SetFixedImageMask( FixedImageMaskType * _arg )
143  {
144  this->SetFixedImageMask( _arg, 0 );
145  }
146 
147 
149  virtual FixedImageMaskType * GetFixedImageMask( unsigned int pos ) const;
150 
152  virtual FixedImageMaskType * GetFixedImageMask( void ) const
153  {
154  return this->GetFixedImageMask( 0 );
155  }
156 
157 
159  itkSetNumberOfMacro( FixedImageMask );
160 
162  itkGetConstMacro( NumberOfFixedImageMasks, unsigned int );
163 
167  virtual void SetFixedImageRegion( const FixedImageRegionType _arg, unsigned int pos );
168 
170  virtual void SetFixedImageRegion( const FixedImageRegionType _arg )
171  {
172  this->SetFixedImageRegion( _arg, 0 );
173  }
174 
175 
177  virtual const FixedImageRegionType & GetFixedImageRegion( unsigned int pos ) const;
178 
180  virtual const FixedImageRegionType & GetFixedImageRegion( void ) const
181  {
182  return this->GetFixedImageRegion( 0 );
183  }
184 
185 
187  itkSetNumberOfMacro( FixedImageRegion );
188 
190  itkGetConstMacro( NumberOfFixedImageRegions, unsigned int );
191 
195  virtual void SetMovingImage( const MovingImageType * _arg, unsigned int pos );
196 
198  virtual void SetMovingImage( const MovingImageType * _arg )
199  {
200  this->SetMovingImage( _arg, 0 );
201  }
202 
203 
205  virtual const MovingImageType * GetMovingImage( unsigned int pos ) const;
206 
208  virtual const MovingImageType * GetMovingImage( void ) const
209  {
210  return this->GetMovingImage( 0 );
211  }
212 
213 
215  itkSetNumberOfMacro( MovingImage );
216 
218  itkGetConstMacro( NumberOfMovingImages, unsigned int );
219 
223  virtual void SetMovingImageMask( MovingImageMaskType * _arg, unsigned int pos );
224 
227  {
228  this->SetMovingImageMask( _arg, 0 );
229  }
230 
231 
233  virtual MovingImageMaskType * GetMovingImageMask( unsigned int pos ) const;
234 
236  virtual MovingImageMaskType * GetMovingImageMask( void ) const
237  {
238  return this->GetMovingImageMask( 0 );
239  }
240 
241 
243  itkSetNumberOfMacro( MovingImageMask );
244 
246  itkGetConstMacro( NumberOfMovingImageMasks, unsigned int );
247 
253  virtual void SetInterpolator( InterpolatorType * _arg, unsigned int pos );
254 
256  virtual void SetInterpolator( InterpolatorType * _arg )
257  {
258  return this->SetInterpolator( _arg, 0 );
259  }
260 
261 
263  virtual InterpolatorType * GetInterpolator( unsigned int pos ) const;
264 
266  virtual InterpolatorType * GetInterpolator( void ) const
267  {
268  return this->GetInterpolator( 0 );
269  }
270 
271 
273  itkSetNumberOfMacro( Interpolator );
274 
276  itkGetConstMacro( NumberOfInterpolators, unsigned int );
277 
279  itkGetConstMacro( InterpolatorsAreBSpline, bool );
280 
286  virtual void SetFixedImageInterpolator( FixedImageInterpolatorType * _arg, unsigned int pos );
287 
290  {
291  return this->SetFixedImageInterpolator( _arg, 0 );
292  }
293 
294 
296  virtual FixedImageInterpolatorType * GetFixedImageInterpolator( unsigned int pos ) const;
297 
300  {
301  return this->GetFixedImageInterpolator( 0 );
302  }
303 
304 
306  itkSetNumberOfMacro( FixedImageInterpolator );
307 
309  itkGetConstMacro( NumberOfFixedImageInterpolators, unsigned int );
310 
314  virtual void Initialize( void ) throw ( ExceptionObject );
315 
316 protected:
317 
320 
322  virtual ~MultiInputImageToImageMetricBase() {}
323 
329 
332  typedef typename BSplineInterpolatorType::Pointer BSplineInterpolatorPointer;
333  typedef std::vector< BSplineInterpolatorPointer > BSplineInterpolatorVectorType;
334 
336  virtual void InitializeImageSampler( void ) throw ( ExceptionObject );
337 
341  virtual void CheckForBSplineInterpolators( void );
342 
347  const MovingImagePointType & mappedPoint,
348  RealType & movingImageValue,
349  MovingImageDerivativeType * gradient ) const;
350 
352  virtual bool IsInsideMovingMask(
353  const MovingImagePointType & mappedPoint ) const;
354 
363 
366 
367 private:
368 
369  MultiInputImageToImageMetricBase( const Self & ); // purposely not implemented
370  void operator=( const Self & ); // purposely not implemented
371 
374 
375  unsigned int m_NumberOfFixedImages;
382 
383 };
384 
385 } // end namespace itk
386 
387 #undef itkSetNumberOfMacro
388 
389 #ifndef ITK_MANUAL_INSTANTIATION
390 #include "itkMultiInputImageToImageMetricBase.hxx"
391 #endif
392 
393 #endif // end #ifndef __itkMultiInputImageToImageMetricBase_h
Superclass::FixedImageConstPointer FixedImageConstPointer
virtual void SetFixedImageInterpolator(FixedImageInterpolatorType *_arg)
virtual void SetMovingImageMask(MovingImageMaskType *_arg)
virtual void SetFixedImageRegion(const FixedImageRegionType _arg, unsigned int pos)
Superclass::CoordinateRepresentationType CoordinateRepresentationType
std::vector< InterpolatorPointer > InterpolatorVectorType
Superclass::TransformParametersType TransformParametersType
Superclass::MovingImageType MovingImageType
Superclass::MovingImageContinuousIndexType MovingImageContinuousIndexType
Superclass::MovingImageConstPointer MovingImageConstPointer
Superclass::FixedImageMaskPointer FixedImageMaskPointer
An extension of the ITK ImageToImageMetric. It is the intended base class for all elastix metrics...
virtual FixedImageMaskType * GetFixedImageMask(void) const
virtual void SetFixedImageInterpolator(FixedImageInterpolatorType *_arg, unsigned int pos)
Superclass::GradientPixelType GradientPixelType
Superclass::FixedImageRegionType FixedImageRegionType
Implements a metric base class that takes multiple inputs.
std::vector< FixedImageConstPointer > FixedImageVectorType
Superclass::TransformJacobianType TransformJacobianType
virtual const FixedImageType * GetFixedImage(void) const
MovingImageType::IndexType MovingImageIndexType
virtual void SetInterpolator(InterpolatorType *_arg, unsigned int pos)
BSplineInterpolatorType::Pointer BSplineInterpolatorPointer
InterpolatorType::ContinuousIndexType MovingImageContinuousIndexType
Superclass::MovingImageMaskPointer MovingImageMaskPointer
virtual InterpolatorType * GetInterpolator(void) const
FixedImageInterpolatorType::Pointer FixedImageInterpolatorPointer
virtual void SetFixedImageMask(FixedImageMaskType *_arg, unsigned int pos)
BSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double > BSplineInterpolatorType
Superclass::BSplineInterpolatorType BSplineInterpolatorType
Superclass::InterpolatorPointer InterpolatorPointer
Superclass::CoordinateRepresentationType CoordinateRepresentationType
virtual void SetFixedImage(const FixedImageType *_arg, unsigned int pos)
virtual bool EvaluateMovingImageValueAndDerivative(const MovingImagePointType &mappedPoint, RealType &movingImageValue, MovingImageDerivativeType *gradient) const
TransformType::OutputPointType MovingImagePointType
InterpolateImageFunction< FixedImageType, CoordinateRepresentationType > FixedImageInterpolatorType
AdvancedImageToImageMetric< TFixedImage, TMovingImage > Superclass
Superclass::MovingImageMaskType MovingImageMaskType
virtual void SetMovingImage(const MovingImageType *_arg, unsigned int pos)
virtual void SetInterpolator(InterpolatorType *_arg)
virtual bool IsInsideMovingMask(const MovingImagePointType &mappedPoint) const
virtual FixedImageInterpolatorType * GetFixedImageInterpolator(void) const
Superclass::GradientImageType GradientImageType
Superclass::TransformPointer TransformPointer
Superclass::GradientImageFilterType GradientImageFilterType
virtual void SetMovingImage(const MovingImageType *_arg)
virtual void InitializeImageSampler(void)
itkStaticConstMacro(MovingImageDimension, unsigned int, TMovingImage::ImageDimension)
virtual void SetFixedImageMask(FixedImageMaskType *_arg)
std::vector< FixedImageRegionType > FixedImageRegionVectorType
Superclass::MovingImageDerivativeType MovingImageDerivativeType
std::vector< FixedImageInterpolatorPointer > FixedImageInterpolatorVectorType
Superclass::FixedImageMaskPointer FixedImageMaskPointer
Superclass::GradientImageFilterType GradientImageFilterType
std::vector< MovingImageConstPointer > MovingImageVectorType
Superclass::InterpolatorType InterpolatorType
Superclass::TransformJacobianType TransformJacobianType
virtual const FixedImageRegionType & GetFixedImageRegion(void) const
virtual const MovingImageType * GetMovingImage(void) const
std::vector< BSplineInterpolatorPointer > BSplineInterpolatorVectorType
Superclass::MovingImagePixelType MovingImagePixelType
virtual void CheckForBSplineInterpolators(void)
Superclass::TransformParametersType TransformParametersType
std::vector< MovingImageMaskPointer > MovingImageMaskVectorType
FixedImageInterpolatorVectorType m_FixedImageInterpolatorVector
virtual void SetFixedImageRegion(const FixedImageRegionType _arg)
Superclass::MovingImageMaskPointer MovingImageMaskPointer
std::vector< FixedImageMaskPointer > FixedImageMaskVectorType
virtual void SetMovingImageMask(MovingImageMaskType *_arg, unsigned int pos)
Superclass::FixedImageMaskType FixedImageMaskType
virtual void SetFixedImage(const FixedImageType *_arg)
virtual MovingImageMaskType * GetMovingImageMask(void) const
BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
Superclass::FixedImageConstPointer FixedImageConstPointer
Superclass::GradientImageFilterPointer GradientImageFilterPointer
Superclass::MovingImageConstPointer MovingImageConstPointer
Superclass::GradientImageFilterPointer GradientImageFilterPointer
Superclass::GradientImagePointer GradientImagePointer


Generated on 11-03-2014 for elastix by doxygen 1.8.6 elastix logo