ITK  5.2.0
Insight Toolkit
itkComposeDisplacementFieldsImageFilter.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  * 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 itkComposeDisplacementFieldsImageFilter_h
19 #define itkComposeDisplacementFieldsImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
23 
24 namespace itk
25 {
26 
39 template <typename TInputImage, typename TOutputImage = TInputImage>
40 class ITK_TEMPLATE_EXPORT ComposeDisplacementFieldsImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
41 {
42 public:
43  ITK_DISALLOW_COPY_AND_ASSIGN(ComposeDisplacementFieldsImageFilter);
44 
49 
51  itkNewMacro(Self);
52 
54  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
55 
56  using InputFieldType = TInputImage;
57  using OutputFieldType = TOutputImage;
58 
60  using PixelType = typename OutputFieldType::PixelType;
61  using VectorType = typename OutputFieldType::PixelType;
64 
66  using SpacingType = typename OutputFieldType::SpacingType;
70 
72  using RealType = typename VectorType::ComponentType;
74 
76  itkGetModifiableObjectMacro(Interpolator, InterpolatorType);
77 
79  void
81  {
82  itkDebugMacro("setting displacement field to " << field);
83  if (field != this->GetInput(0))
84  {
85  this->SetInput(0, field);
86  this->Modified();
87  if (!this->m_Interpolator.IsNull())
88  {
89  this->m_Interpolator->SetInputImage(field);
90  }
91  }
92  }
94 
98  const InputFieldType *
100  {
101  return this->GetInput(0);
102  }
103 
105  void
107  {
108  itkDebugMacro("setting warping field to " << field);
109  if (field != this->GetInput(1))
110  {
111  this->SetInput(1, field);
112  }
113  }
115 
119  const InputFieldType *
121  {
122  return this->GetInput(1);
123  }
124 
125  /* Set the interpolator. */
126  virtual void
127  SetInterpolator(InterpolatorType * interpolator);
128 
129 protected:
132 
134  ~ComposeDisplacementFieldsImageFilter() override = default;
135 
137  void
138  PrintSelf(std::ostream & os, Indent indent) const override;
139 
141  void
142  BeforeThreadedGenerateData() override;
143 
145  void
146  DynamicThreadedGenerateData(const RegionType &) override;
147 
148 
149 private:
152 };
153 
154 } // end namespace itk
155 
156 #ifndef ITK_MANUAL_INSTANTIATION
157 # include "itkComposeDisplacementFieldsImageFilter.hxx"
158 #endif
159 
160 #endif
itk::ComposeDisplacementFieldsImageFilter::GetDisplacementField
const InputFieldType * GetDisplacementField() const
Definition: itkComposeDisplacementFieldsImageFilter.h:99
itk::ComposeDisplacementFieldsImageFilter::OutputFieldType
TOutputImage OutputFieldType
Definition: itkComposeDisplacementFieldsImageFilter.h:57
itk::ComposeDisplacementFieldsImageFilter::DirectionType
typename OutputFieldType::DirectionType DirectionType
Definition: itkComposeDisplacementFieldsImageFilter.h:69
itk::ComposeDisplacementFieldsImageFilter::m_Interpolator
InterpolatorType::Pointer m_Interpolator
Definition: itkComposeDisplacementFieldsImageFilter.h:151
itk::GTest::TypedefsAndConstructors::Dimension2::DirectionType
ImageBaseType::DirectionType DirectionType
Definition: itkGTestTypedefsAndConstructors.h:52
itk::ComposeDisplacementFieldsImageFilter::PixelType
typename OutputFieldType::PixelType PixelType
Definition: itkComposeDisplacementFieldsImageFilter.h:60
itk::ComposeDisplacementFieldsImageFilter::SetWarpingField
void SetWarpingField(const InputFieldType *field)
Definition: itkComposeDisplacementFieldsImageFilter.h:106
itk::ComposeDisplacementFieldsImageFilter::RealType
typename VectorType::ComponentType RealType
Definition: itkComposeDisplacementFieldsImageFilter.h:72
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::ComposeDisplacementFieldsImageFilter::VectorType
typename OutputFieldType::PixelType VectorType
Definition: itkComposeDisplacementFieldsImageFilter.h:61
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::ComposeDisplacementFieldsImageFilter::RegionType
typename OutputFieldType::RegionType RegionType
Definition: itkComposeDisplacementFieldsImageFilter.h:62
itk::ComposeDisplacementFieldsImageFilter::IndexType
typename OutputFieldType::IndexType IndexType
Definition: itkComposeDisplacementFieldsImageFilter.h:63
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ComposeDisplacementFieldsImageFilter::InputFieldType
TInputImage InputFieldType
Definition: itkComposeDisplacementFieldsImageFilter.h:56
itk::VectorInterpolateImageFunction
Base class for all vector image interpolators.
Definition: itkVectorInterpolateImageFunction.h:47
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::ComposeDisplacementFieldsImageFilter::GetWarpingField
const InputFieldType * GetWarpingField() const
Definition: itkComposeDisplacementFieldsImageFilter.h:120
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
itkVectorInterpolateImageFunction.h
itk::ComposeDisplacementFieldsImageFilter
Compose two displacement fields.
Definition: itkComposeDisplacementFieldsImageFilter.h:40
itkImageToImageFilter.h
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:138
itk::ComposeDisplacementFieldsImageFilter::OriginType
typename OutputFieldType::PointType OriginType
Definition: itkComposeDisplacementFieldsImageFilter.h:67
itk::ComposeDisplacementFieldsImageFilter::SetDisplacementField
void SetDisplacementField(const InputFieldType *field)
Definition: itkComposeDisplacementFieldsImageFilter.h:80
itk::ComposeDisplacementFieldsImageFilter::SpacingType
typename OutputFieldType::SpacingType SpacingType
Definition: itkComposeDisplacementFieldsImageFilter.h:66
itk::ComposeDisplacementFieldsImageFilter::SizeType
typename OutputFieldType::SizeType SizeType
Definition: itkComposeDisplacementFieldsImageFilter.h:68
itk::ComposeDisplacementFieldsImageFilter::PointType
typename OutputFieldType::PointType PointType
Definition: itkComposeDisplacementFieldsImageFilter.h:65