ITK  6.0.0
Insight Toolkit
itkGPUPDEDeformableRegistrationFunction.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 itkGPUPDEDeformableRegistrationFunction_h
19#define itkGPUPDEDeformableRegistrationFunction_h
20
22
23namespace itk
24{
40template <typename TFixedImage, typename TMovingImage, typename TDisplacementField>
41class ITK_TEMPLATE_EXPORT GPUPDEDeformableRegistrationFunction : public GPUFiniteDifferenceFunction<TDisplacementField>
42{
43public:
44 ITK_DISALLOW_COPY_AND_MOVE(GPUPDEDeformableRegistrationFunction);
45
51
53 itkOverrideGetNameOfClassMacro(GPUPDEDeformableRegistrationFunction);
54
56 using MovingImageType = TMovingImage;
58
60 using FixedImageType = TFixedImage;
62
64 using DisplacementFieldType = TDisplacementField;
66
68 void
70 {
71 m_MovingImage = ptr;
72 }
73
75 const MovingImageType *
77 {
78 return m_MovingImage;
79 }
80
82 void
84 {
85 m_FixedImage = ptr;
86 }
87
89 const FixedImageType *
91 {
92 return m_FixedImage;
93 }
94
96 void
98 {
99 m_DisplacementField = ptr;
100 }
101
104 DisplacementFieldType *
106 {
107 return m_DisplacementField;
108 }
109
110 void
111 SetEnergy(double e)
112 {
113 m_Energy = e;
114 }
115
116 double
117 GetEnergy() const
118 {
119 return m_Energy;
120 }
121
122 void
124 {
125 m_GradientStep = e;
126 }
127
128 double
130 {
131 return m_GradientStep;
132 }
133
134 void
136 {
137 m_NormalizeGradient = e;
138 }
139
140 bool
142 {
143 return m_NormalizeGradient;
144 }
145
146protected:
148 {
149 m_MovingImage = nullptr;
150 m_FixedImage = nullptr;
151 m_DisplacementField = nullptr;
152 m_Energy = 0.0;
153 m_NormalizeGradient = true;
154 m_GradientStep = 1.0;
155 }
156
158
159 void
160 PrintSelf(std::ostream & os, Indent indent) const override
161 {
162 Superclass::PrintSelf(os, indent);
163 os << indent << "MovingImage: ";
164 os << m_MovingImage.GetPointer() << std::endl;
165 os << indent << "FixedImage: ";
166 os << m_FixedImage.GetPointer() << std::endl;
167 }
168
170 MovingImagePointer m_MovingImage{};
171
173 FixedImagePointer m_FixedImage{};
174
176 DisplacementFieldTypePointer m_DisplacementField{};
177
178 mutable double m_Energy{};
179
180 bool m_NormalizeGradient{};
181
182 mutable double m_GradientStep{};
183};
184} // end namespace itk
185
186#endif
~GPUPDEDeformableRegistrationFunction() override=default
void PrintSelf(std::ostream &os, Indent indent) const override
typename DisplacementFieldType::Pointer DisplacementFieldTypePointer
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
static constexpr double e
Definition: itkMath.h:56
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....