18#ifndef itkImageRegistrationMethodv4_h
19#define itkImageRegistrationMethodv4_h
33#include "ITKRegistrationMethodsv4Export.h"
59extern ITKRegistrationMethodsv4_EXPORT std::ostream &
112template <
typename TFixedImage,
113 typename TMovingImage,
115 typename TVirtualImage = TFixedImage,
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);
246 this->SetMovingImage(0, image);
248 virtual const MovingImageType *
251 return this->GetMovingImage(0);
262 this->SetFixedPointSet(0, pointSet);
264 virtual const PointSetType *
267 return this->GetFixedPointSet(0);
278 this->SetMovingPointSet(0, pointSet);
280 virtual const PointSetType *
283 return this->GetMovingPointSet(0);
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;
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 *
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);
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"
enum type for metric sampling strategy
SizeValueType Size() const
Decorates any subclass of itkObject with a DataObject API.
Base class for templated image classes.
Contains all enum classes for ImageRegistrationMethodv4 class.
Interface method for the current registration framework.
virtual void SetFixedImage(SizeValueType, const FixedImageType *)
virtual void InitializeRegistrationAtEachLevel(const SizeValueType)
virtual const DecoratedOutputTransformType * GetTransformOutput() const
typename DecoratedInitialTransformType::Pointer DecoratedInitialTransformPointer
typename MovingImageType::ConstPointer MovingImageConstPointer
typename OutputTransformType::Pointer OutputTransformPointer
virtual void SetMovingPointSet(const PointSetType *pointSet)
std::vector< TransformParametersAdaptorPointer > TransformParametersAdaptorsContainerType
typename DerivativeType::ValueType DerivativeValueType
virtual const DecoratedOutputTransformType * GetOutput() const
virtual const FixedImageType * GetFixedImage() const
virtual void SetMovingImage(SizeValueType, const MovingImageType *)
void PrintSelf(std::ostream &os, Indent indent) const override
typename ImageMetricType::FixedSampledPointSetType MetricSamplePointSetType
typename PointSetType::ConstPointer PointSetConstPointer
typename ShrinkFilterType::ShrinkFactorsType ShrinkFactorsPerDimensionContainerType
std::vector< MovingImageMaskConstPointer > MovingImageMasksContainerType
typename DecoratedOutputTransformType::Pointer DecoratedOutputTransformPointer
typename OutputTransformType::ScalarType RealType
std::vector< FixedImageMaskConstPointer > FixedImageMasksContainerType
virtual VirtualImageBaseConstPointer GetCurrentLevelVirtualDomainImage()
TMovingImage MovingImageType
void SetNumberOfLevels(const SizeValueType)
typename VirtualImageType::Pointer VirtualImagePointer
virtual const PointSetType * GetFixedPointSet() const
typename FixedImageType::ConstPointer FixedImageConstPointer
virtual void SetFixedPointSet(const PointSetType *pointSet)
typename FixedImageMaskType::ConstPointer FixedImageMaskConstPointer
static void MakeOutputTransform(SmartPointer< InitialTransformType > &ptr)
typename CompositeTransformType::Pointer CompositeTransformPointer
typename VirtualImageBaseType::ConstPointer VirtualImageBaseConstPointer
virtual DecoratedOutputTransformType * GetOutput()
std::vector< PointSetConstPointer > PointSetsContainerType
void SetOptimizerWeights(OptimizerWeightsType &)
virtual OutputTransformType * GetModifiableTransform()
typename TransformParametersAdaptorType::Pointer TransformParametersAdaptorPointer
~ImageRegistrationMethodv4() override=default
const TransformParametersAdaptorsContainerType & GetTransformParametersAdaptorsPerLevel() const
static void MakeOutputTransform(SmartPointer< TTransform > &ptr)
virtual const MovingImageType * GetMovingImage(SizeValueType) const
typename FixedImageType::Pointer FixedImagePointer
virtual void SetMovingPointSet(SizeValueType, const PointSetType *)
void SetMetricSamplingPercentage(const RealType)
virtual void SetFixedImage(const FixedImageType *image)
virtual const PointSetType * GetFixedPointSet(SizeValueType) const
virtual const FixedImageType * GetFixedImage(SizeValueType) const
std::vector< MovingImageConstPointer > MovingImagesContainerType
void SetShrinkFactorsPerLevel(ShrinkFactorsArrayType factors)
virtual void SetMetricSamplingPercentagePerLevel(const MetricSamplingPercentageArrayType &samplingPercentages)
virtual void SetFixedPointSet(SizeValueType, const PointSetType *)
virtual DecoratedOutputTransformType * GetTransformOutput()
TVirtualImage VirtualImageType
DataObjectPointer MakeOutput(DataObjectPointerArraySizeType) override
Make a DataObject of the correct type to used as the specified output.
virtual const PointSetType * GetMovingPointSet() const
void MetricSamplingReinitializeSeed(int seed)
virtual void SetMetricSamplePoints()
std::vector< FixedImageConstPointer > FixedImagesContainerType
virtual void SetMovingImage(const MovingImageType *image)
typename OptimizerType::Pointer OptimizerPointer
void GenerateData() override
typename MovingImageMaskType::ConstPointer MovingImageMaskConstPointer
virtual void AllocateOutputs()
typename ImageMetricType::MovingImageMaskType MovingImageMaskType
virtual const MovingImageType * GetMovingImage() const
typename InitialTransformType::Pointer InitialTransformPointer
typename MovingImageType::Pointer MovingImagePointer
typename ImageMetricType::FixedImageMaskType FixedImageMaskType
void InitializeCenterOfLinearOutputTransform()
typename MetricType::Pointer MetricPointer
ImageRegistrationMethodv4()
typename OptimizerType::ScalesType OptimizerWeightsType
virtual const OutputTransformType * GetTransform() const
TOutputTransform OutputTransformType
virtual const PointSetType * GetMovingPointSet(SizeValueType) const
void MetricSamplingReinitializeSeed()
typename OutputTransformType::DerivativeType DerivativeType
TFixedImage FixedImageType
void SetShrinkFactorsPerDimension(unsigned int level, ShrinkFactorsPerDimensionContainerType factors)
ShrinkFactorsPerDimensionContainerType GetShrinkFactorsPerDimension(const unsigned int level) const
void SetTransformParametersAdaptorsPerLevel(TransformParametersAdaptorsContainerType &)
Control indentation during Print() invocation.
Light weight base class for most itk classes.
Base class for all object-to-object similarity metrics added in ITKv4.
This class takes one ore more ObjectToObject metrics and assigns weights to their derivatives to comp...
Abstract base for object-to-object optimizers.
Generic representation for an optimization method.
Computes similarity between two point sets.
A superclass of the N-dimensional mesh structure; supports point (geometric coordinate and attribute)...
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
Reduce the size of an image by an integer factor in each dimension.
ObjectType * GetPointer() const noexcept
Implementation of the composite pattern.
A templated class holding a n-Dimensional vector.
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, typename AnatomicalOrientation::CoordinateEnum value)
class ITK_FORWARD_EXPORT ProcessObject
unsigned long SizeValueType