ITK  4.3.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 
123  itkGetObjectMacro(KernelTransform, KernelTransformType);
124 
126  itkSetMacro(Size, SizeType);
127 
129  itkGetConstReferenceMacro(Size, SizeType);
130 
132  itkSetMacro(OutputSpacing, SpacingType);
133  virtual void SetOutputSpacing(const double *values);
135 
137  itkGetConstReferenceMacro(OutputSpacing, SpacingType);
138 
140  itkSetMacro(OutputOrigin, OriginPointType);
141  virtual void SetOutputOrigin(const double *values);
143 
145  itkGetConstReferenceMacro(OutputOrigin, OriginPointType);
146 
152  itkSetMacro(SubsamplingFactor, unsigned int);
153  itkGetConstMacro(SubsamplingFactor, unsigned int);
155 
161  virtual void GenerateOutputInformation();
162 
168  virtual void GenerateInputRequestedRegion();
169 
171  ModifiedTimeType GetMTime(void) const;
172 
173 #ifdef ITK_USE_CONCEPT_CHECKING
174 
175  itkConceptMacro( OutputHasNumericTraitsCheck,
177 
179 #endif
180 
181 protected:
184  void PrintSelf(std::ostream & os, Indent indent) const;
185 
190  void GenerateData();
191 
195  void PrepareKernelBaseSpline();
196 
197 private:
198  InverseDisplacementFieldImageFilter(const Self &); //purposely not implemented
199  void operator=(const Self &); //purposely not implemented
200 
201  SizeType m_Size; // Size of the output image
202  KernelTransformPointerType m_KernelTransform; // Coordinate transform to
203  // use
204  SpacingType m_OutputSpacing; // output image spacing
205  OriginPointType m_OutputOrigin; // output image origin
206 
207  unsigned int m_SubsamplingFactor; // factor to subsample the
208  // input field.
209 };
210 } // end namespace itk
211 
212 #ifndef ITK_MANUAL_INSTANTIATION
213 #include "itkInverseDisplacementFieldImageFilter.hxx"
214 #endif
215 
216 #endif
217