ITK  5.4.0
Insight Toolkit
itkGridForwardWarpImageFilter.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 itkGridForwardWarpImageFilter_h
19 #define itkGridForwardWarpImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 
23 namespace itk
24 {
58 template <typename TDisplacementField, typename TOutputImage>
59 class ITK_TEMPLATE_EXPORT GridForwardWarpImageFilter : public ImageToImageFilter<TDisplacementField, TOutputImage>
60 {
61 public:
62  ITK_DISALLOW_COPY_AND_MOVE(GridForwardWarpImageFilter);
63 
69 
71  itkNewMacro(Self);
72 
74  itkOverrideGetNameOfClassMacro(GridForwardWarpImageFilter);
75 
78 
80  using typename Superclass::OutputImageType;
81  using typename Superclass::OutputImagePointer;
84  using PixelType = typename OutputImageType::PixelType;
85  using SpacingType = typename OutputImageType::SpacingType;
86 
88  static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension;
89  static constexpr unsigned int DisplacementFieldDimension = TDisplacementField::ImageDimension;
90 
92  using DisplacementFieldType = TDisplacementField;
94  using DisplacementType = typename DisplacementFieldType::PixelType;
95 
97  itkSetMacro(BackgroundValue, PixelType);
98 
100  itkGetConstMacro(BackgroundValue, PixelType);
101 
103  itkSetMacro(ForegroundValue, PixelType);
104 
106  itkGetConstMacro(ForegroundValue, PixelType);
107 
108 #ifdef ITK_USE_CONCEPT_CHECKING
109  // Begin concept checking
111  itkConceptMacro(DisplacementFieldHasNumericTraitsCheck,
113  // End concept checking
114 #endif
115 
116 protected:
118  ~GridForwardWarpImageFilter() override = default;
119 
120  void
121  PrintSelf(std::ostream & os, Indent indent) const override;
122 
123  void
124  GenerateData() override;
125 
126 private:
127  PixelType m_BackgroundValue{};
128  PixelType m_ForegroundValue{};
129  unsigned int m_GridPixSpacing{ 5 };
130 };
131 } // end namespace itk
132 
133 #ifndef ITK_MANUAL_INSTANTIATION
134 # include "itkGridForwardWarpImageFilter.hxx"
135 #endif
136 
137 #endif
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itk::Concept::HasNumericTraits
Definition: itkConceptChecking.h:714
itk::GridForwardWarpImageFilter::PixelType
typename OutputImageType::PixelType PixelType
Definition: itkGridForwardWarpImageFilter.h:84
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::GridForwardWarpImageFilter::DisplacementType
typename DisplacementFieldType::PixelType DisplacementType
Definition: itkGridForwardWarpImageFilter.h:94
itk::GridForwardWarpImageFilter::IndexType
typename OutputImageType::IndexType IndexType
Definition: itkGridForwardWarpImageFilter.h:82
itk::Concept::SameDimension
Definition: itkConceptChecking.h:694
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::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::GridForwardWarpImageFilter::DisplacementFieldType
TDisplacementField DisplacementFieldType
Definition: itkGridForwardWarpImageFilter.h:92
itk::GridForwardWarpImageFilter
Warps a grid using an input deformation field.
Definition: itkGridForwardWarpImageFilter.h:59
itkImageToImageFilter.h
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::GridForwardWarpImageFilter::SpacingType
typename OutputImageType::SpacingType SpacingType
Definition: itkGridForwardWarpImageFilter.h:85
itk::GridForwardWarpImageFilter::DisplacementFieldConstPointer
typename DisplacementFieldType::ConstPointer DisplacementFieldConstPointer
Definition: itkGridForwardWarpImageFilter.h:93
itk::GridForwardWarpImageFilter::SizeType
typename OutputImageType::SizeType SizeType
Definition: itkGridForwardWarpImageFilter.h:83