ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkInverseDeformationFieldImageFilter.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 itkInverseDeformationFieldImageFilter_h
19 #define itkInverseDeformationFieldImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 #include "itkKernelTransform.h"
24 
25 #ifndef ITKV3_COMPATIBILITY
26 #error "This file is only valid when ITKV3_COMPATIBILITY is turned on. Users are encouraged to convert to itk::InverseDisplacementFieldImageFilter in ITKv4"
27 #endif
28 
29 namespace itk
30 {
69 template< typename TInputImage, typename TOutputImage >
70 class ITK_TEMPLATE_EXPORT InverseDeformationFieldImageFilter:
71  public ImageToImageFilter< TInputImage, TOutputImage >
72 {
73 public:
79 
80  typedef TInputImage InputImageType;
81  typedef typename InputImageType::Pointer InputImagePointer;
82  typedef typename InputImageType::ConstPointer InputImageConstPointer;
83  typedef typename InputImageType::RegionType InputImageRegionType;
84  typedef TOutputImage OutputImageType;
85  typedef typename OutputImageType::Pointer OutputImagePointer;
86 
88  itkNewMacro(Self);
89 
92 
94  itkStaticConstMacro(ImageDimension, unsigned int,
95  TOutputImage::ImageDimension);
96 
101  typedef KernelTransform<
102  double, itkGetStaticConstMacro(ImageDimension) > KernelTransformType;
104 
107 
110 
112  typedef typename TOutputImage::PixelType OutputPixelType;
113  typedef typename OutputPixelType::ValueType OutputPixelComponentType;
114 
116  typedef typename TOutputImage::RegionType OutputImageRegionType;
117 
119  typedef typename TOutputImage::SpacingType SpacingType;
121 
125  itkSetObjectMacro(KernelTransform, KernelTransformType);
126  itkGetModifiableObjectMacro(KernelTransform, KernelTransformType);
128 
130  itkSetMacro(Size, SizeType);
131 
133  itkGetConstReferenceMacro(Size, SizeType);
134 
136  itkSetMacro(OutputSpacing, SpacingType);
137  virtual void SetOutputSpacing(const double *values);
139 
141  itkGetConstReferenceMacro(OutputSpacing, SpacingType);
142 
144  itkSetMacro(OutputOrigin, OriginPointType);
145  virtual void SetOutputOrigin(const double *values);
147 
149  itkGetConstReferenceMacro(OutputOrigin, OriginPointType);
150 
156  itkSetMacro(SubsamplingFactor, unsigned int);
157  itkGetConstMacro(SubsamplingFactor, unsigned int);
159 
165  virtual void GenerateOutputInformation() ITK_OVERRIDE;
166 
172  virtual void GenerateInputRequestedRegion() ITK_OVERRIDE;
173 
175  ModifiedTimeType GetMTime() const ITK_OVERRIDE;
176 
177 #ifdef ITK_USE_CONCEPT_CHECKING
178  // Begin concept checking
179  itkConceptMacro( OutputHasNumericTraitsCheck,
181  // End concept checking
182 #endif
183 
184 protected:
187  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
188 
193  void GenerateData() ITK_OVERRIDE;
194 
198  void PrepareKernelBaseSpline();
199 
200 private:
201  ITK_DISALLOW_COPY_AND_ASSIGN(InverseDeformationFieldImageFilter);
202 
203  SizeType m_Size; // Size of the output image
204  KernelTransformPointerType m_KernelTransform; // Coordinate transform to
205  // use
206  SpacingType m_OutputSpacing; // output image spacing
207  OriginPointType m_OutputOrigin; // output image origin
208 
209  unsigned int m_SubsamplingFactor; // factor to subsample the
210  // input field.
211 };
212 } // end namespace itk
213 
214 #ifndef ITK_MANUAL_INSTANTIATION
215 #include "itkInverseDeformationFieldImageFilter.hxx"
216 #endif
217 
218 #endif
Represent the size (bounds) of a n-dimensional image.
Definition: itkSize.h:52
unsigned long ModifiedTimeType
Definition: itkIntTypes.h:164
Computes the inverse of a deformation field.
Base class for all process objects that output image data.
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
ImageToImageFilter< TInputImage, TOutputImage > Superclass
#define itkConceptMacro(name, concept)
KernelTransform< double, itkGetStaticConstMacro(ImageDimension) > KernelTransformType