ITK  4.3.0
Insight Segmentation and Registration Toolkit
itkMultiResolutionPDEDeformableRegistration.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 __itkMultiResolutionPDEDeformableRegistration_h
19 #define __itkMultiResolutionPDEDeformableRegistration_h
20 
21 #include "itkImage.h"
25 #include "itkArray.h"
26 
27 namespace itk
28 {
80 template< class TFixedImage, class TMovingImage, class TDisplacementField, class TRealType = float >
82  public ImageToImageFilter< TDisplacementField, TDisplacementField >
83 {
84 public:
85 
92 
94  itkNewMacro(Self);
95 
99 
101  typedef TFixedImage FixedImageType;
102  typedef typename FixedImageType::Pointer FixedImagePointer;
103  typedef typename FixedImageType::ConstPointer FixedImageConstPointer;
104 
106  typedef TMovingImage MovingImageType;
107  typedef typename MovingImageType::Pointer MovingImagePointer;
108  typedef typename MovingImageType::ConstPointer MovingImageConstPointer;
109 
111  typedef TDisplacementField DisplacementFieldType;
112  typedef typename DisplacementFieldType::Pointer DisplacementFieldPointer;
113 #ifdef ITKV3_COMPATIBILITY
114  typedef TDisplacementField DeformationFieldType;
115  typedef typename DeformationFieldType::Pointer DeformationFieldPointer;
116 #endif
117 
119  itkStaticConstMacro(ImageDimension, unsigned int, FixedImageType::ImageDimension);
120 
123 
127 
130 
134 
138 
142 
144 
146  virtual void SetFixedImage(const FixedImageType *ptr);
147 
149  const FixedImageType * GetFixedImage(void) const;
150 
152  virtual void SetMovingImage(const MovingImageType *ptr);
153 
155  const MovingImageType * GetMovingImage(void) const;
156 
159  virtual void SetInitialDisplacementField(DisplacementFieldType *ptr)
160  {
161  this->m_InitialDisplacementField = ptr;
162  }
163 
167  virtual void SetArbitraryInitialDisplacementField(DisplacementFieldType *ptr)
168  {
169  this->SetInput(ptr);
170  }
171 
173  const DisplacementFieldType * GetDisplacementField(void)
174  { return this->GetOutput(); }
175 
176 #ifdef ITKV3_COMPATIBILITY
177  virtual void SetInitialDeformationField(DisplacementFieldType *ptr)
178  {
179  this->SetInitialDisplacementField(ptr);
180  }
181 
182  virtual void SetArbitraryInitialDeformationField(DisplacementFieldType *ptr)
183  {
184  this->SetArbitraryInitialDisplacementField(ptr);
185  }
186 
188  const DeformationFieldType * GetDeformationField(void)
189  {
190  return itkDynamicCastInDebugMode<DeformationFieldType *> (this->GetDisplacementField());
191  }
192 #endif
193 
200  virtual std::vector< SmartPointer< DataObject > >::size_type GetNumberOfValidRequiredInputs() const;
201 
203  itkSetObjectMacro(RegistrationFilter, RegistrationType);
204 
206  itkGetObjectMacro(RegistrationFilter, RegistrationType);
207 
209  itkSetObjectMacro(FixedImagePyramid, FixedImagePyramidType);
210 
212  itkGetObjectMacro(FixedImagePyramid, FixedImagePyramidType);
213 
215  itkSetObjectMacro(MovingImagePyramid, MovingImagePyramidType);
216 
218  itkGetObjectMacro(MovingImagePyramid, MovingImagePyramidType);
219 
221  virtual void SetNumberOfLevels(unsigned int num);
222 
224  itkGetConstReferenceMacro(NumberOfLevels, unsigned int);
225 
227  itkGetConstReferenceMacro(CurrentLevel, unsigned int);
228 
230  itkSetObjectMacro(FieldExpander, FieldExpanderType);
231 
233  itkGetObjectMacro(FieldExpander, FieldExpanderType);
234 
236  itkSetMacro(NumberOfIterations, NumberOfIterationsType);
237  itkSetVectorMacro(NumberOfIterations, unsigned int, m_NumberOfLevels);
239 
241  itkGetConstReferenceMacro(NumberOfIterations, NumberOfIterationsType);
242 
244  virtual void StopRegistration();
245 
246 protected:
247  MultiResolutionPDEDeformableRegistration();
248  // ~MultiResolutionPDEDeformableRegistration() {} default implementation ok
249 
250  void PrintSelf(std::ostream & os, Indent indent) const;
251 
254  virtual void GenerateData();
255 
259  virtual void GenerateInputRequestedRegion();
260 
267  virtual void GenerateOutputInformation();
268 
272  virtual void EnlargeOutputRequestedRegion(DataObject *ptr);
273 
276  virtual bool Halt();
277 
283  virtual void VerifyInputInformation() {}
284 
285 private:
286  MultiResolutionPDEDeformableRegistration(const Self &); //purposely not
287  // implemented
288  void operator=(const Self &); //purposely not
289 
290  // implemented
291 
297 
298  unsigned int m_NumberOfLevels;
299  unsigned int m_CurrentLevel;
301 
304 };
305 } // end namespace itk
306 
307 #ifndef ITK_MANUAL_INSTANTIATION
308 #include "itkMultiResolutionPDEDeformableRegistration.hxx"
309 #endif
310 
311 #endif
312