ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkVariationalRegistrationFilter.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 __itkVariationalRegistrationFilter_h
19 #define __itkVariationalRegistrationFilter_h
20 
22 #include "itkMultiThreader.h"
23 
28 
29 namespace itk {
30 
101 template< class TFixedImage, class TMovingImage, class TDisplacementField >
103  : public DenseFiniteDifferenceImageFilter< TDisplacementField, TDisplacementField >
104 {
105 public:
109  TDisplacementField, TDisplacementField > Superclass;
112 
114  itkNewMacro(Self);
115 
117  itkTypeMacro(itkVariationalRegistrationFilter, DenseFiniteDifferenceImageFilter );
118 
120  itkStaticConstMacro(ImageDimension, unsigned int,Superclass::ImageDimension);
121 
123  typedef TFixedImage FixedImageType;
124  typedef typename FixedImageType::Pointer FixedImagePointer;
125  typedef typename FixedImageType::ConstPointer FixedImageConstPointer;
126 
128  typedef TMovingImage MovingImageType;
129  typedef typename MovingImageType::Pointer MovingImagePointer;
130  typedef typename MovingImageType::ConstPointer MovingImageConstPointer;
131 
133  typedef TDisplacementField DisplacementFieldType;
134  typedef typename DisplacementFieldType::Pointer DisplacementFieldPointer;
135 
137  typedef unsigned char MaskImagePixelType;
142 
144  typedef typename Superclass::OutputImageType OutputImageType;
145 
147  typedef typename Superclass::TimeStepType TimeStepType;
148 
154 
161 
163  itkSetObjectMacro( Regularizer, RegularizerType );
164 
166  itkGetConstReferenceObjectMacro( Regularizer, RegularizerType );
167 
169  virtual void SetFixedImage( const FixedImageType * ptr );
170 
172  virtual const FixedImageType * GetFixedImage(void) const;
173 
175  virtual void SetMovingImage( const MovingImageType * ptr );
176 
178  virtual const MovingImageType * GetMovingImage(void) const;
179 
181  virtual void SetMaskImage( const MaskImageType * ptr );
182 
184  virtual const MaskImageType * GetMaskImage(void) const;
185 
188  { this->SetInput( ptr ); }
189 
192  { return this->GetOutput(); }
193 
198  virtual std::vector<SmartPointer<DataObject> >::size_type GetNumberOfValidRequiredInputs() const;
199 
204  itkBooleanMacro( SmoothDisplacementField );
205 
210  itkSetMacro( SmoothDisplacementField, bool );
211 
215  itkGetConstMacro( SmoothDisplacementField, bool );
216 
220  itkSetMacro( SmoothUpdateField, bool );
221 
226  itkGetConstMacro( SmoothUpdateField, bool );
227 
231  itkBooleanMacro( SmoothUpdateField );
232 
237  virtual double GetMetric() const;
238 
240  virtual void StopRegistration()
241  { m_StopRegistrationFlag = true; }
242 
243 protected:
246 
248  virtual void PrintSelf(std::ostream& os, Indent indent) const;
249 
256  virtual void GenerateInputRequestedRegion();
257 
262  virtual void GenerateOutputInformation();
263 
266  virtual void CopyInputToOutput();
267 
269  virtual void Initialize();
270 
273  virtual void InitializeIteration();
274 
276  virtual void ApplyUpdate( const TimeStepType& dt );
277 
283  virtual void VerifyInputInformation() {}
284 
287  virtual bool Halt()
288  { return (Superclass::Halt() || m_StopRegistrationFlag); }
289 
293  RegistrationFunctionType * DownCastDifferenceFunctionType();
294  const RegistrationFunctionType * DownCastDifferenceFunctionType() const;
296 
297 private:
298  VariationalRegistrationFilter(const Self&); //purposely not implemented
299  void operator=(const Self&); //purposely not implemented
300 
303 
306 
310 
311 };
312 
313 }// end namespace itk
314 
315 #ifndef ITK_MANUAL_INSTANTIATION
316 # include "itkVariationalRegistrationFilter.hxx"
317 #endif
318 
319 #endif
Base class for force calculation in the variational registration framework.
Light weight base class for most itk classes.
Flexible framework for deformable registration of two images using PDE-based variational registration...
DisplacementFieldType::Pointer DisplacementFieldPointer
Base class for regularization component in the variational registration framework.
VariationalRegistrationDemonsFunction< FixedImageType, MovingImageType, DisplacementFieldType > DefaultRegistrationFunctionType
virtual DisplacementFieldType * GetDisplacementField()
Image< MaskImagePixelType, ImageDimension > MaskImageType
VariationalRegistrationFunction< FixedImageType, MovingImageType, DisplacementFieldType > RegistrationFunctionType
DenseFiniteDifferenceImageFilter< TDisplacementField, TDisplacementField > Superclass
virtual void SetInitialDisplacementField(DisplacementFieldType *ptr)
MovingImageType::ConstPointer MovingImageConstPointer
Control indentation during Print() invocation.
Definition: itkIndent.h:49
This class performs diffusive regularization of a vector field.
VariationalRegistrationRegularizer< DisplacementFieldType > RegularizerType
This class computes different Demon forces in the variational registration framework.
Templated n-dimensional image class.
Definition: itkImage.h:75
VariationalRegistrationDiffusionRegularizer< DisplacementFieldType > DefaultRegularizerType