go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkMultiMetricMultiResolutionImageRegistrationMethod.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright UMC Utrecht and contributors
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 * http://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 itkMultiMetricMultiResolutionImageRegistrationMethod_h
19#define itkMultiMetricMultiResolutionImageRegistrationMethod_h
20
23#include <vector>
24
27#define elxOverrideSimpleSetMacro(_name, _type) \
28 void Set##_name(_type _arg) override { this->Set##_name(_arg, 0); }
29
31#define itkSetNumberOfMacro(_name) \
32 virtual void SetNumberOf##_name##s(unsigned int _arg) \
33 { \
34 if (this->m_##_name##s.size() != _arg) \
35 { \
36 this->m_##_name##s.resize(_arg); \
37 this->Modified(); \
38 } \
39 }
40
42#define itkGetNumberOfMacro(_name) \
43 virtual unsigned int GetNumberOf##_name##s() const { return this->m_##_name##s.size(); }
44
45namespace itk
46{
47
76template <typename TFixedImage, typename TMovingImage>
78 : public MultiResolutionImageRegistrationMethod2<TFixedImage, TMovingImage>
79{
80public:
82
86 using Pointer = SmartPointer<Self>;
87 using ConstPointer = SmartPointer<const Self>;
88
90 itkNewMacro(Self);
91
94
96 using typename Superclass::FixedImageType;
99 using typename Superclass::MovingImageType;
101
102 using typename Superclass::MetricType;
103 using typename Superclass::MetricPointer;
104 using typename Superclass::TransformType;
105 using typename Superclass::TransformPointer;
106 using typename Superclass::InterpolatorType;
107 using typename Superclass::InterpolatorPointer;
108 using typename Superclass::OptimizerType;
109 using OptimizerPointer = typename OptimizerType::Pointer;
114
115 using typename Superclass::TransformOutputType;
118
119 using typename Superclass::ParametersType;
120 using typename Superclass::DataObjectPointer;
121
125
130 virtual void
132 {
133 this->m_Stop = true;
134 }
135
136
143 void
144 SetMetric(MetricType * _arg) override;
145
150 virtual CombinationMetricType *
152 {
153 return this->m_CombinationMetric.GetPointer();
154 }
155
156
165 virtual void
166 SetFixedImage(const FixedImageType * _arg, unsigned int pos);
167
168 virtual const FixedImageType *
169 GetFixedImage(unsigned int pos) const;
170
171 const FixedImageType *
172 GetFixedImage() const override
173 {
174 return this->GetFixedImage(0);
175 }
176
177
181
183 virtual void
184 SetMovingImage(const MovingImageType * _arg, unsigned int pos);
185
186 virtual const MovingImageType *
187 GetMovingImage(unsigned int pos) const;
188
189 const MovingImageType *
190 GetMovingImage() const override
191 {
192 return this->GetMovingImage(0);
193 }
197
199 virtual void
201
202 virtual const FixedImageRegionType &
203 GetFixedImageRegion(unsigned int pos) const;
204
206 GetFixedImageRegion() const override
207 {
208 return this->GetFixedImageRegion(0);
209 }
211 itkSetNumberOfMacro(FixedImageRegion);
212 itkGetNumberOfMacro(FixedImageRegion);
213
215 virtual void
216 SetInterpolator(InterpolatorType * _arg, unsigned int pos);
217
218 virtual InterpolatorType *
219 GetInterpolator(unsigned int pos) const;
220
223 {
224 return this->GetInterpolator(0);
225 }
226
227 const InterpolatorType *
228 GetInterpolator() const override
229 {
230 return this->GetInterpolator(0);
231 }
232
234 itkSetNumberOfMacro(Interpolator);
235 itkGetNumberOfMacro(Interpolator);
236
238 virtual void
240
241 virtual FixedImagePyramidType *
242 GetFixedImagePyramid(unsigned int pos) const;
243
246 {
247 return this->GetFixedImagePyramid(0);
248 }
249
250 const FixedImagePyramidType *
251 GetFixedImagePyramid() const override
252 {
253 return this->GetFixedImagePyramid(0);
254 }
255
257 itkSetNumberOfMacro(FixedImagePyramid);
258 itkGetNumberOfMacro(FixedImagePyramid);
259
261 virtual void
263
264 virtual MovingImagePyramidType *
265 GetMovingImagePyramid(unsigned int pos) const;
266
269 {
270 return this->GetMovingImagePyramid(0);
271 }
272
273 const MovingImagePyramidType *
274 GetMovingImagePyramid() const override
275 {
276 return this->GetMovingImagePyramid(0);
277 }
278
280 itkSetNumberOfMacro(MovingImagePyramid);
281 itkGetNumberOfMacro(MovingImagePyramid);
282
286 ModifiedTimeType
287 GetMTime() const override;
288
293 const ParametersType &
295 {
296 return this->m_LastTransformParameters;
297 }
298
299
300protected:
303 void
304 PrintSelf(std::ostream & os, Indent indent) const override;
305
306 using FixedImageRegionPyramidType = std::vector<FixedImageRegionType>;
307
311 void
312 GenerateData() override;
313
318 void
319 Initialize() override;
320
325 virtual void
327
331 virtual void
333
337 virtual void
339
341 bool m_Stop{};
342 ParametersType m_LastTransformParameters{};
343
345 CombinationMetricPointer m_CombinationMetric{};
346
348 std::vector<FixedImageConstPointer> m_FixedImages{};
349 std::vector<MovingImageConstPointer> m_MovingImages{};
350 std::vector<FixedImageRegionType> m_FixedImageRegions{};
351 std::vector<FixedImagePyramidPointer> m_FixedImagePyramids{};
352 std::vector<MovingImagePyramidPointer> m_MovingImagePyramids{};
353 std::vector<InterpolatorPointer> m_Interpolators{};
354
356 std::vector<FixedImageRegionPyramidType> m_FixedImageRegionPyramids{};
357
359 FixedImageRegionType m_NullFixedImageRegion{};
360};
361
362} // end namespace itk
363
364#undef itkSetNumberOfMacro
365#undef itkGetNumberOfMacro
366#undef elxOverrideSimpleSetMacro
367
368#ifndef ITK_MANUAL_INSTANTIATION
369# include "itkMultiMetricMultiResolutionImageRegistrationMethod.hxx"
370#endif
371
372#endif
An extension of the ITK ImageToImageMetric. It is the intended base class for all elastix metrics.
virtual MovingImagePyramidType * GetMovingImagePyramid(unsigned int pos) const
elxOverrideSimpleSetMacro(MovingImage, const MovingImageType *)
virtual FixedImagePyramidType * GetFixedImagePyramid(unsigned int pos) const
virtual void SetFixedImageRegion(FixedImageRegionType _arg, unsigned int pos)
virtual void SetMovingImagePyramid(MovingImagePyramidType *_arg, unsigned int pos)
ITK_DISALLOW_COPY_AND_MOVE(MultiMetricMultiResolutionImageRegistrationMethod)
MultiResolutionPyramidImageFilter< FixedImageType, FixedImageType > FixedImagePyramidType
virtual void SetFixedImage(const FixedImageType *_arg, unsigned int pos)
virtual void SetFixedImagePyramid(FixedImagePyramidType *_arg, unsigned int pos)
virtual void SetMovingImage(const MovingImageType *_arg, unsigned int pos)
elxOverrideSimpleSetMacro(FixedImage, const FixedImageType *)
elxOverrideSimpleSetMacro(Interpolator, InterpolatorType *)
virtual const FixedImageRegionType & GetFixedImageRegion(unsigned int pos) const
elxOverrideSimpleSetMacro(FixedImagePyramid, FixedImagePyramidType *)
virtual const FixedImageType * GetFixedImage(unsigned int pos) const
virtual void SetInterpolator(InterpolatorType *_arg, unsigned int pos)
virtual InterpolatorType * GetInterpolator(unsigned int pos) const
void PrintSelf(std::ostream &os, Indent indent) const override
virtual const MovingImageType * GetMovingImage(unsigned int pos) const
elxOverrideSimpleSetMacro(FixedImageRegion, const FixedImageRegionType)
MultiResolutionPyramidImageFilter< MovingImageType, MovingImageType > MovingImagePyramidType
elxOverrideSimpleSetMacro(MovingImagePyramid, MovingImagePyramidType *)
Base class for multi-resolution image registration methods.
typename TransformOutputType::ConstPointer TransformOutputConstPointer
MultiResolutionPyramidImageFilter< FixedImageType, FixedImageType > FixedImagePyramidType
MultiResolutionPyramidImageFilter< MovingImageType, MovingImageType > MovingImagePyramidType


Generated on 2024-07-17 for elastix by doxygen 1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d) elastix logo