ITK  5.4.0
Insight Toolkit
itkInverseDisplacementFieldImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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  * https://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 : public ImageToImageFilter<TInputImage, TOutputImage>
66 {
67 public:
68  ITK_DISALLOW_COPY_AND_MOVE(InverseDisplacementFieldImageFilter);
69 
75 
76  using InputImageType = TInputImage;
80  using OutputImageType = TOutputImage;
82 
84  itkNewMacro(Self);
85 
87  itkOverrideGetNameOfClassMacro(InverseDisplacementFieldImageFilter);
88 
90  static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension;
91 
98 
101 
104 
106  using OutputPixelType = typename TOutputImage::PixelType;
107  using OutputPixelComponentType = typename OutputPixelType::ValueType;
108 
111 
113  using SpacingType = typename TOutputImage::SpacingType;
115 
119  itkSetObjectMacro(KernelTransform, KernelTransformType);
120  itkGetModifiableObjectMacro(KernelTransform, KernelTransformType);
124  itkSetMacro(Size, SizeType);
125 
127  itkGetConstReferenceMacro(Size, SizeType);
128 
130  itkSetMacro(OutputSpacing, SpacingType);
131  virtual void
132  SetOutputSpacing(const double * spacing);
136  itkGetConstReferenceMacro(OutputSpacing, SpacingType);
137 
139  itkSetMacro(OutputOrigin, OriginPointType);
140  virtual void
141  SetOutputOrigin(const double * origin);
145  itkGetConstReferenceMacro(OutputOrigin, OriginPointType);
146 
152  itkSetMacro(SubsamplingFactor, unsigned int);
153  itkGetConstMacro(SubsamplingFactor, unsigned int);
161  void
162  GenerateOutputInformation() override;
163 
169  void
170  GenerateInputRequestedRegion() override;
171 
174  GetMTime() const override;
175 
176 #ifdef ITK_USE_CONCEPT_CHECKING
177  // Begin concept checking
179  // End concept checking
180 #endif
181 
182 protected:
184  ~InverseDisplacementFieldImageFilter() override = default;
185  void
186  PrintSelf(std::ostream & os, Indent indent) const override;
187 
192  void
193  GenerateData() override;
194 
198  void
199  PrepareKernelBaseSpline();
200 
201 private:
202  SizeType m_Size{}; // Size of the output image
203  KernelTransformPointerType m_KernelTransform{}; // Coordinate transform to
204  // use
205  SpacingType m_OutputSpacing{}; // output image spacing
206  OriginPointType m_OutputOrigin{}; // output image origin
207 
208  unsigned int m_SubsamplingFactor{}; // factor to subsample the
209  // input field.
210 };
211 } // end namespace itk
212 
213 #ifndef ITK_MANUAL_INSTANTIATION
214 # include "itkInverseDisplacementFieldImageFilter.hxx"
215 #endif
216 
217 #endif
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itk::InverseDisplacementFieldImageFilter::OutputPixelComponentType
typename OutputPixelType::ValueType OutputPixelComponentType
Definition: itkInverseDisplacementFieldImageFilter.h:107
itk::Concept::HasNumericTraits
Definition: itkConceptChecking.h:714
itk::ImageSource::OutputImagePointer
typename OutputImageType::Pointer OutputImagePointer
Definition: itkImageSource.h:91
itkImageRegionConstIteratorWithIndex.h
itk::ModifiedTimeType
SizeValueType ModifiedTimeType
Definition: itkIntTypes.h:102
itk::Size
Represent a n-dimensional size (bounds) of a n-dimensional image.
Definition: itkSize.h:71
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::InverseDisplacementFieldImageFilter
Computes the inverse of a displacement field.
Definition: itkInverseDisplacementFieldImageFilter.h:65
itkKernelTransform.h
itk::InverseDisplacementFieldImageFilter::OutputPixelType
typename TOutputImage::PixelType OutputPixelType
Definition: itkInverseDisplacementFieldImageFilter.h:106
itk::InverseDisplacementFieldImageFilter::KernelTransformPointerType
typename KernelTransformType::Pointer KernelTransformPointerType
Definition: itkInverseDisplacementFieldImageFilter.h:97
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::ImageToImageFilter
Base class for filters that take an image as input and produce an image as output.
Definition: itkImageToImageFilter.h:108
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::ImageToImageFilter::InputImagePointer
typename InputImageType::Pointer InputImagePointer
Definition: itkImageToImageFilter.h:130
itk::InverseDisplacementFieldImageFilter::OriginPointType
typename TOutputImage::PointType OriginPointType
Definition: itkInverseDisplacementFieldImageFilter.h:114
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itkImageToImageFilter.h
itk::InverseDisplacementFieldImageFilter::SpacingType
typename TOutputImage::SpacingType SpacingType
Definition: itkInverseDisplacementFieldImageFilter.h:113
itk::InverseDisplacementFieldImageFilter::IndexType
typename OutputImageType::IndexType IndexType
Definition: itkInverseDisplacementFieldImageFilter.h:103
itk::ImageSource::OutputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
Definition: itkImageSource.h:92
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itk::KernelTransform
Definition: itkKernelTransform.h:61
itk::ImageToImageFilter::InputImageRegionType
typename InputImageType::RegionType InputImageRegionType
Definition: itkImageToImageFilter.h:132
itk::InverseDisplacementFieldImageFilter::SizeType
typename OutputImageType::SizeType SizeType
Definition: itkInverseDisplacementFieldImageFilter.h:100
itk::ImageToImageFilter::InputImageConstPointer
typename InputImageType::ConstPointer InputImageConstPointer
Definition: itkImageToImageFilter.h:131
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90