ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkVariationalRegistrationFunction.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 itkVariationalRegistrationFunction_h
19#define itkVariationalRegistrationFunction_h
20
22// #include "itkWarpImageFilter.h"
24#include <mutex>
25
26namespace itk
27{
28
51template <typename TFixedImage, typename TMovingImage, typename TDisplacementField>
53{
54public:
55 ITK_DISALLOW_COPY_AND_MOVE(VariationalRegistrationFunction);
56
62
64
66 itkOverrideGetNameOfClassMacro(VariationalRegistrationFunction);
67
69 static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
70
72 using MovingImageType = TMovingImage;
73 using MovingImagePointer = typename MovingImageType::ConstPointer;
74
76 using FixedImageType = TFixedImage;
77 using FixedImagePointer = typename FixedImageType::ConstPointer;
78
80 using WarpedImageType = TFixedImage;
81 using WarpedImagePointer = typename WarpedImageType::ConstPointer;
82
84 using DisplacementFieldType = TDisplacementField;
85 using DisplacementFieldTypePointer = typename DisplacementFieldType::ConstPointer;
86
88 using MaskImagePixelType = unsigned char;
91
92 // uncomment the following line to use the standard ITK warper (not recommended)
93 // typedef itk::WarpImageFilter< FixedImageType, WarpedImageType, DisplacementFieldType >
98
99
101 virtual void
103 {
104 m_MovingImage = ptr;
105 }
106
108 virtual const MovingImageType *
110 {
111 return m_MovingImage;
112 }
113
115 virtual void
117 {
118 m_FixedImage = ptr;
119 }
120
122 virtual const FixedImageType *
124 {
125 return m_FixedImage;
126 }
127
129 virtual void
134
136 virtual const DisplacementFieldType *
138 {
139 return m_DisplacementField;
140 }
141
143 virtual void
145 {
146 m_MaskImage = ptr;
147 }
148
150 virtual const MaskImageType *
152 {
153 return m_MaskImage;
154 }
155
157 virtual void
162
164 virtual const MovingImageWarperType *
166 {
167 return m_MovingImageWarper;
168 }
169
171 virtual void
173 {
174 m_TimeStep = timeStep;
175 }
176
178 virtual const TimeStepType
180 {
181 return m_TimeStep;
182 }
183
186 virtual void
191
194 virtual MaskImagePixelType
199
201 void
203
208 ComputeGlobalTimeStep(void * itkNotUsed(GlobalData)) const override
209 {
210 return m_TimeStep;
211 }
212
215 void *
216 GetGlobalDataPointer() const override;
217
219 void
220 ReleaseGlobalDataPointer(void * GlobalData) const override;
221
222 //
223 // Metric accessor methods
227 virtual double
228 GetMetric() const
229 {
230 return m_Metric;
231 }
232
234 virtual double
236 {
237 return m_RMSChange;
238 }
239
240protected:
243
245 void
246 PrintSelf(std::ostream & os, Indent indent) const override;
247
250 virtual void
252
254 virtual const WarpedImagePointer
256
265
266private:
269
272
275
278
281
284
287
291 mutable double m_Metric;
292 mutable double m_SumOfMetricValues;
294 mutable double m_RMSChange;
295 mutable double m_SumOfSquaredChange;
296
298 mutable std::mutex m_MetricCalculationLock;
299};
300
301} // end namespace itk
302
303#ifndef ITK_MANUAL_INSTANTIATION
304# include "itkVariationalRegistrationFunction.hxx"
305#endif
306
307#endif
Warps an image using an input deformation field with continuous boundary conditions.
static constexpr unsigned int ImageDimension
Templated n-dimensional image class.
Definition itkImage.h:89
SmartPointer< const Self > ConstPointer
Definition itkImage.h:97
Control indentation during Print() invocation.
Definition itkIndent.h:53
Implements transparent reference counting.
virtual const WarpedImagePointer GetWarpedImage() const
virtual void SetMovingImageWarper(MovingImageWarperType *ptr)
virtual const MaskImageType * GetMaskImage() const
virtual void SetFixedImage(const FixedImageType *ptr)
virtual const MovingImageWarperType * GetMovingImageWarper() const
virtual const DisplacementFieldType * GetDisplacementField() const
virtual const FixedImageType * GetFixedImage() const
void PrintSelf(std::ostream &os, Indent indent) const override
virtual const MovingImageType * GetMovingImage() const
virtual void SetMaskBackgroundThreshold(MaskImagePixelType threshold)
TimeStepType ComputeGlobalTimeStep(void *GlobalData) const override
virtual void SetDisplacementField(DisplacementFieldType *ptr)
virtual MaskImagePixelType GetMaskBackgroundThreshold() const
virtual void SetMaskImage(const MaskImageType *ptr)
void ReleaseGlobalDataPointer(void *GlobalData) const override
void * GetGlobalDataPointer() const override
~VariationalRegistrationFunction() override=default
itk::ContinuousBorderWarpImageFilter< FixedImageType, WarpedImageType, DisplacementFieldType > MovingImageWarperType
virtual void SetMovingImage(const MovingImageType *ptr)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType
Definition itkIntTypes.h:82