ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
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
38
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;
62 using RegionType = typename OutputFieldType::RegionType;
63 using IndexType = typename OutputFieldType::IndexType;
64
65 using PointType = typename OutputFieldType::PointType;
66 using SpacingType = typename OutputFieldType::SpacingType;
67 using OriginType = typename OutputFieldType::PointType;
68 using SizeType = typename OutputFieldType::SizeType;
69 using DirectionType = typename OutputFieldType::DirectionType;
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 }
93
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 }
114
115
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:
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
VectorInterpolateImageFunction< InputFieldType, RealType > InterpolatorType
void DynamicThreadedGenerateData(const RegionType &) override
~ComposeDisplacementFieldsImageFilter() override=default
ImageToImageFilter< TInputImage, TOutputImage > Superclass
virtual void SetInput(const InputImageType *input)
Control indentation during Print() invocation.
Definition itkIndent.h:50
virtual void Modified() const
Implements transparent reference counting.
Base class for all vector image interpolators.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....