ITK  6.0.0
Insight Toolkit
itkPDEDeformableRegistrationFunction.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 itkPDEDeformableRegistrationFunction_h
19#define itkPDEDeformableRegistrationFunction_h
20
22
23namespace itk
24{
40template <typename TFixedImage, typename TMovingImage, typename TDisplacementField>
41class ITK_TEMPLATE_EXPORT PDEDeformableRegistrationFunction : public FiniteDifferenceFunction<TDisplacementField>
42{
43public:
44 ITK_DISALLOW_COPY_AND_MOVE(PDEDeformableRegistrationFunction);
45
51
53 itkOverrideGetNameOfClassMacro(PDEDeformableRegistrationFunction);
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 double
116 GetEnergy() const
117 {
118 return m_Energy;
119 }
120 void
122 {
123 m_GradientStep = e;
124 }
125 double
127 {
128 return m_GradientStep;
129 }
130 void
132 {
133 m_NormalizeGradient = e;
134 }
135 bool
137 {
138 return m_NormalizeGradient;
139 }
140
141protected:
143 {
144 m_MovingImage = nullptr;
145 m_FixedImage = nullptr;
146 m_DisplacementField = nullptr;
147 m_Energy = 0.0;
148 m_NormalizeGradient = true;
149 m_GradientStep = 1.0;
150 }
151
153
154 void
155 PrintSelf(std::ostream & os, Indent indent) const override
156 {
157 Superclass::PrintSelf(os, indent);
158 os << indent << "MovingImage: ";
159 os << m_MovingImage.GetPointer() << std::endl;
160 os << indent << "FixedImage: ";
161 os << m_FixedImage.GetPointer() << std::endl;
162 }
163
165 MovingImagePointer m_MovingImage{};
166
168 FixedImagePointer m_FixedImage{};
169
171 DisplacementFieldTypePointer m_DisplacementField{};
172
173 mutable double m_Energy{};
174
175 bool m_NormalizeGradient{};
176
177 mutable double m_GradientStep{};
178};
179} // end namespace itk
180
181#endif
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
void SetDisplacementField(DisplacementFieldTypePointer ptr)
~PDEDeformableRegistrationFunction() override=default
void PrintSelf(std::ostream &os, Indent indent) const override
typename DisplacementFieldType::Pointer DisplacementFieldTypePointer
typename FixedImageType::ConstPointer FixedImagePointer
typename MovingImageType::ConstPointer MovingImagePointer
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....