ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkExponentialDeformationFieldImageFilter.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 itkExponentialDeformationFieldImageFilter_h
19 #define itkExponentialDeformationFieldImageFilter_h
20 
21 #include "itkDivideImageFilter.h"
22 #include "itkCastImageFilter.h"
25 #include "itkAddImageFilter.h"
26 
27 #ifndef ITKV3_COMPATIBILITY
28 #error "This file is only valid when ITKV3_COMPATIBILITY is turned on. Users are encouraged to convert to itk::ExponentialDisplacementFieldImageFilter in ITKv4"
29 #endif
30 
31 namespace itk
32 {
67 template< typename TInputImage, typename TOutputImage >
68 class ITK_TEMPLATE_EXPORT ExponentialDeformationFieldImageFilter:
69  public ImageToImageFilter< TInputImage, TOutputImage >
70 {
71 public:
77 
79  itkNewMacro(Self);
80 
83 
85  typedef TInputImage InputImageType;
86  typedef typename InputImageType::Pointer InputImagePointer;
87  typedef typename InputImageType::ConstPointer InputImageConstPointer;
88  typedef typename InputImageType::PixelType InputPixelType;
89  typedef typename InputPixelType::RealValueType InputPixelRealValueType;
90 
91  typedef TOutputImage OutputImageType;
92  typedef typename OutputImageType::Pointer OutputImagePointer;
93  typedef typename OutputImageType::PixelType OutputPixelType;
94 
96  itkSetMacro(MaximumNumberOfIterations, unsigned int);
97  itkGetConstMacro(MaximumNumberOfIterations, unsigned int);
99 
104  itkSetMacro(AutomaticNumberOfIterations, bool);
105  itkGetConstMacro(AutomaticNumberOfIterations, bool);
106  itkBooleanMacro(AutomaticNumberOfIterations);
108 
114  itkSetMacro(ComputeInverse, bool);
115  itkGetConstMacro(ComputeInverse, bool);
116  itkBooleanMacro(ComputeInverse);
118 
120  itkStaticConstMacro(ImageDimension, unsigned int,
121  TInputImage::ImageDimension);
122  itkStaticConstMacro(OutputImageDimension, unsigned int,
123  TInputImage::ImageDimension);
124  itkStaticConstMacro(PixelDimension, unsigned int,
126  itkStaticConstMacro(OutputPixelDimension, unsigned int,
129 
130 #ifdef ITK_USE_CONCEPT_CHECKING
131  // Begin concept checking
132  itkConceptMacro( OutputHasNumericTraitsCheck,
134  itkConceptMacro( SameDimensionCheck1,
136  itkConceptMacro( SameDimensionCheck2,
138  itkConceptMacro( SameDimensionCheck3,
140  // End concept checking
141 #endif
142 
143 protected:
146 
147  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
148 
152  void GenerateData() ITK_OVERRIDE;
153 
155 
156  typedef DivideImageFilter<
158  itk::Image<InputPixelRealValueType, ImageDimension>,
160 
161  typedef CastImageFilter<
162  InputImageType, OutputImageType > CasterType;
163 
164  typedef WarpVectorImageFilter<
166  OutputImageType, OutputImageType > VectorWarperType;
167 
169  OutputImageType, double > FieldInterpolatorType;
170 
171  typedef AddImageFilter<
172  OutputImageType, OutputImageType, OutputImageType > AdderType;
173 
174  typedef typename DivideByConstantType::Pointer DivideByConstantPointer;
175  typedef typename CasterType::Pointer CasterPointer;
176  typedef typename VectorWarperType::Pointer VectorWarperPointer;
177  typedef typename FieldInterpolatorType::Pointer FieldInterpolatorPointer;
178  typedef typename FieldInterpolatorType::OutputType FieldInterpolatorOutputType;
179  typedef typename AdderType::Pointer AdderPointer;
180 
181 private:
182  ITK_DISALLOW_COPY_AND_ASSIGN(ExponentialDeformationFieldImageFilter);
183 
184  bool m_AutomaticNumberOfIterations;
185  unsigned int m_MaximumNumberOfIterations;
186 
187  bool m_ComputeInverse;
188 
189  DivideByConstantPointer m_Divider;
190  CasterPointer m_Caster;
191  VectorWarperPointer m_Warper;
192  AdderPointer m_Adder;
193 };
194 } // end namespace itk
195 
196 #ifndef ITK_MANUAL_INSTANTIATION
197 #include "itkExponentialDeformationFieldImageFilter.hxx"
198 #endif
199 
200 #endif
Pixel-wise addition of two images.
Base class for all process objects that output image data.
ImageToImageFilter< TInputImage, TOutputImage > Superclass
Warps an image using an input displacement field.
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
TOutputImage OutputImageType
#define itkConceptMacro(name, concept)
Computes a diffeomorphic deformation field as the Lie group exponential of a vector field...
Templated n-dimensional image class.
Definition: itkImage.h:75
Casts input pixels to output pixel type.
Pixel-wise division of two images.