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  * 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 __itkMultiMetricMultiResolutionImageRegistrationMethod_h
19 #define __itkMultiMetricMultiResolutionImageRegistrationMethod_h
20 
23 #include <vector>
24 
27 #define itkSimpleSetMacro( _name, _type ) \
28  virtual void Set##_name( _type _arg ) \
29  { \
30  this->Set##_name( _arg, 0 ); \
31  }
32 
34 #define itkSetNumberOfMacro( _name ) \
35  virtual void SetNumberOf##_name##s( unsigned int _arg ) \
36  { \
37  if( this->m_##_name##s.size() != _arg ) \
38  { \
39  this->m_##_name##s.resize( _arg ); \
40  this->Modified(); \
41  } \
42  }
43 
45 #define itkGetNumberOfMacro( _name ) \
46  virtual unsigned int GetNumberOf##_name##s( void ) const \
47  { \
48  return this->m_##_name##s.size(); \
49  }
50 
51 namespace itk
52 {
53 
82 template< typename TFixedImage, typename TMovingImage >
84  public MultiResolutionImageRegistrationMethod2< TFixedImage, TMovingImage >
85 {
86 public:
87 
91  TFixedImage, TMovingImage > Superclass;
93  typedef SmartPointer< const Self > ConstPointer;
94 
96  itkNewMacro( Self );
97 
101 
108 
116  typedef typename OptimizerType::Pointer OptimizerPointer;
120  typedef typename
122 
125  typedef typename
127 
130 
135 
140  virtual void StopMultiMetricRegistration( void )
141  {
142  this->m_Stop = true;
143  }
144 
145 
152  virtual void SetMetric( MetricType * _arg );
153 
158  virtual CombinationMetricType * GetCombinationMetric( void ) const
159  {
160  return this->m_CombinationMetric.GetPointer();
161  }
162 
163 
172  virtual void SetFixedImage( const FixedImageType * _arg, unsigned int pos );
173 
174  virtual const FixedImageType * GetFixedImage( unsigned int pos ) const;
175 
176  virtual const FixedImageType * GetFixedImage( void ) const
177  {
178  return this->GetFixedImage( 0 );
179  }
180 
181 
182  itkSimpleSetMacro( FixedImage, const FixedImageType * );
183  itkSetNumberOfMacro( FixedImage );
184  itkGetNumberOfMacro( FixedImage );
185 
187  virtual void SetMovingImage( const MovingImageType * _arg, unsigned int pos );
188 
189  virtual const MovingImageType * GetMovingImage( unsigned int pos ) const;
190 
191  virtual const MovingImageType * GetMovingImage( void ) const
192  { return this->GetMovingImage( 0 ); }
193  itkSimpleSetMacro( MovingImage, const MovingImageType * );
194  itkSetNumberOfMacro( MovingImage );
195  itkGetNumberOfMacro( MovingImage );
196 
198  virtual void SetFixedImageRegion( FixedImageRegionType _arg, unsigned int pos );
199 
200  virtual const FixedImageRegionType & GetFixedImageRegion( unsigned int pos ) const;
201 
202  virtual const FixedImageRegionType & GetFixedImageRegion( void ) const
203  { return this->GetFixedImageRegion( 0 ); }
204  itkSimpleSetMacro( FixedImageRegion, const FixedImageRegionType );
205  itkSetNumberOfMacro( FixedImageRegion );
206  itkGetNumberOfMacro( FixedImageRegion );
207 
209  virtual void SetInterpolator( InterpolatorType * _arg, unsigned int pos );
210 
211  virtual InterpolatorType * GetInterpolator( unsigned int pos ) const;
212 
213  virtual InterpolatorType * GetInterpolator( void )
214  { return this->GetInterpolator( 0 ); }
215  itkSimpleSetMacro( Interpolator, InterpolatorType * );
216  itkSetNumberOfMacro( Interpolator );
217  itkGetNumberOfMacro( Interpolator );
218 
220  virtual void SetFixedImagePyramid( FixedImagePyramidType * _arg, unsigned int pos );
221 
222  virtual FixedImagePyramidType * GetFixedImagePyramid( unsigned int pos ) const;
223 
224  virtual FixedImagePyramidType * GetFixedImagePyramid( void )
225  { return this->GetFixedImagePyramid( 0 ); }
226  itkSimpleSetMacro( FixedImagePyramid, FixedImagePyramidType * );
227  itkSetNumberOfMacro( FixedImagePyramid );
228  itkGetNumberOfMacro( FixedImagePyramid );
229 
231  virtual void SetMovingImagePyramid( MovingImagePyramidType * _arg, unsigned int pos );
232 
233  virtual MovingImagePyramidType * GetMovingImagePyramid( unsigned int pos ) const;
234 
235  virtual MovingImagePyramidType * GetMovingImagePyramid( void )
236  { return this->GetMovingImagePyramid( 0 ); }
237  itkSimpleSetMacro( MovingImagePyramid, MovingImagePyramidType * );
238  itkSetNumberOfMacro( MovingImagePyramid );
239  itkGetNumberOfMacro( MovingImagePyramid );
240 
244  unsigned long GetMTime( void ) const;
245 
250  virtual const ParametersType & GetLastTransformParameters( void ) const
251  {
252  return this->m_LastTransformParameters;
253  }
254 
255 
256 protected:
257 
260  void PrintSelf( std::ostream & os, Indent indent ) const;
261 
262  typedef std::vector< FixedImageRegionType > FixedImageRegionPyramidType;
263 
267  virtual void GenerateData( void );
268 
273  virtual void Initialize( void ) throw ( ExceptionObject );
274 
279  virtual void PrepareAllPyramids( void );
280 
284  virtual void CheckPyramids( void ) throw ( ExceptionObject );
285 
289  virtual void CheckOnInitialize( void ) throw ( ExceptionObject );
290 
292  bool m_Stop;
294 
296  CombinationMetricPointer m_CombinationMetric;
297 
299  std::vector< FixedImageConstPointer > m_FixedImages;
300  std::vector< MovingImageConstPointer > m_MovingImages;
301  std::vector< FixedImageRegionType > m_FixedImageRegions;
302  std::vector< FixedImagePyramidPointer > m_FixedImagePyramids;
303  std::vector< MovingImagePyramidPointer > m_MovingImagePyramids;
304  std::vector< InterpolatorPointer > m_Interpolators;
305 
307  std::vector< FixedImageRegionPyramidType > m_FixedImageRegionPyramids;
308 
310  FixedImageRegionType m_NullFixedImageRegion;
311 
312 private:
313 
314  MultiMetricMultiResolutionImageRegistrationMethod( const Self & ); // purposely not implemented
315  void operator=( const Self & ); // purposely not implemented
316 
317 };
318 
319 } // end namespace itk
320 
321 #undef itkSetNumberOfMacro
322 #undef itkGetNumberOfMacro
323 #undef itkSimpleSetMacro
324 
325 #ifndef ITK_MANUAL_INSTANTIATION
326 #include "itkMultiMetricMultiResolutionImageRegistrationMethod.hxx"
327 #endif
328 
329 #endif
virtual void SetFixedImage(const FixedImageType *_arg, unsigned int pos)
Base class for multi-resolution image registration methods.
AdvancedImageToImageMetric< FixedImageType, MovingImageType > MetricType
virtual void SetInterpolator(InterpolatorType *_arg, unsigned int pos)
CombinationImageToImageMetric< FixedImageType, MovingImageType > CombinationMetricType
void PrintSelf(std::ostream &os, Indent indent) const
itkSimpleSetMacro(FixedImage, const FixedImageType *)
virtual void SetMovingImage(const MovingImageType *_arg, unsigned int pos)
MultiResolutionImageRegistrationMethod2< TFixedImage, TMovingImage > Superclass
MultiResolutionPyramidImageFilter< FixedImageType, FixedImageType > FixedImagePyramidType
virtual void SetFixedImagePyramid(FixedImagePyramidType *_arg, unsigned int pos)
MultiResolutionPyramidImageFilter< MovingImageType, MovingImageType > MovingImagePyramidType
virtual void SetMovingImagePyramid(MovingImagePyramidType *_arg, unsigned int pos)
virtual void SetFixedImageRegion(FixedImageRegionType _arg, unsigned int pos)


Generated on 04-09-2015 for elastix by doxygen 1.8.9.1 elastix logo