ITK  6.0.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 * 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 itkComposeDisplacementFieldsImageFilter_h
19#define itkComposeDisplacementFieldsImageFilter_h
20
23
24namespace itk
25{
26
39template <typename TInputImage, typename TOutputImage = TInputImage>
40class ITK_TEMPLATE_EXPORT ComposeDisplacementFieldsImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
41{
42public:
43 ITK_DISALLOW_COPY_AND_MOVE(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 }
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 }
119 const InputFieldType *
121 {
122 return this->GetInput(1);
123 }
124
125 /* Set the interpolator. */
126 virtual void
128
129protected:
132
135
137 void
138 PrintSelf(std::ostream & os, Indent indent) const override;
139
141 void
143
145 void
147
148
149private:
151 typename InterpolatorType::Pointer m_Interpolator{};
152};
153
154} // end namespace itk
155
156#ifndef ITK_MANUAL_INSTANTIATION
157# include "itkComposeDisplacementFieldsImageFilter.hxx"
158#endif
159
160#endif
virtual void SetInterpolator(InterpolatorType *interpolator)
void PrintSelf(std::ostream &os, Indent indent) const override
void DynamicThreadedGenerateData(const RegionType &) override
~ComposeDisplacementFieldsImageFilter() override=default
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
Base class for all vector image interpolators.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....