Orfeo Toolbox  3.16
itkImageToImageMetric.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkImageToImageMetric.h,v $
5  Language: C++
6  Date: $Date: 2009-08-20 09:08:41 $
7  Version: $Revision: 1.26 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 #ifndef __itkImageToImageMetric_h
18 #define __itkImageToImageMetric_h
19 
20 // First make sure that the configuration is available.
21 // This line can be removed once the optimized versions
22 // gets integrated into the main directories.
23 #include "itkConfigure.h"
24 
25 #ifdef ITK_USE_OPTIMIZED_REGISTRATION_METHODS
27 #else
28 
29 #include "itkImageBase.h"
30 #include "itkTransform.h"
33 #include "itkExceptionObject.h"
35 #include "itkSpatialObject.h"
36 
37 namespace itk
38 {
39 
59 template <class TFixedImage, class TMovingImage>
61 {
62 public:
68 
71 
74 
76  typedef TMovingImage MovingImageType;
77  typedef typename TMovingImage::PixelType MovingImagePixelType;
78  typedef typename MovingImageType::ConstPointer MovingImageConstPointer;
79 
81  typedef TFixedImage FixedImageType;
82  typedef typename FixedImageType::ConstPointer FixedImageConstPointer;
83  typedef typename FixedImageType::RegionType FixedImageRegionType;
84 
86  itkStaticConstMacro(MovingImageDimension,
87  unsigned int,
88  TMovingImage::ImageDimension);
89  itkStaticConstMacro(FixedImageDimension,
90  unsigned int,
91  TFixedImage::ImageDimension);
92 
95  itkGetStaticConstMacro(MovingImageDimension),
96  itkGetStaticConstMacro(FixedImageDimension)>
98 
104 
106  typedef InterpolateImageFunction<
109 
110 
114  typedef CovariantVector<RealType,
115  itkGetStaticConstMacro(MovingImageDimension)>
117  typedef Image<GradientPixelType,
118  itkGetStaticConstMacro(MovingImageDimension)>
125 
126 
128 
129 
136 
137 
144 
145 
148 
151 
154 
156  itkSetConstObjectMacro( FixedImage, FixedImageType );
157 
159  itkGetConstObjectMacro( FixedImage, FixedImageType );
160 
162  itkSetConstObjectMacro( MovingImage, MovingImageType );
163 
165  itkGetConstObjectMacro( MovingImage, MovingImageType );
166 
168  itkSetObjectMacro( Transform, TransformType );
169 
171  itkGetConstObjectMacro( Transform, TransformType );
172 
174  itkSetObjectMacro( Interpolator, InterpolatorType );
175 
177  itkGetConstObjectMacro( Interpolator, InterpolatorType );
178 
180  itkGetConstReferenceMacro( NumberOfPixelsCounted, unsigned long );
181 
183  itkSetMacro( FixedImageRegion, FixedImageRegionType );
184 
186  itkGetConstReferenceMacro( FixedImageRegion, FixedImageRegionType );
187 
189  itkSetObjectMacro( MovingImageMask, MovingImageMaskType );
190 #ifdef ITK_LEGACY_REMOVE
191  itkSetConstObjectMacro( MovingImageMask, MovingImageMaskType );
192 #else
193  virtual void SetMovingImageMask( const MovingImageMaskType* mask )
194  { this->SetMovingImageMask(const_cast<MovingImageMaskType*>(mask)); }
195 #endif
196  itkGetConstObjectMacro( MovingImageMask, MovingImageMaskType );
197 
199  itkSetObjectMacro( FixedImageMask, FixedImageMaskType );
200 #ifdef ITK_LEGACY_REMOVE
201  itkSetConstObjectMacro( FixedImageMask, FixedImageMaskType );
202 #else
203  virtual void SetFixedImageMask( const FixedImageMaskType* mask )
204  { this->SetFixedImageMask(const_cast<FixedImageMaskType*>(mask)); }
205 #endif
206  itkGetConstObjectMacro( FixedImageMask, FixedImageMaskType );
207 
209  itkSetMacro( ComputeGradient, bool);
210  itkGetConstReferenceMacro( ComputeGradient, bool);
211  itkBooleanMacro(ComputeGradient);
212 
214  virtual void ComputeGradient();
215 
217  itkGetConstObjectMacro( GradientImage, GradientImageType );
218 
220  void SetTransformParameters( const ParametersType & parameters ) const;
221 
223  unsigned int GetNumberOfParameters(void) const
224  { return m_Transform->GetNumberOfParameters(); }
225 
228  virtual void Initialize(void) throw ( ExceptionObject );
229 
230 protected:
232  virtual ~ImageToImageMetric();
233  void PrintSelf(std::ostream& os, Indent indent) const;
234 
235  mutable unsigned long m_NumberOfPixelsCounted;
236 
238  MovingImageConstPointer m_MovingImage;
239 
240  mutable TransformPointer m_Transform;
241  InterpolatorPointer m_Interpolator;
242 
243  bool m_ComputeGradient;
244  GradientImagePointer m_GradientImage;
245 
246 #ifdef ITK_LEGACY_REMOVE
247  FixedImageMaskConstPointer m_FixedImageMask;
248  MovingImageMaskConstPointer m_MovingImageMask;
249 #else
252 #endif
253 
254 private:
255  ImageToImageMetric(const Self&); //purposely not implemented
256  void operator=(const Self&); //purposely not implemented
257 
259 
260 };
261 
262 } // end namespace itk
263 
264 #ifndef ITK_MANUAL_INSTANTIATION
265 #include "itkImageToImageMetric.txx"
266 #endif
267 
268 #endif
269 
270 #endif

Generated at Sat May 18 2013 23:46:05 for Orfeo Toolbox with doxygen 1.8.3.1