#include <elxMetricBase.h>
This class is the elastix base class for all Metrics.
This class contains the common functionality for all Metrics.
The parameters used in this class are:
ShowExactMetricValue: Flag that can set to "true" or "false". If "true" the metric computes the exact metric value (computed on all voxels rather than on the set of spatial samples) and shows it each iteration. Must be given for each resolution.
example: (ShowExactMetricValue "true" "true" "false")
Default is "false" for all resolutions.
ExactMetricSampleGridSpacing: Set an integer downsampling rate for computing the "exact" metric. Only meaningful if set in combination with the ShowExactMetricValue set to "true". In some cases, it might be an overkill to really compute the exact metric with the ShowExactMetricValue. The metric computed on a downsampled image might already be accurate enough to draw conclusions about the rate of convergence for example. The downsampling rate must be given for each resolution, for each dimension.
example: (ExactMetricSampleGridSpacing 1 1 2 2 )
This example for a 2D registration of 2 resolutions sets the downsampling rate to 1 in the first resolution (so: use really all pixels), and to 2 in the second resolution. Default: 1 in each resolution and each dimension.
CheckNumberOfSamples: Whether the metric checks if at least a certain fraction (default 1/4) of the samples map inside the moving image. Can be given for each resolution or for all resolutions at once.
example: (CheckNumberOfSamples "false" "true" "false")
The default is true. In general it is wise to set this to true, since it detects if the registration is going really bad.
RequiredRatioOfValidSamples: Defines the fraction needed in CheckNumberOfSamples.
example: (RequiredRatioOfValidSamples 0.1)
The default is 0.25.
Definition at line 72 of file elxMetricBase.h.
Public Types | |
using | AdvancedMetricType = itk::AdvancedImageToImageMetric<FixedImageType, MovingImageType> |
using | CoordinateRepresentationType = typename ITKBaseType::ParametersValueType |
using | ElastixType |
using | FixedImageType = typename ElastixType::FixedImageType |
using | FixedPointSetType |
using | FixedPointType = typename FixedImageType::PointType |
using | FixedPointValueType = typename FixedPointType::ValueType |
using | ImageSamplerBaseType = typename AdvancedMetricType::ImageSamplerType |
using | ITKBaseType = itk::SingleValuedCostFunction |
using | MeasureType = typename ITKBaseType::MeasureType |
using | MovingImageDerivativeScalesType = typename AdvancedMetricType::MovingImageDerivativeScalesType |
using | MovingImageType = typename ElastixType::MovingImageType |
using | MovingPointSetType |
using | MovingPointType = typename MovingImageType::PointType |
using | MovingPointValueType = typename MovingPointType::ValueType |
using | RegistrationType |
using | Self = MetricBase |
using | Superclass = BaseComponentSE<TElastix> |
Public Types inherited from elastix::BaseComponentSE< TElastix > | |
using | ElastixType = TElastix |
using | RegistrationType = typename ElastixType::RegistrationBaseType |
using | Self = BaseComponentSE |
using | Superclass = BaseComponent |
Protected Types | |
using | ExactMetricImageSamplerPointer = typename ExactMetricImageSamplerType::Pointer |
using | ExactMetricImageSamplerType = itk::ImageGridSampler<FixedImageType> |
using | ExactMetricSampleGridSpacingType = typename ExactMetricImageSamplerType::SampleGridSpacingType |
using | ParametersType = typename ITKBaseType::ParametersType |
Protected Member Functions | |
virtual MeasureType | GetExactValue (const ParametersType ¶meters) |
MetricBase ()=default | |
~MetricBase () override=default | |
Protected Member Functions inherited from elastix::BaseComponentSE< TElastix > | |
BaseComponentSE ()=default | |
~BaseComponentSE () override=default | |
Protected Member Functions inherited from elastix::BaseComponent | |
BaseComponent ()=default | |
virtual | ~BaseComponent ()=default |
Protected Attributes | |
MeasureType | m_CurrentExactMetricValue { 0.0 } |
unsigned int | m_ExactMetricEachXNumberOfIterations { 1 } |
ExactMetricSampleGridSpacingType | m_ExactMetricSampleGridSpacing |
ExactMetricImageSamplerPointer | m_ExactMetricSampler { nullptr } |
bool | m_ShowExactMetricValue { false } |
Protected Attributes inherited from elastix::BaseComponentSE< TElastix > | |
Configuration::ConstPointer | m_Configuration {} |
itk::WeakPointer< TElastix > | m_Elastix {} |
RegistrationType * | m_Registration {} |
Private Member Functions | |
elxDeclarePureVirtualGetSelfMacro (ITKBaseType) | |
Additional Inherited Members | |
Static Public Member Functions inherited from elastix::BaseComponent | |
template<typename TBaseComponent > | |
static auto | AsITKBaseType (TBaseComponent *const baseComponent) -> decltype(baseComponent->GetAsITKBaseType()) |
static void | InitializeElastixExecutable () |
static bool | IsElastixLibrary () |
using elastix::MetricBase< TElastix >::AdvancedMetricType = itk::AdvancedImageToImageMetric<FixedImageType, MovingImageType> |
Definition at line 98 of file elxMetricBase.h.
using elastix::MetricBase< TElastix >::CoordinateRepresentationType = typename ITKBaseType::ParametersValueType |
Typedefs for point sets.
Definition at line 107 of file elxMetricBase.h.
using elastix::BaseComponentSE< TElastix >::ElastixType |
Elastix typedef.
Definition at line 57 of file elxBaseComponentSE.h.
|
protected |
Definition at line 206 of file elxMetricBase.h.
|
protected |
The full sampler used by the GetExactValue method.
Definition at line 205 of file elxMetricBase.h.
|
protected |
Definition at line 207 of file elxMetricBase.h.
using elastix::MetricBase< TElastix >::FixedImageType = typename ElastixType::FixedImageType |
Other typedef's.
Definition at line 89 of file elxMetricBase.h.
using elastix::MetricBase< TElastix >::FixedPointSetType |
Definition at line 108 of file elxMetricBase.h.
using elastix::MetricBase< TElastix >::FixedPointType = typename FixedImageType::PointType |
Definition at line 90 of file elxMetricBase.h.
using elastix::MetricBase< TElastix >::FixedPointValueType = typename FixedPointType::ValueType |
Definition at line 91 of file elxMetricBase.h.
using elastix::MetricBase< TElastix >::ImageSamplerBaseType = typename AdvancedMetricType::ImageSamplerType |
Typedefs for sampler support.
Definition at line 126 of file elxMetricBase.h.
using elastix::MetricBase< TElastix >::ITKBaseType = itk::SingleValuedCostFunction |
ITKBaseType.
Definition at line 97 of file elxMetricBase.h.
using elastix::MetricBase< TElastix >::MeasureType = typename ITKBaseType::MeasureType |
Return type of GetValue
Definition at line 129 of file elxMetricBase.h.
using elastix::MetricBase< TElastix >::MovingImageDerivativeScalesType = typename AdvancedMetricType::MovingImageDerivativeScalesType |
Definition at line 99 of file elxMetricBase.h.
using elastix::MetricBase< TElastix >::MovingImageType = typename ElastixType::MovingImageType |
Definition at line 92 of file elxMetricBase.h.
using elastix::MetricBase< TElastix >::MovingPointSetType |
Definition at line 116 of file elxMetricBase.h.
using elastix::MetricBase< TElastix >::MovingPointType = typename MovingImageType::PointType |
Definition at line 93 of file elxMetricBase.h.
using elastix::MetricBase< TElastix >::MovingPointValueType = typename MovingPointType::ValueType |
Definition at line 94 of file elxMetricBase.h.
|
protected |
The parameters type.
Definition at line 202 of file elxMetricBase.h.
using elastix::BaseComponentSE< TElastix >::RegistrationType |
RegistrationType; NB: this is the elx::RegistrationBase not an itk::Object or something like that.
Definition at line 62 of file elxBaseComponentSE.h.
using elastix::MetricBase< TElastix >::Self = MetricBase |
Standard ITK stuff.
Definition at line 78 of file elxMetricBase.h.
using elastix::MetricBase< TElastix >::Superclass = BaseComponentSE<TElastix> |
Definition at line 79 of file elxMetricBase.h.
|
protecteddefault |
The constructor.
|
overrideprotecteddefault |
The destructor.
|
overridevirtual |
Execute stuff after each iteration:
Reimplemented from elastix::BaseComponent.
|
overridevirtual |
Execute stuff before each resolution:
Reimplemented from elastix::BaseComponent.
|
private |
|
virtual |
Methods to get the image sampler. The image sampler is only used when the metric is of type AdvancedMetricType, and has UseImageSampler set to true. In other cases, the function returns 0.
|
virtual |
Returns whether the metric uses a sampler. When the metric is not of AdvancedMetricType, the function returns false immediately.
|
inline |
Retrieves this object as ITKBaseType.
Definition at line 133 of file elxMetricBase.h.
|
inline |
Retrieves this object as ITKBaseType, to use in const functions.
Definition at line 141 of file elxMetricBase.h.
|
virtual |
Run-time type information (and related methods).
Reimplemented in elastix::AdvancedKappaStatisticMetric< TElastix >, elastix::AdvancedMattesMutualInformationMetric< TElastix >, elastix::AdvancedMeanSquaresMetric< TElastix >, elastix::AdvancedNormalizedCorrelationMetric< TElastix >, elastix::CorrespondingPointsEuclideanDistanceMetric< TElastix >, elastix::DisplacementMagnitudePenalty< TElastix >, elastix::DistancePreservingRigidityPenalty< TElastix >, elastix::GradientDifferenceMetric< TElastix >, elastix::KNNGraphAlphaMutualInformationMetric< TElastix >, elastix::MissingStructurePenalty< TElastix >, elastix::NormalizedGradientCorrelationMetric< TElastix >, elastix::NormalizedMutualInformationMetric< TElastix >, elastix::PatternIntensityMetric< TElastix >, elastix::PCAMetric2< TElastix >, elastix::PCAMetric< TElastix >, elastix::PolydataDummyPenalty< TElastix >, elastix::StatisticalShapePenalty< TElastix >, elastix::SumOfPairwiseCorrelationCoefficientsMetric< TElastix >, elastix::SumSquaredTissueVolumeDifferenceMetric< TElastix >, elastix::TransformBendingEnergyPenalty< TElastix >, elastix::TransformRigidityPenalty< TElastix >, and elastix::VarianceOverLastDimensionMetric< TElastix >.
|
inlinevirtual |
Get the last computed exact metric value
Definition at line 195 of file elxMetricBase.h.
|
protectedvirtual |
Get the exact value. Mutual information computed over all points. It is meant in situations when you optimize using just a subset of pixels, but are interested in the exact value of the metric.
This method only works when the itkYourMetric inherits from the AdvancedMetricType. In other cases it returns 0. You may re-implement this method in the elxYourMetric, if you like.
|
inlinevirtual |
Get if the exact metric value is computed
Definition at line 188 of file elxMetricBase.h.
elastix::MetricBase< TElastix >::ITK_DISALLOW_COPY_AND_MOVE | ( | MetricBase< TElastix > | ) |
elastix::MetricBase< TElastix >::itkStaticConstMacro | ( | FixedImageDimension | , |
unsigned int | , | ||
FixedImageType::ImageDimension | ) |
Get the dimension of the fixed image.
elastix::MetricBase< TElastix >::itkStaticConstMacro | ( | MovingImageDimension | , |
unsigned int | , | ||
MovingImageType::ImageDimension | ) |
Get the dimension of the moving image.
|
virtual |
Force the metric to base its computation on a new subset of image samples. Not every metric may have implemented this.
Reimplemented in elastix::CorrespondingPointsEuclideanDistanceMetric< TElastix >, elastix::MissingStructurePenalty< TElastix >, elastix::PolydataDummyPenalty< TElastix >, elastix::StatisticalShapePenalty< TElastix >, and elastix::TransformRigidityPenalty< TElastix >.
|
virtual |
Method to set the image sampler. The image sampler is only used when the metric is of type AdvancedMetricType, and has UseImageSampler set to true. In other cases, the function does nothing.
|
protected |
Definition at line 230 of file elxMetricBase.h.
|
protected |
Definition at line 233 of file elxMetricBase.h.
|
protected |
Definition at line 231 of file elxMetricBase.h.
|
protected |
Definition at line 229 of file elxMetricBase.h.
|
protected |
Definition at line 228 of file elxMetricBase.h.
Generated on 2024-07-17 for elastix by 1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d) |