ITK  4.4.0
Insight Segmentation and Registration Toolkit
itkInverseDisplacementFieldImageFilter.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 __itkInverseDisplacementFieldImageFilter_h
19 #define __itkInverseDisplacementFieldImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 #include "itkKernelTransform.h"
24 
25 namespace itk
26 {
64 template< class TInputImage, class TOutputImage >
66  public ImageToImageFilter< TInputImage, TOutputImage >
67 {
68 public:
74 
75  typedef TInputImage InputImageType;
76  typedef typename InputImageType::Pointer InputImagePointer;
77  typedef typename InputImageType::ConstPointer InputImageConstPointer;
78  typedef typename InputImageType::RegionType InputImageRegionType;
79  typedef TOutputImage OutputImageType;
80  typedef typename OutputImageType::Pointer OutputImagePointer;
81 
83  itkNewMacro(Self);
84 
87 
89  itkStaticConstMacro(ImageDimension, unsigned int,
90  TOutputImage::ImageDimension);
91 
96  typedef KernelTransform<
97  double, itkGetStaticConstMacro(ImageDimension) > KernelTransformType;
99 
101  typedef typename OutputImageType::SizeType SizeType;
102 
104  typedef typename OutputImageType::IndexType IndexType;
105 
107  typedef typename TOutputImage::PixelType OutputPixelType;
108  typedef typename OutputPixelType::ValueType OutputPixelComponentType;
109 
111  typedef typename TOutputImage::RegionType OutputImageRegionType;
112 
114  typedef typename TOutputImage::SpacingType SpacingType;
115  typedef typename TOutputImage::PointType OriginPointType;
116 
120  itkSetObjectMacro(KernelTransform, KernelTransformType);
121  itkGetModifiableObjectMacro(KernelTransform, KernelTransformType);
123 
125  itkSetMacro(Size, SizeType);
126 
128  itkGetConstReferenceMacro(Size, SizeType);
129 
131  itkSetMacro(OutputSpacing, SpacingType);
132  virtual void SetOutputSpacing(const double *values);
134 
136  itkGetConstReferenceMacro(OutputSpacing, SpacingType);
137 
139  itkSetMacro(OutputOrigin, OriginPointType);
140  virtual void SetOutputOrigin(const double *values);
142 
144  itkGetConstReferenceMacro(OutputOrigin, OriginPointType);
145 
151  itkSetMacro(SubsamplingFactor, unsigned int);
152  itkGetConstMacro(SubsamplingFactor, unsigned int);
154 
160  virtual void GenerateOutputInformation();
161 
167  virtual void GenerateInputRequestedRegion();
168 
170  ModifiedTimeType GetMTime(void) const;
171 
172 #ifdef ITK_USE_CONCEPT_CHECKING
173 
174  itkConceptMacro( OutputHasNumericTraitsCheck,
176 
178 #endif
179 
180 protected:
183  void PrintSelf(std::ostream & os, Indent indent) const;
184 
189  void GenerateData();
190 
194  void PrepareKernelBaseSpline();
195 
196 private:
197  InverseDisplacementFieldImageFilter(const Self &); //purposely not implemented
198  void operator=(const Self &); //purposely not implemented
199 
200  SizeType m_Size; // Size of the output image
201  KernelTransformPointerType m_KernelTransform; // Coordinate transform to
202  // use
203  SpacingType m_OutputSpacing; // output image spacing
204  OriginPointType m_OutputOrigin; // output image origin
205 
206  unsigned int m_SubsamplingFactor; // factor to subsample the
207  // input field.
208 };
209 } // end namespace itk
210 
211 #ifndef ITK_MANUAL_INSTANTIATION
212 #include "itkInverseDisplacementFieldImageFilter.hxx"
213 #endif
214 
215 #endif
216