go home Home | Main Page | Topics | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
Loading...
Searching...
No Matches
elastix::ImpactMetric< TElastix > Class Template Reference

#include <elxImpactMetric.h>

Detailed Description

template<typename TElastix>
class elastix::ImpactMetric< TElastix >

A metric based on itk::ImpactImageToImageMetric.

This metric compares semantic features extracted from one or more pretrained TorchScript models applied to both the fixed and moving images. Feature vectors are compared using a configurable distance, such as L1, L2, NCC, Cosine, Dice, or L1Cosine.

Minimal Example

Example configuration for a single model and for one resolution 0:

(ImpactModelsPath0 "/Data/Models/TS/M291_1_Layers.pt")
(ImpactDimension0 3)
(ImpactNumberOfChannels0 1)
(ImpactPatchSize0 5 5 5)
(ImpactVoxelSize0 1.5 1.5 1.5)
(ImpactLayersMask0 "1")
(ImpactSubsetFeatures0 32)
(ImpactPCA0 0)
(ImpactDistance0 "L2")
(ImpactLayersWeight0 1)
(ImpactMode "Jacobian")
(ImpactGPU 0)
(ImpactUseMixedPrecision "true")
(ImpactFeaturesMapUpdateInterval -1)
(ImpactWriteFeatureMaps "false")

Parameter Descriptions

The following parameters can be configured independently for each resolution level, using the corresponding index (e.g., ImpactPatchSize0 for level 0, ImpactPatchSize1 for level 1, etc

Parameters
ImpactModelsPathPath to TorchScript model used for feature extraction.
ImpactDimensionDefines the dimensionality of the input expected by the TorchScript model.
  • 2 for 2D models (e.g., SAM2.1, DINOv2)
  • 3 for 3D models (e.g., TotalSegmentator, Anatomix, MIND).
ImpactNumberOfChannelsSpecifies the number of channels in the input images for each model.
  • 1 for grayscale medical images (e.g., TotalSegmentator, Anatomix, MIND)
  • 3 for RGB-based models (e.g., SAM2.1, DINOv2)
ImpactPatchSizeThe size of the patch used for feature extraction.
  • X Y Z for 3D models
  • X Y for 2D models If not all dimensions are specified, the first value is used to fill in missing dimensions (e.g., 5 becomes 5 5 5 for 3D).
ImpactVoxelSizeDefines the physical spacing of the voxels (in millimeters).
  • X Y Z for 3D models
  • X Y for 2D models Use consistent voxel sizes to avoid inconsistencies during image pyramid processing.
ImpactLayersMaskBinary string indicating which output layers of the model to include in the similarity computation. Example: "00000001" selects only the last layer.
ImpactModeDefines how features are computed:
  • "Static": Features are computed once per image and resolution level.
  • "Jacobian": Features are computed at each iteration with backpropagation through the model.
ImpactSubsetFeaturesNumber of feature channels randomly selected per voxel at each iteration.
ImpactLayersWeightThe relative importance of each layer in the similarity score.
ImpactGPUSpecifies the GPU device index, or -1 for CPU execution.
ImpactUseMixedPrecisionEnables or disables the use of mixed precision (float16 and float32). Recommended to be disabled on CPU.
ImpactPCANumber of principal components to retain for dimensionality reduction. Set to 0 to disable.
ImpactDistanceSpecifies the distance metric to compare feature vectors. Supported values: L1, L2, Cosine, L1Cosine, Dice, NCC, DotProduct.
ImpactFeaturesMapUpdateIntervalControls how often feature maps are recomputed in "Static" mode.
  • Set to -1 to compute once per resolution level.
  • Set to a positive integer to recompute every N iterations.
ImpactWriteFeatureMapsEnables saving both the input images and feature maps to disk (in Static mode).

Advanced Use: Multi-resolution and Multi-model Setup

IMPACT supports parallel use of multiple models and per-resolution customization. The following example illustrates the configuration for two resolution levels: level 0 and level 1

(ImpactModelsPath0 "/Data/Models/TS/M291_1_Layers.pt")
(ImpactModelsPath1 "/Data/Models/SAM/Tiny_2_Layers.pt")
(ImpactDimension0 3)
(ImpactDimension1 2)
(ImpactNumberOfChannels0 1)
(ImpactNumberOfChannels1 3)
(ImpactPatchSize0 5 5 5)
(ImpactPatchSize1 29 29 29)
(ImpactVoxelSize0 3 3 3)
(ImpactVoxelSize1 1.5 1.5 1.5)
(ImpactLayersMask0 "1")
(ImpactLayersMask1 "01")
(ImpactPCA0 0)
(ImpactPCA1 3)
(ImpactSubsetFeatures0 32)
(ImpactSubsetFeatures1 3)
(ImpactDistance0 "L2")
(ImpactDistance1 "L1")
(ImpactLayersWeight0 1)
(ImpactLayersWeight1 1)
(ImpactMode "Static" "Jacobian")
(ImpactGPU 0 0)
(ImpactUseMixedPrecision "true" "true")
(ImpactFeaturesMapUpdateInterval -1 -1)
(ImpactWriteFeatureMaps "false" "false")

Multi-model Setup: You can assign multiple models in parallel at a given resolution level by providing space-separated lists for each parameter. In the following example, a 3D model with 8 output layers and a 3D MIND model are both used at resolution level 0. Each entry in the lists corresponds to one of the two models

(ImpactModelsPath0 "/Models/M850_8_Layers.pt" "/Models/MIND/R1D2.pt")
(ImpactDimension0 3 3)
(ImpactNumberOfChannels0 1 1)
(ImpactPatchSize0 5 5 5 7 7 7)
(ImpactVoxelSize0 1.5 1.5 1.5 6 6 6)
(ImpactLayersMask0 "00000001" "1")
(ImpactPCA0 0 0)
(ImpactSubsetFeatures0 64 16)
(ImpactDistance0 "Dice" "L2")
(ImpactLayersWeight0 1.0 0.5)

Fixed and Moving-Specific Models: Assign different models to the fixed and moving images:

(FixedModelsPath0 "/Models/TS/M850_8_Layers.pt")
(MovingModelsPath0 "/Models/MIND/R1D2.pt")

This allows asymmetric model configurations for different image modalities or anatomical content.

Author
V. Boussot, Univ. Rennes, INSERM, LTSI- UMR 1099, F-35000 Rennes, France
Note
This work was funded by the French National Research Agency as part of the VATSop project (ANR-20-CE19-0015).
If you use the Impact anywhere we would appreciate if you cite the following article:
V. Boussot et al., IMPACT: A Generic Semantic Loss for Multimodal Medical Image Registration, arXiv preprint arXiv:2503.24121 (2025). https://doi.org/10.48550/arXiv.2503.24121

Definition at line 179 of file elxImpactMetric.h.

Inheritance diagram for elastix::ImpactMetric< TElastix >:

Public Types

using ConstPointer = itk::SmartPointer<const Self>
using ITKBaseType = typename Superclass2::ITKBaseType
using Pointer = itk::SmartPointer<Self>
using Self = ImpactMetric
using Superclass1
using Superclass2 = MetricBase<TElastix>
Public Types inherited from itk::ImpactImageToImageMetric< TFixedImage, TMovingImage >
using ConstPointer = SmartPointer<const Self>
using DerivativeValueType
using FixedImageLimiterOutputType
using FixedImageLimiterType
using FixedImageMaskPointer
using FixedImageMaskType
using FixedImagePixelType
using ImageSampleContainerPointer
using ImageSampleContainerType
using ImageSamplerPointer
using ImageSamplerType
using MovingImageDerivativeScalesType
using MovingImageLimiterOutputType
using MovingImageLimiterType
using MovingImageMaskPointer
using MovingImageMaskType
using MovingImageRegionType
using NumberOfParametersType
using Pointer = SmartPointer<Self>
using Self = ImpactImageToImageMetric
using Superclass = AdvancedImageToImageMetric<TFixedImage, TMovingImage>
using ThreadInfoType
Public Types inherited from itk::AdvancedImageToImageMetric< TFixedImage, TMovingImage >
using AdvancedTransformType = AdvancedTransform<ScalarType, FixedImageDimension, MovingImageDimension>
using BSplineOrder1TransformPointer = typename BSplineOrder1TransformType::Pointer
using BSplineOrder1TransformType = AdvancedBSplineDeformableTransform<ScalarType, FixedImageDimension, 1>
using BSplineOrder2TransformPointer = typename BSplineOrder2TransformType::Pointer
using BSplineOrder2TransformType = AdvancedBSplineDeformableTransform<ScalarType, FixedImageDimension, 2>
using BSplineOrder3TransformPointer = typename BSplineOrder3TransformType::Pointer
using BSplineOrder3TransformType = AdvancedBSplineDeformableTransform<ScalarType, FixedImageDimension, 3>
using CombinationTransformType = AdvancedCombinationTransform<ScalarType, FixedImageDimension>
using ConstPointer = SmartPointer<const Self>
using DerivativeValueType = typename DerivativeType::ValueType
using FixedImageLimiterOutputType = typename FixedImageLimiterType::OutputType
using FixedImageLimiterPointer = typename FixedImageLimiterType::Pointer
using FixedImageLimiterType = LimiterFunctionBase<RealType, FixedImageDimension>
using FixedImageMaskConstPointer = SmartPointer<const FixedImageMaskType>
using FixedImageMaskPointer = SmartPointer<FixedImageMaskType>
using FixedImageMaskType = ImageMaskSpatialObject<Self::FixedImageDimension>
using FixedImagePixelType = typename FixedImageType::PixelType
using FixedImagePointer = typename FixedImageType::Pointer
using ImageSampleContainerPointer = typename ImageSamplerType::OutputVectorContainerPointer
using ImageSampleContainerType = typename ImageSamplerType::OutputVectorContainerType
using ImageSamplerPointer = typename ImageSamplerType::Pointer
using ImageSamplerType = ImageSamplerBase<FixedImageType>
using MovingImageDerivativeScalesType = FixedArray<double, Self::MovingImageDimension>
using MovingImageLimiterOutputType = typename MovingImageLimiterType::OutputType
using MovingImageLimiterPointer = typename MovingImageLimiterType::Pointer
using MovingImageLimiterType = LimiterFunctionBase<RealType, MovingImageDimension>
using MovingImageMaskConstPointer = SmartPointer<const MovingImageMaskType>
using MovingImageMaskPointer = SmartPointer<MovingImageMaskType>
using MovingImageMaskType = ImageMaskSpatialObject<Self::MovingImageDimension>
using MovingImagePointer = typename MovingImageType::Pointer
using MovingImageRegionType = typename MovingImageType::RegionType
using NumberOfParametersType = typename AdvancedTransformType::NumberOfParametersType
using Pointer = SmartPointer<Self>
using ScalarType = typename TransformType::ScalarType
using Self = AdvancedImageToImageMetric
using Superclass = ImageToImageMetric<TFixedImage, TMovingImage>
using ThreadInfoType = MultiThreaderBase::WorkUnitInfo
Public Types inherited from elastix::MetricBase< TElastix >
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

Public Member Functions

void AfterEachIteration () override
void BeforeEachResolution () override
void BeforeRegistration () override
 elxClassNameMacro ("Impact")
void Initialize () override
 ITK_DISALLOW_COPY_AND_MOVE (ImpactMetric)
 itkOverrideGetNameOfClassMacro (ImpactMetric)
 itkStaticConstMacro (FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
 itkStaticConstMacro (MovingImageDimension, unsigned int, MovingImageType::ImageDimension)
Public Member Functions inherited from itk::ImpactImageToImageMetric< TFixedImage, TMovingImage >
virtual const char * GetClassName () const
virtual unsigned int GetCurrentLevel () const
void GetDerivative (const ParametersType &parameters, DerivativeType &derivative) const override
virtual torch::Device GetDevice () const
virtual std::vector< std::string > GetDistance () const
virtual std::string GetFeatureMapsPath () const
virtual int GetFeaturesMapUpdateInterval () const
virtual const std::vector< ImpactModelConfiguration > & GetFixedModelsConfiguration ()
virtual std::vector< floatGetLayersWeight () const
virtual std::string GetMode () const
virtual const std::vector< ImpactModelConfiguration > & GetMovingModelsConfiguration ()
virtual std::vector< unsigned intGetPCA () const
virtual unsigned int GetSeed () const
virtual std::vector< unsigned intGetSubsetFeatures () const
virtual bool GetUseMixedPrecision () const
MeasureType GetValue (const ParametersType &parameters) const override
void GetValueAndDerivative (const ParametersType &parameters, MeasureType &value, DerivativeType &derivative) const override
void GetValueAndDerivativeSingleThreaded (const ParametersType &parameters, MeasureType &value, DerivativeType &derivative) const
virtual MeasureType GetValueSingleThreaded (const ParametersType &parameters) const
virtual bool GetWriteFeatureMaps () const
void Initialize () override
 ITK_DISALLOW_COPY_AND_MOVE (ImpactImageToImageMetric)
 itkStaticConstMacro (FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
 itkStaticConstMacro (MovingImageDimension, unsigned int, MovingImageType::ImageDimension)
virtual void SetCurrentLevel (unsigned int _arg)
virtual void SetDevice (torch::Device _arg)
virtual void SetDistance (std::vector< std::string > _arg)
virtual void SetFeatureMapsPath (std::string _arg)
virtual void SetFeaturesMapUpdateInterval (int _arg)
virtual void SetFixedModelsConfiguration (std::vector< ImpactModelConfiguration > _arg)
virtual void SetLayersWeight (std::vector< float > _arg)
virtual void SetMode (std::string _arg)
virtual void SetMovingModelsConfiguration (std::vector< ImpactModelConfiguration > _arg)
virtual void SetPCA (std::vector< unsigned int > _arg)
virtual void SetSeed (unsigned int _arg)
virtual void SetSubsetFeatures (std::vector< unsigned int > _arg)
virtual void SetUseMixedPrecision (bool _arg)
virtual void SetWriteFeatureMaps (bool _arg)
Public Member Functions inherited from itk::AdvancedImageToImageMetric< TFixedImage, TMovingImage >
virtual void BeforeThreadedGetValueAndDerivative (const TransformParametersType &parameters) const
virtual const FixedImageLimiterTypeGetFixedImageLimiter ()
const FixedImageMaskTypeGetFixedImageMask () const override
virtual double GetFixedLimitRangeRatio () const
ImageSamplerTypeGetImageSampler () const
virtual const MovingImageDerivativeScalesTypeGetMovingImageDerivativeScales ()
virtual const MovingImageLimiterTypeGetMovingImageLimiter ()
const MovingImageMaskTypeGetMovingImageMask () const override
virtual double GetMovingLimitRangeRatio () const
virtual double GetRequiredRatioOfValidSamples () const
virtual bool GetScaleGradientWithRespectToMovingImageOrientation () const
const AdvancedTransformTypeGetTransform () const override
AdvancedTransformTypeGetTransform () override
virtual bool GetUseFixedImageLimiter () const
virtual bool GetUseImageSampler () const
virtual const boolGetUseMetricSingleThreaded ()
virtual bool GetUseMovingImageDerivativeScales () const
virtual bool GetUseMovingImageLimiter () const
virtual const boolGetUseMultiThread ()
void Initialize () override
 ITK_DISALLOW_COPY_AND_MOVE (AdvancedImageToImageMetric)
 itkOverrideGetNameOfClassMacro (AdvancedImageToImageMetric)
 itkStaticConstMacro (FixedImageDimension, unsigned int, TFixedImage::ImageDimension)
 itkStaticConstMacro (MovingImageDimension, unsigned int, TMovingImage::ImageDimension)
virtual void SetFixedImageLimiter (FixedImageLimiterType *_arg)
virtual void SetFixedImageMask (const FixedImageMaskType *const arg)
virtual void SetFixedLimitRangeRatio (double _arg)
virtual void SetImageSampler (ImageSamplerType *_arg)
virtual void SetMovingImageDerivativeScales (MovingImageDerivativeScalesType _arg)
virtual void SetMovingImageLimiter (MovingImageLimiterType *_arg)
virtual void SetMovingImageMask (const MovingImageMaskType *const arg)
virtual void SetMovingLimitRangeRatio (double _arg)
void SetRandomVariateGenerator (Statistics::MersenneTwisterRandomVariateGenerator &randomVariateGenerator)
virtual void SetRequiredRatioOfValidSamples (double _arg)
virtual void SetScaleGradientWithRespectToMovingImageOrientation (bool _arg)
virtual void SetTransform (AdvancedTransformType *arg)
virtual void SetUseMetricSingleThreaded (bool _arg)
virtual void SetUseMovingImageDerivativeScales (bool _arg)
virtual void SetUseMultiThread (bool _arg)
virtual void UseMetricSingleThreadedOff ()
virtual void UseMetricSingleThreadedOn ()
virtual void UseMultiThreadOff ()
virtual void UseMultiThreadOn ()
Public Member Functions inherited from elastix::MetricBase< TElastix >
void AfterEachIterationBase () override
void BeforeEachResolutionBase () override
void BeforeRegistrationBase () override
virtual ImageSamplerBaseTypeGetAdvancedMetricImageSampler () const
virtual bool GetAdvancedMetricUseImageSampler () const
ITKBaseTypeGetAsITKBaseType ()
const ITKBaseTypeGetAsITKBaseType () const
virtual MeasureType GetCurrentExactMetricValue () const
virtual bool GetShowExactMetricValue () const
 ITK_DISALLOW_COPY_AND_MOVE (MetricBase)
 itkOverrideGetNameOfClassMacro (MetricBase)
 itkStaticConstMacro (FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
 itkStaticConstMacro (MovingImageDimension, unsigned int, MovingImageType::ImageDimension)
virtual void SelectNewSamples ()
virtual void SetAdvancedMetricImageSampler (ImageSamplerBaseType *sampler)
Public Member Functions inherited from elastix::BaseComponentSE< TElastix >
void AddTargetCellToIterationInfo (const char *const name)
const ConfigurationGetConfiguration () const
ElastixTypeGetElastix () const
auto & GetIterationInfoAt (const char *const name)
itk::Statistics::MersenneTwisterRandomVariateGenerator & GetRandomVariateGenerator ()
RegistrationTypeGetRegistration () const
 ITK_DISALLOW_COPY_AND_MOVE (BaseComponentSE)
void RemoveTargetCellFromIterationInfo (const char *const name)
void SetConfiguration (const Configuration *_arg)
void SetElastix (ElastixType *_arg)
Public Member Functions inherited from elastix::BaseComponent
virtual void AfterEachResolution ()
virtual void AfterEachResolutionBase ()
virtual void AfterRegistration ()
virtual void AfterRegistrationBase ()
virtual int BeforeAll ()
virtual int BeforeAllBase ()
virtual const char * elxGetClassName () const
const char * GetComponentLabel () const
 ITK_DISALLOW_COPY_AND_MOVE (BaseComponent)
 itkVirtualGetNameOfClassMacro (BaseComponent)
void SetComponentLabel (const char *label, unsigned int idx)

Static Public Member Functions

static Pointer New ()
Static Public Member Functions inherited from itk::ImpactImageToImageMetric< TFixedImage, TMovingImage >
static Pointer New ()
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 ()

Protected Member Functions

 ImpactMetric ()=default
 ~ImpactMetric () override=default
Protected Member Functions inherited from itk::ImpactImageToImageMetric< TFixedImage, TMovingImage >
void AfterThreadedGetValue (MeasureType &value) const override
void AfterThreadedGetValueAndDerivative (MeasureType &value, DerivativeType &derivative) const override
unsigned int ComputeValue (const std::vector< FixedImagePointType > &fixedPoints, LossPerThreadStruct &loss) const
unsigned int ComputeValueAndDerivativeJacobian (const std::vector< FixedImagePointType > &fixedPoints, LossPerThreadStruct &loss) const
unsigned int ComputeValueAndDerivativeStatic (const std::vector< FixedImagePointType > &fixedPoints, LossPerThreadStruct &loss) const
unsigned int ComputeValueStatic (const std::vector< FixedImagePointType > &fixedPoints, LossPerThreadStruct &loss) const
 ImpactImageToImageMetric ()
void InitializeThreadingParameters () const override
bool SampleCheck (const FixedImagePointType &fixedImageCenterCoordinate) const
bool SampleCheck (const FixedImagePointType &fixedImageCenterCoordinate, const std::vector< std::vector< float > > &patchIndex) const
void ThreadedGetValue (ThreadIdType threadID) const override
void ThreadedGetValueAndDerivative (ThreadIdType threadID) const override
void UpdateFixedFeaturesMaps ()
void UpdateMovingFeaturesMaps ()
 ~ImpactImageToImageMetric () override=default
Protected Member Functions inherited from itk::AdvancedImageToImageMetric< TFixedImage, TMovingImage >
 AdvancedImageToImageMetric ()
void CheckForAdvancedTransform ()
void CheckForBSplineInterpolator ()
void CheckForBSplineTransform () const
void CheckNumberOfSamples () const
virtual bool EvaluateMovingImageValueAndDerivative (const MovingImagePointType &mappedPoint, RealType &movingImageValue, MovingImageDerivativeType *gradient) const
bool EvaluateTransformJacobian (const FixedImagePointType &fixedImagePoint, TransformJacobianType &jacobian, NonZeroJacobianIndicesType &nzji) const
virtual void EvaluateTransformJacobianInnerProduct (const TransformJacobianType &jacobian, const MovingImageDerivativeType &movingImageDerivative, DerivativeType &imageJacobian) const
bool FastEvaluateMovingImageValueAndDerivative (const MovingImagePointType &mappedPoint, RealType &movingImageValue, MovingImageDerivativeType *gradient, const ThreadIdType threadId) const
Statistics::MersenneTwisterRandomVariateGenerator & GetMutableRandomVariateGenerator () const
Statistics::MersenneTwisterRandomVariateGenerator & GetRandomVariateGenerator ()
virtual void InitializeImageSampler ()
void InitializeLimiters ()
virtual bool IsInsideMovingMask (const MovingImagePointType &point) const
 itkAlignedTypedef (ITK_CACHE_LINE_ALIGNMENT, PaddedGetValueAndDerivativePerThreadStruct, AlignedGetValueAndDerivativePerThreadStruct)
 itkPadStruct (ITK_CACHE_LINE_ALIGNMENT, GetValueAndDerivativePerThreadStruct, PaddedGetValueAndDerivativePerThreadStruct)
void LaunchGetValueAndDerivativeThreaderCallback () const
void LaunchGetValueThreaderCallback () const
void PrintSelf (std::ostream &os, Indent indent) const override
void SetFixedImageMask (const typename Superclass::FixedImageMaskType *) final
void SetFixedImageMask (typename Superclass::FixedImageMaskType *) final
void SetMovingImageMask (const typename Superclass::MovingImageMaskType *) final
void SetMovingImageMask (typename Superclass::MovingImageMaskType *) final
virtual void SetUseFixedImageLimiter (bool _arg)
virtual void SetUseImageSampler (bool _arg)
virtual void SetUseMovingImageLimiter (bool _arg)
MovingImagePointType TransformPoint (const FixedImagePointType &fixedImagePoint) const
 ~AdvancedImageToImageMetric () override=default
Protected Member Functions inherited from elastix::MetricBase< TElastix >
virtual MeasureType GetExactValue (const ParametersType &parameters)
 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

unsigned long m_CurrentIteration
Protected Attributes inherited from itk::AdvancedImageToImageMetric< TFixedImage, TMovingImage >
AdvancedTransformType::Pointer m_AdvancedTransform { nullptr }
FixedImageLimiterOutputType m_FixedImageMaxLimit { 1 }
FixedImageLimiterOutputType m_FixedImageMinLimit { 0 }
FixedImagePixelType m_FixedImageTrueMax { 1 }
FixedImagePixelType m_FixedImageTrueMin { 0 }
double m_FixedLimitRangeRatio { 0.01 }
std::unique_ptr< AlignedGetValueAndDerivativePerThreadStruct[]> m_GetValueAndDerivativePerThreadVariables
ThreadIdType m_GetValueAndDerivativePerThreadVariablesSize { 0 }
ImageSamplerPointer m_ImageSampler { nullptr }
MovingImageLimiterOutputType m_MovingImageMaxLimit { 1 }
MovingImageLimiterOutputType m_MovingImageMinLimit { 0 }
MovingImagePixelType m_MovingImageTrueMax { 1 }
MovingImagePixelType m_MovingImageTrueMin { 0 }
double m_MovingLimitRangeRatio { 0.01 }
MultiThreaderParameterType m_ThreaderMetricParameters {}
bool m_TransformIsBSpline { false }
bool m_UseMetricSingleThreaded { true }
bool m_UseMultiThread { false }
Protected Attributes inherited from elastix::MetricBase< TElastix >
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 {}
RegistrationTypem_Registration {}

Private Member Functions

std::vector< itk::ImpactModelConfigurationGenerateModelsConfiguration (unsigned int level, std::string type, std::string mode, unsigned int imageDimension, bool useMixedPrecision)

Private Attributes

 elxOverrideGetSelfMacro

Additional Inherited Members

Protected Types inherited from itk::ImpactImageToImageMetric< TFixedImage, TMovingImage >
using BSplineInterpolatorType
using FixedImageIndexType
using FixedImageIndexValueType
using FixedImagePointType
using MovingImageContinuousIndexType
using MovingImageDerivativeType
using MovingImageIndexType
using MovingImagePointType
using NonZeroJacobianIndicesType
Protected Types inherited from itk::AdvancedImageToImageMetric< TFixedImage, TMovingImage >
using BSplineInterpolatorFloatPointer = typename BSplineInterpolatorFloatType::Pointer
using BSplineInterpolatorFloatType
using BSplineInterpolatorPointer = typename BSplineInterpolatorType::Pointer
using BSplineInterpolatorType
using FixedImageIndexType = typename FixedImageType::IndexType
using FixedImageIndexValueType = typename FixedImageIndexType::IndexValueType
using FixedImagePointType = typename TransformType::InputPointType
using LinearInterpolatorPointer = typename LinearInterpolatorType::Pointer
using LinearInterpolatorType = AdvancedLinearInterpolateImageFunction<MovingImageType, CoordinateRepresentationType>
using MovingImageContinuousIndexType = typename InterpolatorType::ContinuousIndexType
using MovingImageDerivativeType = typename BSplineInterpolatorType::CovariantVectorType
using MovingImageIndexType = typename MovingImageType::IndexType
using MovingImagePointType = typename TransformType::OutputPointType
using NonZeroJacobianIndicesType = typename AdvancedTransformType::NonZeroJacobianIndicesType
using ReducedBSplineInterpolatorPointer = typename ReducedBSplineInterpolatorType::Pointer
using ReducedBSplineInterpolatorType
Protected Types inherited from elastix::MetricBase< TElastix >
using ExactMetricImageSamplerPointer = typename ExactMetricImageSamplerType::Pointer
using ExactMetricImageSamplerType = itk::ImageGridSampler<FixedImageType>
using ExactMetricSampleGridSpacingType = typename ExactMetricImageSamplerType::SampleGridSpacingType
using ParametersType = typename ITKBaseType::ParametersType
Static Protected Member Functions inherited from itk::AdvancedImageToImageMetric< TFixedImage, TMovingImage >
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION AccumulateDerivativesThreaderCallback (void *arg)
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION GetValueAndDerivativeThreaderCallback (void *arg)
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION GetValueThreaderCallback (void *arg)

Member Typedef Documentation

◆ ConstPointer

template<typename TElastix>
using elastix::ImpactMetric< TElastix >::ConstPointer = itk::SmartPointer<const Self>

Definition at line 193 of file elxImpactMetric.h.

◆ ITKBaseType

template<typename TElastix>
using elastix::ImpactMetric< TElastix >::ITKBaseType = typename Superclass2::ITKBaseType

Definition at line 258 of file elxImpactMetric.h.

◆ Pointer

template<typename TElastix>
using elastix::ImpactMetric< TElastix >::Pointer = itk::SmartPointer<Self>

Definition at line 192 of file elxImpactMetric.h.

◆ Self

template<typename TElastix>
using elastix::ImpactMetric< TElastix >::Self = ImpactMetric

Standard ITK-stuff.

Definition at line 188 of file elxImpactMetric.h.

◆ Superclass1

template<typename TElastix>
using elastix::ImpactMetric< TElastix >::Superclass1
Initial value:
typename ElastixType::MovingImageType MovingImageType
A semantic similarity metric for multimodal image registration based on deep learning features.

Definition at line 189 of file elxImpactMetric.h.

◆ Superclass2

template<typename TElastix>
using elastix::ImpactMetric< TElastix >::Superclass2 = MetricBase<TElastix>

Definition at line 191 of file elxImpactMetric.h.

Constructor & Destructor Documentation

◆ ImpactMetric()

template<typename TElastix>
elastix::ImpactMetric< TElastix >::ImpactMetric ( )
protecteddefault

The constructor.

◆ ~ImpactMetric()

template<typename TElastix>
elastix::ImpactMetric< TElastix >::~ImpactMetric ( )
overrideprotecteddefault

The destructor.

Member Function Documentation

◆ AfterEachIteration()

template<typename TElastix>
void elastix::ImpactMetric< TElastix >::AfterEachIteration ( )
overridevirtual

Update the current iteration and refresh feature maps in static mode.

Reimplemented from elastix::BaseComponent.

◆ BeforeEachResolution()

template<typename TElastix>
void elastix::ImpactMetric< TElastix >::BeforeEachResolution ( )
overridevirtual

Do some things before each resolution:

  • Set CheckNumberOfSamples setting
  • Set UseNormalization setting

Reimplemented from elastix::BaseComponent.

◆ BeforeRegistration()

template<typename TElastix>
void elastix::ImpactMetric< TElastix >::BeforeRegistration ( )
overridevirtual

Do some things before registration.

Reimplemented from elastix::BaseComponent.

◆ elxClassNameMacro()

template<typename TElastix>
elastix::ImpactMetric< TElastix >::elxClassNameMacro ( "Impact" )

Name of this class. Use this name in the parameter file to select this specific metric. Example:

(Metric "Impact")

◆ GenerateModelsConfiguration()

template<typename TElastix>
std::vector< itk::ImpactModelConfiguration > elastix::ImpactMetric< TElastix >::GenerateModelsConfiguration ( unsigned int level,
std::string type,
std::string mode,
unsigned int imageDimension,
bool useMixedPrecision )
private

◆ Initialize()

template<typename TElastix>
void elastix::ImpactMetric< TElastix >::Initialize ( )
override

Sets up a timer to measure the initialization time and calls the Superclass' implementation.

◆ ITK_DISALLOW_COPY_AND_MOVE()

template<typename TElastix>
elastix::ImpactMetric< TElastix >::ITK_DISALLOW_COPY_AND_MOVE ( ImpactMetric< TElastix > )

◆ itkOverrideGetNameOfClassMacro()

template<typename TElastix>
elastix::ImpactMetric< TElastix >::itkOverrideGetNameOfClassMacro ( ImpactMetric< TElastix > )

Run-time type information (and related methods).

◆ itkStaticConstMacro() [1/2]

template<typename TElastix>
elastix::ImpactMetric< TElastix >::itkStaticConstMacro ( FixedImageDimension ,
unsigned int ,
FixedImageType::ImageDimension  )

The fixed image dimension.

◆ itkStaticConstMacro() [2/2]

template<typename TElastix>
elastix::ImpactMetric< TElastix >::itkStaticConstMacro ( MovingImageDimension ,
unsigned int ,
MovingImageType::ImageDimension  )

The moving image dimension.

◆ New()

template<typename TElastix>
Pointer elastix::ImpactMetric< TElastix >::New ( )
static

Method for creation through the object factory.

Member Data Documentation

◆ elxOverrideGetSelfMacro

template<typename TElastix>
elastix::ImpactMetric< TElastix >::elxOverrideGetSelfMacro
private

Definition at line 293 of file elxImpactMetric.h.

◆ m_CurrentIteration

template<typename TElastix>
unsigned long elastix::ImpactMetric< TElastix >::m_CurrentIteration
protected

Definition at line 290 of file elxImpactMetric.h.



Generated on 1774142652 for elastix by doxygen 1.15.0 elastix logo