ITK  4.6.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 itkInverseDisplacementFieldImageFilter.h in ITKv4"
27 #endif
28 
29 namespace itk
30 {
69 template< typename TInputImage, typename TOutputImage >
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 
106  typedef typename OutputImageType::SizeType SizeType;
107 
109  typedef typename OutputImageType::IndexType IndexType;
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;
120  typedef typename TOutputImage::PointType OriginPointType;
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();
166 
172  virtual void GenerateInputRequestedRegion();
173 
175  unsigned long GetMTime(void) const;
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;
188 
193  void GenerateData();
194 
199 
200 private:
201  InverseDeformationFieldImageFilter(const Self &); //purposely not implemented
202  void operator=(const Self &); //purposely not implemented
203 
204  SizeType m_Size; // Size of the output image
205  KernelTransformPointerType m_KernelTransform; // Coordinate transform to
206  // use
207  SpacingType m_OutputSpacing; // output image spacing
208  OriginPointType m_OutputOrigin; // output image origin
209 
210  unsigned int m_SubsamplingFactor; // factor to subsample the
211  // input field.
212 };
213 } // end namespace itk
214 
215 #ifndef ITK_MANUAL_INSTANTIATION
216 #include "itkInverseDeformationFieldImageFilter.hxx"
217 #endif
218 
219 #endif
Represent the size (bounds) of a n-dimensional image.
Definition: itkSize.h:52
virtual void SetOutputSpacing(SpacingType _arg)
virtual void SetOutputOrigin(OriginPointType _arg)
Computes the inverse of a deformation field.
unsigned long GetMTime(void) const
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
void PrintSelf(std::ostream &os, Indent indent) const
#define itkConceptMacro(name, concept)
KernelTransform< double, itkGetStaticConstMacro(ImageDimension) > KernelTransformType