18 #ifndef itkImageRegistrationMethodv4_h
19 #define itkImageRegistrationMethodv4_h
33 #include "ITKRegistrationMethodsv4Export.h"
59 extern ITKRegistrationMethodsv4_EXPORT std::ostream &
112 template <
typename TFixedImage,
113 typename TMovingImage,
114 typename TOutputTransform = Transform<double, TFixedImage::ImageDimension, TFixedImage::ImageDimension>,
115 typename TVirtualImage = TFixedImage,
116 typename TPointSet = PointSet<unsigned int, TFixedImage::ImageDimension>>
132 static constexpr
unsigned int ImageDimension = TFixedImage::ImageDimension;
154 using RealType =
typename OutputTransformType::ScalarType;
215 #if !defined(ITK_LEGACY_REMOVE)
230 this->SetFixedImage(0, image);
232 virtual const FixedImageType *
235 return this->GetFixedImage(0);
239 virtual const FixedImageType * GetFixedImage(
SizeValueType)
const;
246 this->SetMovingImage(0, image);
248 virtual const MovingImageType *
251 return this->GetMovingImage(0);
255 virtual const MovingImageType * GetMovingImage(
SizeValueType)
const;
262 this->SetFixedPointSet(0, pointSet);
264 virtual const PointSetType *
267 return this->GetFixedPointSet(0);
271 virtual const PointSetType * GetFixedPointSet(
SizeValueType)
const;
278 this->SetMovingPointSet(0, pointSet);
280 virtual const PointSetType *
283 return this->GetMovingPointSet(0);
287 virtual const PointSetType * GetMovingPointSet(
SizeValueType)
const;
291 itkSetObjectMacro(
Optimizer, OptimizerType);
292 itkGetModifiableObjectMacro(
Optimizer, OptimizerType);
304 SetOptimizerWeights(OptimizerWeightsType &);
305 itkGetConstMacro(OptimizerWeights, OptimizerWeightsType);
309 itkSetObjectMacro(Metric, MetricType);
310 itkGetModifiableObjectMacro(Metric, MetricType);
330 MetricSamplingReinitializeSeed();
332 MetricSamplingReinitializeSeed(
int seed);
337 SetMetricSamplingPercentage(
const RealType);
341 SetMetricSamplingPercentagePerLevel(
const MetricSamplingPercentageArrayType & samplingPercentages);
342 itkGetConstMacro(MetricSamplingPercentagePerLevel, MetricSamplingPercentageArrayType);
346 itkSetGetDecoratedObjectInputMacro(FixedInitialTransform, InitialTransformType);
349 itkSetGetDecoratedObjectInputMacro(MovingInitialTransform, InitialTransformType);
366 itkSetGetDecoratedObjectInputMacro(InitialTransform, InitialTransformType);
370 SetTransformParametersAdaptorsPerLevel(TransformParametersAdaptorsContainerType &);
371 const TransformParametersAdaptorsContainerType &
372 GetTransformParametersAdaptorsPerLevel()
const;
397 for (
unsigned int level = 0; level < factors.
Size(); ++level)
399 auto shrinkFactors = MakeFilled<ShrinkFactorsPerDimensionContainerType>(factors[level]);
400 this->SetShrinkFactorsPerDimension(level, shrinkFactors);
408 ShrinkFactorsPerDimensionContainerType
411 if (level >= this->m_ShrinkFactorsPerLevel.size())
413 itkExceptionMacro(
"Requesting level greater than the number of levels.");
415 return this->m_ShrinkFactorsPerLevel[level];
425 if (level >= this->m_ShrinkFactorsPerLevel.size())
427 this->m_ShrinkFactorsPerLevel.resize(level + 1);
429 this->m_ShrinkFactorsPerLevel[level] = factors;
439 itkSetMacro(SmoothingSigmasPerLevel, SmoothingSigmasArrayType);
440 itkGetConstMacro(SmoothingSigmasPerLevel, SmoothingSigmasArrayType);
447 itkSetMacro(SmoothingSigmasAreSpecifiedInPhysicalUnits,
bool);
448 itkGetConstMacro(SmoothingSigmasAreSpecifiedInPhysicalUnits,
bool);
449 itkBooleanMacro(SmoothingSigmasAreSpecifiedInPhysicalUnits);
454 using Superclass::MakeOutput;
467 return this->GetOutput();
469 virtual const DecoratedOutputTransformType *
472 return this->GetOutput();
475 virtual OutputTransformType *
476 GetModifiableTransform();
477 virtual const OutputTransformType *
478 GetTransform()
const;
487 itkGetConstReferenceMacro(CurrentMetricValue, RealType);
490 itkGetConstReferenceMacro(CurrentConvergenceValue, RealType);
493 itkGetConstReferenceMacro(IsConverged,
bool);
498 itkSetMacro(InPlace,
bool);
499 itkGetConstMacro(InPlace,
bool);
500 itkBooleanMacro(InPlace);
508 itkBooleanMacro(InitializeCenterOfLinearOutputTransform);
509 itkSetMacro(InitializeCenterOfLinearOutputTransform,
bool);
510 itkGetConstMacro(InitializeCenterOfLinearOutputTransform,
bool);
526 InitializeCenterOfLinearOutputTransform();
532 PrintSelf(std::ostream & os,
Indent indent)
const override;
536 GenerateData()
override;
546 virtual VirtualImageBaseConstPointer
547 GetCurrentLevelVirtualDomainImage();
551 SetMetricSamplePoints();
558 bool m_IsConverged{};
572 bool m_OptimizerWeightsAreIdentity{};
578 int m_FirstImageMetricIndex{};
579 std::vector<ShrinkFactorsPerDimensionContainerType> m_ShrinkFactorsPerLevel{};
581 bool m_SmoothingSigmasAreSpecifiedInPhysicalUnits{};
583 bool m_ReseedIterator{};
585 int m_CurrentRandomSeed{};
600 bool m_InitializeCenterOfLinearOutputTransform{};
603 template <
typename TTransform>
618 #ifndef ITK_MANUAL_INSTANTIATION
619 # include "itkImageRegistrationMethodv4.hxx"