go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkMultiMetricMultiResolutionImageRegistrationMethod.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 
15 #ifndef __itkMultiMetricMultiResolutionImageRegistrationMethod_h
16 #define __itkMultiMetricMultiResolutionImageRegistrationMethod_h
17 
20 #include <vector>
21 
24 #define itkSimpleSetMacro(_name,_type) \
25  virtual void Set##_name( _type _arg ) \
26  { \
27  this->Set##_name ( _arg, 0 ); \
28  }
29 
31 #define itkSetNumberOfMacro(_name) \
32  virtual void SetNumberOf##_name##s(unsigned int _arg) \
33  { \
34  if ( this->m_##_name##s.size() != _arg ) \
35  { \
36  this->m_##_name##s.resize( _arg ); \
37  this->Modified(); \
38  } \
39  }
40 
42 #define itkGetNumberOfMacro(_name) \
43  virtual unsigned int GetNumberOf##_name##s(void) const \
44  { \
45  return this->m_##_name##s.size(); \
46  }
47 
48 
49 namespace itk
50 {
51 
80 template <typename TFixedImage, typename TMovingImage>
82  public MultiResolutionImageRegistrationMethod2<TFixedImage, TMovingImage>
83 {
84 public:
88  TFixedImage, TMovingImage> Superclass;
89  typedef SmartPointer<Self> Pointer;
90  typedef SmartPointer<const Self> ConstPointer;
91 
93  itkNewMacro( Self );
94 
98 
100  typedef typename Superclass::FixedImageType FixedImageType;
101  typedef typename Superclass::FixedImageConstPointer FixedImageConstPointer;
102  typedef typename Superclass::FixedImageRegionType FixedImageRegionType;
103  typedef typename Superclass::MovingImageType MovingImageType;
104  typedef typename Superclass::MovingImageConstPointer MovingImageConstPointer;
105 
106  typedef typename Superclass::MetricType MetricType;
107  typedef typename Superclass::MetricPointer MetricPointer;
108  typedef typename Superclass::TransformType TransformType;
109  typedef typename Superclass::TransformPointer TransformPointer;
110  typedef typename Superclass::InterpolatorType InterpolatorType;
111  typedef typename Superclass::InterpolatorPointer InterpolatorPointer;
112  typedef typename Superclass::OptimizerType OptimizerType;
113  typedef typename OptimizerType::Pointer OptimizerPointer;
114  typedef typename Superclass::FixedImagePyramidType FixedImagePyramidType;
115  typedef typename Superclass::FixedImagePyramidPointer FixedImagePyramidPointer;
116  typedef typename Superclass::MovingImagePyramidType MovingImagePyramidType;
117  typedef typename
118  Superclass::MovingImagePyramidPointer MovingImagePyramidPointer;
119 
120  typedef typename Superclass::TransformOutputType TransformOutputType;
121  typedef typename Superclass::TransformOutputPointer TransformOutputPointer;
122  typedef typename
123  Superclass::TransformOutputConstPointer TransformOutputConstPointer;
124 
125  typedef typename Superclass::ParametersType ParametersType;
126  typedef typename Superclass::DataObjectPointer DataObjectPointer;
127 
132 
137  virtual void StopMultiMetricRegistration( void )
138  {
139  this->m_Stop = true;
140  }
141 
148  virtual void SetMetric( MetricType * _arg );
149 
154  virtual CombinationMetricType * GetCombinationMetric( void ) const
155  {
156  return this->m_CombinationMetric.GetPointer();
157  }
158 
167  virtual void SetFixedImage( const FixedImageType * _arg, unsigned int pos );
168  virtual const FixedImageType * GetFixedImage( unsigned int pos ) const;
169  virtual const FixedImageType * GetFixedImage( void ) const
170  {
171  return this->GetFixedImage(0);
172  }
173  itkSimpleSetMacro( FixedImage, const FixedImageType * );
174  itkSetNumberOfMacro( FixedImage );
175  itkGetNumberOfMacro( FixedImage );
176 
178  virtual void SetMovingImage( const MovingImageType * _arg, unsigned int pos );
179  virtual const MovingImageType * GetMovingImage( unsigned int pos ) const;
180  virtual const MovingImageType * GetMovingImage( void ) const
181  { return this->GetMovingImage(0); }
182  itkSimpleSetMacro( MovingImage, const MovingImageType * );
183  itkSetNumberOfMacro( MovingImage );
184  itkGetNumberOfMacro( MovingImage );
185 
187  virtual void SetFixedImageRegion( FixedImageRegionType _arg, unsigned int pos );
188  virtual const FixedImageRegionType & GetFixedImageRegion( unsigned int pos ) const;
189  virtual const FixedImageRegionType & GetFixedImageRegion( void ) const
190  { return this->GetFixedImageRegion(0); }
191  itkSimpleSetMacro( FixedImageRegion, const FixedImageRegionType );
192  itkSetNumberOfMacro( FixedImageRegion );
193  itkGetNumberOfMacro( FixedImageRegion );
194 
196  virtual void SetInterpolator( InterpolatorType * _arg, unsigned int pos );
197  virtual InterpolatorType * GetInterpolator( unsigned int pos ) const;
198  virtual InterpolatorType * GetInterpolator( void )
199  { return this->GetInterpolator(0); }
200  itkSimpleSetMacro( Interpolator, InterpolatorType * );
201  itkSetNumberOfMacro( Interpolator );
202  itkGetNumberOfMacro( Interpolator );
203 
205  virtual void SetFixedImagePyramid( FixedImagePyramidType * _arg, unsigned int pos );
206  virtual FixedImagePyramidType * GetFixedImagePyramid( unsigned int pos ) const;
207  virtual FixedImagePyramidType * GetFixedImagePyramid( void )
208  { return this->GetFixedImagePyramid(0); }
209  itkSimpleSetMacro( FixedImagePyramid, FixedImagePyramidType * );
210  itkSetNumberOfMacro( FixedImagePyramid );
211  itkGetNumberOfMacro( FixedImagePyramid );
212 
214  virtual void SetMovingImagePyramid( MovingImagePyramidType * _arg, unsigned int pos );
215  virtual MovingImagePyramidType * GetMovingImagePyramid( unsigned int pos ) const;
216  virtual MovingImagePyramidType * GetMovingImagePyramid( void )
217  { return this->GetMovingImagePyramid(0); }
218  itkSimpleSetMacro( MovingImagePyramid, MovingImagePyramidType * );
219  itkSetNumberOfMacro( MovingImagePyramid );
220  itkGetNumberOfMacro( MovingImagePyramid );
221 
225  unsigned long GetMTime( void ) const;
226 
231  virtual const ParametersType & GetLastTransformParameters( void ) const
232  {
233  return this->m_LastTransformParameters;
234  }
235 
236 protected:
239  void PrintSelf( std::ostream& os, Indent indent ) const;
240 
241  typedef std::vector<FixedImageRegionType> FixedImageRegionPyramidType;
242 
246  virtual void GenerateData( void );
247 
252  virtual void Initialize( void ) throw (ExceptionObject);
253 
258  virtual void PrepareAllPyramids( void );
259 
263  virtual void CheckPyramids( void ) throw (ExceptionObject);
264 
268  virtual void CheckOnInitialize( void ) throw (ExceptionObject);
269 
271  bool m_Stop;
272  ParametersType m_LastTransformParameters;
273 
275  CombinationMetricPointer m_CombinationMetric;
276 
278  std::vector<FixedImageConstPointer> m_FixedImages;
279  std::vector<MovingImageConstPointer> m_MovingImages;
280  std::vector<FixedImageRegionType> m_FixedImageRegions;
281  std::vector<FixedImagePyramidPointer> m_FixedImagePyramids;
282  std::vector<MovingImagePyramidPointer> m_MovingImagePyramids;
283  std::vector<InterpolatorPointer> m_Interpolators;
284 
286  std::vector<FixedImageRegionPyramidType> m_FixedImageRegionPyramids;
287 
289  FixedImageRegionType m_NullFixedImageRegion;
290 
291 private:
292  MultiMetricMultiResolutionImageRegistrationMethod(const Self&); //purposely not implemented
293  void operator=(const Self&); //purposely not implemented
294 
295 }; // end class
296 
297 
298 } // end namespace itk
299 
300 #undef itkSetNumberOfMacro
301 #undef itkGetNumberOfMacro
302 #undef itkSimpleSetMacro
303 
304 #ifndef ITK_MANUAL_INSTANTIATION
305 #include "itkMultiMetricMultiResolutionImageRegistrationMethod.txx"
306 #endif
307 
308 #endif
309 


Generated on 21-03-2014 for elastix by doxygen 1.8.1.2 elastix logo