ITK  5.0.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:
69  ITK_DISALLOW_COPY_AND_ASSIGN(InverseDisplacementFieldImageFilter);
70 
76 
77  using InputImageType = TInputImage;
78  using InputImagePointer = typename InputImageType::Pointer;
79  using InputImageConstPointer = typename InputImageType::ConstPointer;
81  using OutputImageType = TOutputImage;
82  using OutputImagePointer = typename OutputImageType::Pointer;
83 
85  itkNewMacro(Self);
86 
89 
91  static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension;
92 
98  double, Self::ImageDimension >;
100 
103 
106 
108  using OutputPixelType = typename TOutputImage::PixelType;
109  using OutputPixelComponentType = typename OutputPixelType::ValueType;
110 
113 
115  using SpacingType = typename TOutputImage::SpacingType;
117 
121  itkSetObjectMacro(KernelTransform, KernelTransformType);
122  itkGetModifiableObjectMacro(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  void GenerateOutputInformation() override;
162 
168  void GenerateInputRequestedRegion() override;
169 
171  ModifiedTimeType GetMTime() const override;
172 
173 #ifdef ITK_USE_CONCEPT_CHECKING
174  // Begin concept checking
175  itkConceptMacro( OutputHasNumericTraitsCheck,
177  // End concept checking
178 #endif
179 
180 protected:
182  ~InverseDisplacementFieldImageFilter() override = default;
183  void PrintSelf(std::ostream & os, Indent indent) const override;
184 
189  void GenerateData() override;
190 
194  void PrepareKernelBaseSpline();
195 
196 private:
197  SizeType m_Size; // Size of the output image
198  KernelTransformPointerType m_KernelTransform; // Coordinate transform to
199  // use
200  SpacingType m_OutputSpacing; // output image spacing
201  OriginPointType m_OutputOrigin; // output image origin
202 
203  unsigned int m_SubsamplingFactor; // factor to subsample the
204  // input field.
205 };
206 } // end namespace itk
207 
208 #ifndef ITK_MANUAL_INSTANTIATION
209 #include "itkInverseDisplacementFieldImageFilter.hxx"
210 #endif
211 
212 #endif
typename OutputImageType::Pointer OutputImagePointer
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Base class for all process objects that output image data.
typename InputImageType::Pointer InputImagePointer
typename OutputImageType::RegionType OutputImageRegionType
typename KernelTransformType::Pointer KernelTransformPointerType
TOutputImage OutputImageType
Represent a n-dimensional size (bounds) of a n-dimensional image.
Definition: itkSize.h:68
unsigned long ModifiedTimeType
Definition: itkIntTypes.h:104
typename InputImageType::RegionType InputImageRegionType
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)
typename InputImageType::ConstPointer InputImageConstPointer
Computes the inverse of a displacement field.