go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkMultiInputMultiResolutionImageRegistrationMethodBase.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 itkMultiInputMultiResolutionImageRegistrationMethodBase_h
19#define itkMultiInputMultiResolutionImageRegistrationMethodBase_h
20
23#include <vector>
24
28#define itkSimpleSetMacro(_name, _type) \
29 virtual void Set##_name(_type _arg) { this->Set##_name(_arg, 0); }
30
31#define elxOverrideSimpleSetMacro(_name, _type) \
32 void Set##_name(_type _arg) override { this->Set##_name(_arg, 0); }
33
35#define itkSetNumberOfMacro(_name) \
36 virtual void SetNumberOf##_name##s(unsigned int _arg) \
37 { \
38 if (this->m_##_name##s.size() != _arg) \
39 { \
40 this->m_##_name##s.resize(_arg); \
41 this->Modified(); \
42 } \
43 }
44
46#define itkGetNumberOfMacro(_name) \
47 virtual unsigned int GetNumberOf##_name##s() const { return this->m_##_name##s.size(); }
48
49namespace itk
50{
51
72template <typename TFixedImage, typename TMovingImage>
74 : public MultiResolutionImageRegistrationMethod2<TFixedImage, TMovingImage>
75{
76public:
78
82 using Pointer = SmartPointer<Self>;
83 using ConstPointer = SmartPointer<const Self>;
84
86 itkNewMacro(Self);
87
90
92 using typename Superclass::FixedImageType;
96 using typename Superclass::MovingImageType;
98
99 using typename Superclass::MetricType;
100 using typename Superclass::MetricPointer;
101 using typename Superclass::TransformType;
102 using typename Superclass::TransformPointer;
103 using typename Superclass::InterpolatorType;
104 using typename Superclass::InterpolatorPointer;
105 using typename Superclass::OptimizerType;
106 using OptimizerPointer = typename OptimizerType::Pointer;
111
112 using typename Superclass::TransformOutputType;
115
116 using typename Superclass::ParametersType;
117 using typename Superclass::DataObjectPointer;
118
119 using FixedImageRegionPyramidVectorType = std::vector<FixedImageRegionPyramidType>;
120
124 using FixedImageVectorType = typename MultiInputMetricType ::FixedImageVectorType;
125 using FixedImageRegionVectorType = typename MultiInputMetricType ::FixedImageRegionVectorType;
126 using MovingImageVectorType = typename MultiInputMetricType ::MovingImageVectorType;
127 using InterpolatorVectorType = typename MultiInputMetricType ::InterpolatorVectorType;
128 using FixedImageInterpolatorType = typename MultiInputMetricType ::FixedImageInterpolatorType;
129 using FixedImageInterpolatorVectorType = typename MultiInputMetricType ::FixedImageInterpolatorVectorType;
130 using FixedImagePyramidVectorType = std::vector<FixedImagePyramidPointer>;
131 using MovingImagePyramidVectorType = std::vector<MovingImagePyramidPointer>;
132
141 virtual void
142 SetFixedImage(const FixedImageType * _arg, unsigned int pos);
143
144 virtual const FixedImageType *
145 GetFixedImage(unsigned int pos) const;
146
147 const FixedImageType *
148 GetFixedImage() const override
149 {
150 return this->GetFixedImage(0);
151 }
155
157 virtual void
159
160 virtual const FixedImageRegionType &
161 GetFixedImageRegion(unsigned int pos) const;
162
164 GetFixedImageRegion() const override
165 {
166 return this->GetFixedImageRegion(0);
167 }
169 itkSetNumberOfMacro(FixedImageRegion);
170 itkGetNumberOfMacro(FixedImageRegion);
171
173 virtual void
175
176 virtual FixedImagePyramidType *
177 GetFixedImagePyramid(unsigned int pos) const;
178
181 {
182 return this->GetFixedImagePyramid(0);
183 }
184
185 const FixedImagePyramidType *
186 GetFixedImagePyramid() const override
187 {
188 return this->GetFixedImagePyramid(0);
189 }
190
192 itkSetNumberOfMacro(FixedImagePyramid);
193 itkGetNumberOfMacro(FixedImagePyramid);
194
196 virtual void
197 SetMovingImage(const MovingImageType * _arg, unsigned int pos);
198
199 virtual const MovingImageType *
200 GetMovingImage(unsigned int pos) const;
201
202 const MovingImageType *
203 GetMovingImage() const override
204 {
205 return this->GetMovingImage(0);
206 }
210
212 virtual void
214
215 virtual MovingImagePyramidType *
216 GetMovingImagePyramid(unsigned int pos) const;
217
220 {
221 return this->GetMovingImagePyramid(0);
222 }
223
224 const MovingImagePyramidType *
225 GetMovingImagePyramid() const override
226 {
227 return this->GetMovingImagePyramid(0);
228 }
229
231 itkSetNumberOfMacro(MovingImagePyramid);
232 itkGetNumberOfMacro(MovingImagePyramid);
233
235 virtual void
236 SetInterpolator(InterpolatorType * _arg, unsigned int pos);
237
238 virtual InterpolatorType *
239 GetInterpolator(unsigned int pos) const;
240
243 {
244 return this->GetInterpolator(0);
245 }
246
247 const InterpolatorType *
248 GetInterpolator() const override
249 {
250 return this->GetInterpolator(0);
251 }
252
254 itkSetNumberOfMacro(Interpolator);
255 itkGetNumberOfMacro(Interpolator);
256
258 virtual void
260
262 GetFixedImageInterpolator(unsigned int pos) const;
263
266 {
267 return this->GetFixedImageInterpolator(0);
268 }
270 itkSetNumberOfMacro(FixedImageInterpolator);
271 itkGetNumberOfMacro(FixedImageInterpolator);
272
274 void
275 SetMetric(MetricType * _arg) override;
276
279
283 ModifiedTimeType
284 GetMTime() const override;
285
286protected:
289
292
294 void
295 PrintSelf(std::ostream & os, Indent indent) const override;
296
300 void
301 GenerateData() override;
302
307 void
308 Initialize() override;
309
311 void
312 PreparePyramids() override;
313
317 virtual void
319
321 virtual void
323
325 FixedImageVectorType m_FixedImages{};
326 MovingImageVectorType m_MovingImages{};
327 FixedImageRegionVectorType m_FixedImageRegions{};
328 FixedImagePyramidVectorType m_FixedImagePyramids{};
329 MovingImagePyramidVectorType m_MovingImagePyramids{};
330 InterpolatorVectorType m_Interpolators{};
331 FixedImageInterpolatorVectorType m_FixedImageInterpolators{};
332
334 FixedImageRegionPyramidVectorType m_FixedImageRegionPyramids{};
335
337 FixedImageRegionType m_NullFixedImageRegion{};
338
339private:
340 MultiInputMetricPointer m_MultiInputMetric{};
341};
342
343} // end namespace itk
344
345#undef itkSetNumberOfMacro
346#undef itkGetNumberOfMacro
347#undef elxOverrideSimpleSetMacro
348
349#ifndef ITK_MANUAL_INSTANTIATION
350# include "itkMultiInputMultiResolutionImageRegistrationMethodBase.hxx"
351#endif
352
353#endif // end #ifndef itkMultiInputMultiResolutionImageRegistrationMethodBase_h
An extension of the ITK ImageToImageMetric. It is the intended base class for all elastix metrics.
Implements a metric base class that takes multiple inputs.
virtual InterpolatorType * GetInterpolator(unsigned int pos) const
elxOverrideSimpleSetMacro(FixedImage, const FixedImageType *)
elxOverrideSimpleSetMacro(Interpolator, InterpolatorType *)
virtual void SetMovingImage(const MovingImageType *_arg, unsigned int pos)
virtual const FixedImageRegionType & GetFixedImageRegion(unsigned int pos) const
elxOverrideSimpleSetMacro(MovingImagePyramid, MovingImagePyramidType *)
MultiResolutionPyramidImageFilter< FixedImageType, FixedImageType > FixedImagePyramidType
elxOverrideSimpleSetMacro(FixedImagePyramid, FixedImagePyramidType *)
virtual void SetFixedImagePyramid(FixedImagePyramidType *_arg, unsigned int pos)
void PrintSelf(std::ostream &os, Indent indent) const override
itkGetModifiableObjectMacro(MultiInputMetric, MultiInputMetricType)
virtual FixedImagePyramidType * GetFixedImagePyramid(unsigned int pos) const
virtual const FixedImageType * GetFixedImage(unsigned int pos) const
itkSimpleSetMacro(FixedImageInterpolator, FixedImageInterpolatorType *)
elxOverrideSimpleSetMacro(FixedImageRegion, const FixedImageRegionType)
ITK_DISALLOW_COPY_AND_MOVE(MultiInputMultiResolutionImageRegistrationMethodBase)
typename MultiInputMetricType ::FixedImageInterpolatorVectorType FixedImageInterpolatorVectorType
virtual void SetFixedImage(const FixedImageType *_arg, unsigned int pos)
virtual const MovingImageType * GetMovingImage(unsigned int pos) const
virtual FixedImageInterpolatorType * GetFixedImageInterpolator(unsigned int pos) const
virtual void SetFixedImageInterpolator(FixedImageInterpolatorType *_arg, unsigned int pos)
virtual MovingImagePyramidType * GetMovingImagePyramid(unsigned int pos) const
virtual void SetInterpolator(InterpolatorType *_arg, unsigned int pos)
elxOverrideSimpleSetMacro(MovingImage, const MovingImageType *)
virtual void SetFixedImageRegion(FixedImageRegionType _arg, unsigned int pos)
virtual void SetMovingImagePyramid(MovingImagePyramidType *_arg, unsigned int pos)
MultiResolutionPyramidImageFilter< MovingImageType, MovingImageType > 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