ITK  4.3.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 
128  itkGetObjectMacro(KernelTransform, KernelTransformType);
129 
131  itkSetMacro(Size, SizeType);
132 
134  itkGetConstReferenceMacro(Size, SizeType);
135 
137  itkSetMacro(OutputSpacing, SpacingType);
138  virtual void SetOutputSpacing(const double *values);
140 
142  itkGetConstReferenceMacro(OutputSpacing, SpacingType);
143 
145  itkSetMacro(OutputOrigin, OriginPointType);
146  virtual void SetOutputOrigin(const double *values);
148 
150  itkGetConstReferenceMacro(OutputOrigin, OriginPointType);
151 
157  itkSetMacro(SubsamplingFactor, unsigned int);
158  itkGetConstMacro(SubsamplingFactor, unsigned int);
160 
166  virtual void GenerateOutputInformation();
167 
173  virtual void GenerateInputRequestedRegion();
174 
176  unsigned long GetMTime(void) const;
177 
178 #ifdef ITK_USE_CONCEPT_CHECKING
179 
180  itkConceptMacro( OutputHasNumericTraitsCheck,
182 
184 #endif
185 
186 protected:
189  void PrintSelf(std::ostream & os, Indent indent) const;
190 
195  void GenerateData();
196 
200  void PrepareKernelBaseSpline();
201 
202 private:
203  InverseDeformationFieldImageFilter(const Self &); //purposely not implemented
204  void operator=(const Self &); //purposely not implemented
205 
206  SizeType m_Size; // Size of the output image
207  KernelTransformPointerType m_KernelTransform; // Coordinate transform to
208  // use
209  SpacingType m_OutputSpacing; // output image spacing
210  OriginPointType m_OutputOrigin; // output image origin
211 
212  unsigned int m_SubsamplingFactor; // factor to subsample the
213  // input field.
214 };
215 } // end namespace itk
216 
217 #ifndef ITK_MANUAL_INSTANTIATION
218 #include "itkInverseDeformationFieldImageFilter.hxx"
219 #endif
220 
221 #endif
222