ITK  4.13.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< typename TInputImage, typename TOutputImage >
65 class ITK_TEMPLATE_EXPORT InverseDisplacementFieldImageFilter:
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 
102 
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;
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() ITK_OVERRIDE;
161 
167  virtual void GenerateInputRequestedRegion() ITK_OVERRIDE;
168 
170  ModifiedTimeType GetMTime(void) const ITK_OVERRIDE;
171 
172 #ifdef ITK_USE_CONCEPT_CHECKING
173  // Begin concept checking
174  itkConceptMacro( OutputHasNumericTraitsCheck,
176  // End concept checking
177 #endif
178 
179 protected:
182  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
183 
188  void GenerateData() ITK_OVERRIDE;
189 
193  void PrepareKernelBaseSpline();
194 
195 private:
196  ITK_DISALLOW_COPY_AND_ASSIGN(InverseDisplacementFieldImageFilter);
197 
198  SizeType m_Size; // Size of the output image
199  KernelTransformPointerType m_KernelTransform; // Coordinate transform to
200  // use
201  SpacingType m_OutputSpacing; // output image spacing
202  OriginPointType m_OutputOrigin; // output image origin
203 
204  unsigned int m_SubsamplingFactor; // factor to subsample the
205  // input field.
206 };
207 } // end namespace itk
208 
209 #ifndef ITK_MANUAL_INSTANTIATION
210 #include "itkInverseDisplacementFieldImageFilter.hxx"
211 #endif
212 
213 #endif
Represent the size (bounds) of a n-dimensional image.
Definition: itkSize.h:52
KernelTransform< double, itkGetStaticConstMacro(ImageDimension) > KernelTransformType
unsigned long ModifiedTimeType
Definition: itkIntTypes.h:164
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
#define itkConceptMacro(name, concept)
Computes the inverse of a displacement field.
ImageToImageFilter< TInputImage, TOutputImage > Superclass