ITK  4.4.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< class TInputImage, class 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 
179  itkConceptMacro( OutputHasNumericTraitsCheck,
181 
183 #endif
184 
185 protected:
188  void PrintSelf(std::ostream & os, Indent indent) const;
189 
194  void GenerateData();
195 
199  void PrepareKernelBaseSpline();
200 
201 private:
202  InverseDeformationFieldImageFilter(const Self &); //purposely not implemented
203  void operator=(const Self &); //purposely not implemented
204 
205  SizeType m_Size; // Size of the output image
206  KernelTransformPointerType m_KernelTransform; // Coordinate transform to
207  // use
208  SpacingType m_OutputSpacing; // output image spacing
209  OriginPointType m_OutputOrigin; // output image origin
210 
211  unsigned int m_SubsamplingFactor; // factor to subsample the
212  // input field.
213 };
214 } // end namespace itk
215 
216 #ifndef ITK_MANUAL_INSTANTIATION
217 #include "itkInverseDeformationFieldImageFilter.hxx"
218 #endif
219 
220 #endif
221