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 }
227 itkSetNumberOfMacro(Interpolator);
228 itkGetNumberOfMacro(Interpolator);
229
231 virtual void
233
234 virtual FixedImagePyramidType *
235 GetFixedImagePyramid(unsigned int pos) const;
236
239 {
240 return this->GetFixedImagePyramid(0);
241 }
243 itkSetNumberOfMacro(FixedImagePyramid);
244 itkGetNumberOfMacro(FixedImagePyramid);
245
247 virtual void
249
250 virtual MovingImagePyramidType *
251 GetMovingImagePyramid(unsigned int pos) const;
252
255 {
256 return this->GetMovingImagePyramid(0);
257 }
259 itkSetNumberOfMacro(MovingImagePyramid);
260 itkGetNumberOfMacro(MovingImagePyramid);
261
265 ModifiedTimeType
266 GetMTime() const override;
267
272 const ParametersType &
274 {
275 return this->m_LastTransformParameters;
276 }
277
278
279protected:
282 void
283 PrintSelf(std::ostream & os, Indent indent) const override;
284
285 using FixedImageRegionPyramidType = std::vector<FixedImageRegionType>;
286
290 void
291 GenerateData() override;
292
297 void
298 Initialize() override;
299
304 virtual void
306
310 virtual void
312
316 virtual void
318
320 bool m_Stop;
322
325
327 std::vector<FixedImageConstPointer> m_FixedImages;
328 std::vector<MovingImageConstPointer> m_MovingImages;
329 std::vector<FixedImageRegionType> m_FixedImageRegions;
330 std::vector<FixedImagePyramidPointer> m_FixedImagePyramids;
331 std::vector<MovingImagePyramidPointer> m_MovingImagePyramids;
332 std::vector<InterpolatorPointer> m_Interpolators;
333
335 std::vector<FixedImageRegionPyramidType> m_FixedImageRegionPyramids;
336
339};
340
341} // end namespace itk
342
343#undef itkSetNumberOfMacro
344#undef itkGetNumberOfMacro
345#undef elxOverrideSimpleSetMacro
346
347#ifndef ITK_MANUAL_INSTANTIATION
348# include "itkMultiMetricMultiResolutionImageRegistrationMethod.hxx"
349#endif
350
351#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 2023-01-13 for elastix by doxygen 1.9.6 elastix logo