ITK  6.0.0
Insight Toolkit
Classes | Public Types | Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Attributes | List of all members

#include <itkImageToImageMetric.h>

Detailed Description

template<typename TFixedImage, typename TMovingImage>
class itk::ImageToImageMetric< TFixedImage, TMovingImage >

Computes similarity between regions of two images.

This Class is templated over the type of the two input images. It expects a Transform and an Interpolator to be plugged in. This particular class is the base class for a hierarchy of similarity metrics.

This class computes a value that measures the similarity between the Fixed image and the transformed Moving image. The Interpolator is used to compute intensity values on non-grid positions resulting from mapping points through the Transform.

Definition at line 54 of file itkImageToImageMetric.h.

+ Inheritance diagram for itk::ImageToImageMetric< TFixedImage, TMovingImage >:
+ Collaboration diagram for itk::ImageToImageMetric< TFixedImage, TMovingImage >:

Classes

class  ConstantPointerWrapper
 
class  FixedImageSamplePoint
 
class  MultiThreaderWorkUnitInfoImageToImageMetricWrapper
 

Public Types

using ConstPointer = SmartPointer< const Self >
 
using CoordinateRepresentationType = typename Superclass::ParametersValueType
 
using FixedImageConstPointer = typename FixedImageType::ConstPointer
 
using FixedImageIndexContainer = std::vector< FixedImageIndexType >
 
using FixedImageIndexType = typename FixedImageType::IndexType
 
using FixedImageIndexValueType = typename FixedImageIndexType::IndexValueType
 
using FixedImageMaskConstPointer = typename FixedImageMaskType::ConstPointer
 
using FixedImageMaskPointer = typename FixedImageMaskType::Pointer
 
using FixedImageMaskType = SpatialObject< Self::FixedImageDimension >
 
using FixedImagePixelType = typename TFixedImage::PixelType
 
using FixedImagePointType = typename TransformType::InputPointType
 
using FixedImageRegionType = typename FixedImageType::RegionType
 
using FixedImageType = TFixedImage
 
using GradientImageFilterPointer = typename GradientImageFilterType::Pointer
 
using GradientImageFilterType = GradientRecursiveGaussianImageFilter< MovingImageType, GradientImageType >
 
using GradientImagePointer = SmartPointer< GradientImageType >
 
using GradientImageType = Image< GradientPixelType, Self::MovingImageDimension >
 
using GradientPixelType = CovariantVector< RealType, Self::MovingImageDimension >
 
using InputPointType = typename TransformType::InputPointType
 
using InterpolatorPointer = typename InterpolatorType::Pointer
 
using InterpolatorType = InterpolateImageFunction< MovingImageType, CoordinateRepresentationType >
 
using MovingImageConstPointer = typename MovingImageType::ConstPointer
 
using MovingImageIndexType = typename MovingImageType::IndexType
 
using MovingImageMaskConstPointer = typename MovingImageMaskType::ConstPointer
 
using MovingImageMaskPointer = typename MovingImageMaskType::Pointer
 
using MovingImageMaskType = SpatialObject< Self::MovingImageDimension >
 
using MovingImagePixelType = typename TMovingImage::PixelType
 
using MovingImagePointType = typename TransformType::OutputPointType
 
using MovingImageType = TMovingImage
 
using MultiThreaderType = MultiThreaderBase
 
using OutputPointType = typename TransformType::OutputPointType
 
using Pointer = SmartPointer< Self >
 
using RealType = typename NumericTraits< MovingImagePixelType >::RealType
 
using Self = ImageToImageMetric
 
using Superclass = SingleValuedCostFunction
 
using TransformJacobianType = typename TransformType::JacobianType
 
using TransformParametersType = typename TransformType::ParametersType
 
using TransformPointer = typename TransformType::Pointer
 
using TransformType = Transform< CoordinateRepresentationType, Self::MovingImageDimension, Self::FixedImageDimension >
 
- Public Types inherited from itk::SingleValuedCostFunction
using ConstPointer = SmartPointer< const Self >
 
using DerivativeType = Array< ParametersValueType >
 
using MeasureType = double
 
using ParametersType = Superclass::ParametersType
 
using ParametersValueType = Superclass::ParametersValueType
 
using Pointer = SmartPointer< Self >
 
using Self = SingleValuedCostFunction
 
using Superclass = CostFunction
 
- Public Types inherited from itk::CostFunctionTemplate< TInternalComputationValueType >
using ConstPointer = SmartPointer< const Self >
 
using ParametersType = OptimizerParameters< TInternalComputationValueType >
 
using ParametersValueType = TInternalComputationValueType
 
using Pointer = SmartPointer< Self >
 
using Self = CostFunctionTemplate
 
using Superclass = Object
 
- Public Types inherited from itk::Object
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = Object
 
using Superclass = LightObject
 
- Public Types inherited from itk::LightObject
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = LightObject
 

Public Member Functions

virtual void ComputeGradient ()
 
virtual const FixedImageRegionTypeGetFixedImageRegion () const
 
virtual const FixedImagePixelTypeGetFixedImageSamplesIntensityThreshold () const
 
virtual GradientImageTypeGetModifiableGradientImage ()
 
virtual InterpolatorTypeGetModifiableInterpolator ()
 
virtual TransformTypeGetModifiableTransform ()
 
const char * GetNameOfClass () const override
 
SizeValueType GetNumberOfMovingImageSamples ()
 
unsigned int GetNumberOfParameters () const override
 
virtual const SizeValueTypeGetNumberOfPixelsCounted () const
 
SizeValueType GetNumberOfSpatialSamples ()
 
virtual const bool & GetUseAllPixels () const
 
virtual const bool & GetUseFixedImageIndexes () const
 
virtual const bool & GetUseFixedImageSamplesIntensityThreshold () const
 
virtual const bool & GetUseSequentialSampling () const
 
virtual void Initialize ()
 
virtual void MultiThreadingInitialize ()
 
void SetFixedImageIndexes (const FixedImageIndexContainer &indexes)
 
virtual void SetFixedImageRegion (const FixedImageRegionType reg)
 
void SetFixedImageSamplesIntensityThreshold (const FixedImagePixelType &thresh)
 
virtual void SetInterpolator (InterpolatorType *_arg)
 
void SetNumberOfSpatialSamples (SizeValueType num)
 
virtual void SetTransform (TransformType *_arg)
 
void SetTransformParameters (const ParametersType &parameters) const
 
void SetUseAllPixels (bool useAllPixels)
 
void SetUseFixedImageIndexes (bool useIndexes)
 
void SetUseFixedImageSamplesIntensityThreshold (bool useThresh)
 
void SetUseSequentialSampling (bool useSequential)
 
void UseAllPixelsOff ()
 
void UseAllPixelsOn ()
 
virtual void SetFixedImage (const FixedImageType *_arg)
 
virtual const FixedImageTypeGetFixedImage () const
 
virtual void SetMovingImage (const MovingImageType *_arg)
 
virtual const MovingImageTypeGetMovingImage () const
 
virtual void SetMovingImageMask (const MovingImageMaskType *_arg)
 
virtual const MovingImageMaskTypeGetMovingImageMask () const
 
virtual void SetFixedImageMask (const FixedImageMaskType *_arg)
 
virtual const FixedImageMaskTypeGetFixedImageMask () const
 
void SetNumberOfWorkUnits (ThreadIdType numberOfThreads)
 
virtual const ThreadIdTypeGetNumberOfWorkUnits () const
 
virtual void SetComputeGradient (bool _arg)
 
virtual const bool & GetComputeGradient () const
 
virtual void ComputeGradientOn ()
 
virtual void SetNumberOfFixedImageSamples (SizeValueType numSamples)
 
virtual const SizeValueTypeGetNumberOfFixedImageSamples () const
 
void ReinitializeSeed ()
 
void ReinitializeSeed (int seed)
 
virtual void SetUseCachingOfBSplineWeights (bool _arg)
 
virtual const bool & GetUseCachingOfBSplineWeights () const
 
virtual void UseCachingOfBSplineWeightsOn ()
 
virtual MultiThreaderTypeGetModifiableThreader ()
 
const TransformPointerGetThreaderTransform ()
 
- Public Member Functions inherited from itk::SingleValuedCostFunction
virtual void GetDerivative (const ParametersType &parameters, DerivativeType &derivative) const =0
 
virtual MeasureType GetValue (const ParametersType &parameters) const =0
 
virtual void GetValueAndDerivative (const ParametersType &parameters, MeasureType &value, DerivativeType &derivative) const
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *cmd) const
 
unsigned long AddObserver (const EventObject &event, std::function< void(const EventObject &)> function) const
 
LightObject::Pointer CreateAnother () const override
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
MetaDataDictionaryGetMetaDataDictionary ()
 
const MetaDataDictionaryGetMetaDataDictionary () const
 
virtual ModifiedTimeType GetMTime () const
 
virtual const TimeStampGetTimeStamp () const
 
bool HasObserver (const EventObject &event) const
 
void InvokeEvent (const EventObject &)
 
void InvokeEvent (const EventObject &) const
 
virtual void Modified () const
 
void Register () const override
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag) const
 
void SetDebug (bool debugFlag) const
 
void SetReferenceCount (int) override
 
void UnRegister () const noexcept override
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
void SetMetaDataDictionary (MetaDataDictionary &&rrhs)
 
virtual void SetObjectName (std::string _arg)
 
virtual const std::string & GetObjectName () const
 
- Public Member Functions inherited from itk::LightObject
Pointer Clone () const
 
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
void Print (std::ostream &os, Indent indent=0) const
 

Static Public Attributes

static constexpr unsigned int FixedImageDimension = TFixedImage::ImageDimension
 
static constexpr unsigned int MovingImageDimension = TMovingImage::ImageDimension
 

Protected Types

using BooleanArrayType = std::vector< bool >
 
using BSplineInterpolatorType = BSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType >
 
using BSplineParametersOffsetType = FixedArray< SizeValueType, FixedImageType::ImageDimension >
 
using BSplineTransformIndexArrayType = typename BSplineTransformType::ParameterIndexArrayType
 
using BSplineTransformIndicesArrayType = Array2D< IndexValueType >
 
using BSplineTransformType = BSplineBaseTransform< CoordinateRepresentationType, FixedImageType::ImageDimension, Self::DeformationSplineOrder >
 
using BSplineTransformWeightsArrayType = Array2D< WeightsValueType >
 
using BSplineTransformWeightsType = typename BSplineTransformType::WeightsType
 
using DerivativeFunctionType = CentralDifferenceImageFunction< MovingImageType, CoordinateRepresentationType >
 
using FixedImageSampleContainer = std::vector< FixedImageSamplePoint >
 
using ImageDerivativesType = CovariantVector< double, Self::MovingImageDimension >
 
using IndexValueType = typename BSplineTransformIndexArrayType::ValueType
 
using MovingImagePointArrayType = std::vector< MovingImagePointType >
 
using WeightsValueType = typename BSplineTransformWeightsType::ValueType
 

Protected Member Functions

virtual void ComputeImageDerivatives (const MovingImagePointType &mappedPoint, ImageDerivativesType &gradient, ThreadIdType threadId) const
 
void GetValueAndDerivativeMultiThreadedInitiate () const
 
void GetValueAndDerivativeMultiThreadedPostProcessInitiate () const
 
virtual void GetValueAndDerivativeThread (ThreadIdType threadId) const
 
virtual void GetValueAndDerivativeThreadPostProcess (ThreadIdType, bool) const
 
virtual void GetValueAndDerivativeThreadPreProcess (ThreadIdType, bool) const
 
virtual bool GetValueAndDerivativeThreadProcessSample (ThreadIdType, SizeValueType, const MovingImagePointType &, double, const ImageDerivativesType &) const
 
 ImageToImageMetric ()
 
virtual void PreComputeTransformValues ()
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
virtual void SampleFixedImageIndexes (FixedImageSampleContainer &samples) const
 
virtual void SampleFixedImageRegion (FixedImageSampleContainer &samples) const
 
virtual void SampleFullFixedImageRegion (FixedImageSampleContainer &samples) const
 
virtual void SynchronizeTransforms () const
 
virtual void TransformPoint (unsigned int sampleNumber, MovingImagePointType &mappedPoint, bool &sampleOk, double &movingImageValue, ThreadIdType threadId) const
 
virtual void TransformPointWithDerivatives (unsigned int sampleNumber, MovingImagePointType &mappedPoint, bool &sampleOk, double &movingImageValue, ImageDerivativesType &movingImageGradient, ThreadIdType threadId) const
 
 ~ImageToImageMetric () override=default
 
- Protected Member Functions inherited from itk::SingleValuedCostFunction
 SingleValuedCostFunction ()=default
 
 ~SingleValuedCostFunction () override
 
- Protected Member Functions inherited from itk::CostFunctionTemplate< TInternalComputationValueType >
 CostFunctionTemplate ()=default
 
 ~CostFunctionTemplate () override=default
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &timeStamp)
 
 ~Object () override
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 

Static Protected Member Functions

static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION GetValueAndDerivativeMultiThreaded (void *workunitInfoAsVoid)
 
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION GetValueAndDerivativeMultiThreadedPostProcess (void *workunitInfoAsVoid)
 

Protected Attributes

BSplineInterpolatorType::Pointer m_BSplineInterpolator {}
 
BSplineParametersOffsetType m_BSplineParametersOffset {}
 
MovingImagePointArrayType m_BSplinePreTransformPointsArray {}
 
BSplineTransformType::Pointer m_BSplineTransform {}
 
BSplineTransformIndexArrayType m_BSplineTransformIndices {}
 
BSplineTransformIndicesArrayType m_BSplineTransformIndicesArray {}
 
BSplineTransformWeightsType m_BSplineTransformWeights {}
 
BSplineTransformWeightsArrayType m_BSplineTransformWeightsArray {}
 
bool m_ComputeGradient { true }
 
DerivativeFunctionType::Pointer m_DerivativeCalculator {}
 
FixedImageConstPointer m_FixedImage {}
 
FixedImageIndexContainer m_FixedImageIndexes {}
 
FixedImageMaskConstPointer m_FixedImageMask {}
 
FixedImageSampleContainer m_FixedImageSamples {}
 
FixedImagePixelType m_FixedImageSamplesIntensityThreshold {}
 
GradientImagePointer m_GradientImage {}
 
InterpolatorPointer m_Interpolator {}
 
MovingImageConstPointer m_MovingImage {}
 
MovingImageMaskConstPointer m_MovingImageMask {}
 
SizeValueType m_NumberOfFixedImageSamples { 50000 }
 
SizeValueType m_NumberOfParameters { 0 }
 
SizeValueType m_NumberOfPixelsCounted { 0 }
 
ThreadIdType m_NumberOfWorkUnits { 1 }
 
SizeValueType m_NumBSplineWeights { 0 }
 
int m_RandomSeed {}
 
bool m_ReseedIterator { false }
 
std::unique_ptr< BSplineTransformIndexArrayType[]> m_ThreaderBSplineTransformIndices
 
std::unique_ptr< BSplineTransformWeightsType[]> m_ThreaderBSplineTransformWeights
 
std::unique_ptr< TransformPointer[]> m_ThreaderTransform
 
TransformPointer m_Transform {}
 
bool m_UseAllPixels { false }
 
bool m_UseCachingOfBSplineWeights { true }
 
bool m_UseFixedImageIndexes { false }
 
bool m_UseFixedImageSamplesIntensityThreshold { false }
 
bool m_UseSequentialSampling { false }
 
BooleanArrayType m_WithinBSplineSupportRegionArray {}
 
- Protected Attributes inherited from itk::LightObject
std::atomic< int > m_ReferenceCount {}
 

Static Protected Attributes

static constexpr unsigned int DeformationSplineOrder = 3
 

Private Attributes

FixedImageRegionType m_FixedImageRegion {}
 
MultiThreaderType::Pointer m_Threader {}
 
std::unique_ptr< ConstantPointerWrapperm_ConstSelfWrapper
 
std::unique_ptr< unsigned int[]> m_ThreaderNumberOfMovingImageSamples
 
bool m_WithinThreadPreProcess { false }
 
bool m_WithinThreadPostProcess { false }
 
void GetValueMultiThreadedInitiate () const
 
void GetValueMultiThreadedPostProcessInitiate () const
 
virtual void GetValueThread (ThreadIdType threadId) const
 
virtual void GetValueThreadPreProcess (ThreadIdType, bool) const
 
virtual bool GetValueThreadProcessSample (ThreadIdType, SizeValueType, const MovingImagePointType &, double) const
 
virtual void GetValueThreadPostProcess (ThreadIdType, bool) const
 
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION GetValueMultiThreaded (void *workunitInfoAsVoid)
 
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION GetValueMultiThreadedPostProcess (void *workunitInfoAsVoid)
 

Additional Inherited Members

- Static Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
 
static void GlobalWarningDisplayOff ()
 
static void GlobalWarningDisplayOn ()
 
static Pointer New ()
 
static void SetGlobalWarningDisplay (bool val)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 

Member Typedef Documentation

◆ BooleanArrayType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::BooleanArrayType = std::vector<bool>
protected

Definition at line 498 of file itkImageToImageMetric.h.

◆ BSplineInterpolatorType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::BSplineInterpolatorType = BSplineInterpolateImageFunction<MovingImageType, CoordinateRepresentationType>
protected

If a BSplineInterpolationFunction is used, this class obtain image derivatives from the BSpline interpolator. Otherwise, image derivatives are computed using central differencing.

Definition at line 505 of file itkImageToImageMetric.h.

◆ BSplineParametersOffsetType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::BSplineParametersOffsetType = FixedArray<SizeValueType, FixedImageType::ImageDimension>
protected

Definition at line 499 of file itkImageToImageMetric.h.

◆ BSplineTransformIndexArrayType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::BSplineTransformIndexArrayType = typename BSplineTransformType::ParameterIndexArrayType
protected

Definition at line 493 of file itkImageToImageMetric.h.

◆ BSplineTransformIndicesArrayType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::BSplineTransformIndicesArrayType = Array2D<IndexValueType>
protected

Definition at line 495 of file itkImageToImageMetric.h.

◆ BSplineTransformType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::BSplineTransformType = BSplineBaseTransform<CoordinateRepresentationType, FixedImageType::ImageDimension, Self::DeformationSplineOrder>
protected

Definition at line 487 of file itkImageToImageMetric.h.

◆ BSplineTransformWeightsArrayType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::BSplineTransformWeightsArrayType = Array2D<WeightsValueType>
protected

Definition at line 491 of file itkImageToImageMetric.h.

◆ BSplineTransformWeightsType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::BSplineTransformWeightsType = typename BSplineTransformType::WeightsType
protected

Definition at line 489 of file itkImageToImageMetric.h.

◆ ConstPointer

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::ConstPointer = SmartPointer<const Self>

Definition at line 63 of file itkImageToImageMetric.h.

◆ CoordinateRepresentationType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::CoordinateRepresentationType = typename Superclass::ParametersValueType

Type used for representing point components

Definition at line 66 of file itkImageToImageMetric.h.

◆ DerivativeFunctionType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::DerivativeFunctionType = CentralDifferenceImageFunction<MovingImageType, CoordinateRepresentationType>
protected

Typedefs for using central difference calculator.

Definition at line 508 of file itkImageToImageMetric.h.

◆ FixedImageConstPointer

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::FixedImageConstPointer = typename FixedImageType::ConstPointer

Definition at line 79 of file itkImageToImageMetric.h.

◆ FixedImageIndexContainer

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::FixedImageIndexContainer = std::vector<FixedImageIndexType>

Definition at line 102 of file itkImageToImageMetric.h.

◆ FixedImageIndexType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::FixedImageIndexType = typename FixedImageType::IndexType

Index and Point type alias support

Definition at line 96 of file itkImageToImageMetric.h.

◆ FixedImageIndexValueType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::FixedImageIndexValueType = typename FixedImageIndexType::IndexValueType

Definition at line 97 of file itkImageToImageMetric.h.

◆ FixedImageMaskConstPointer

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::FixedImageMaskConstPointer = typename FixedImageMaskType::ConstPointer

Definition at line 121 of file itkImageToImageMetric.h.

◆ FixedImageMaskPointer

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::FixedImageMaskPointer = typename FixedImageMaskType::Pointer

Definition at line 120 of file itkImageToImageMetric.h.

◆ FixedImageMaskType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::FixedImageMaskType = SpatialObject<Self::FixedImageDimension>

Type for the mask of the fixed image. Only pixels that are "inside" this mask will be considered for the computation of the metric

Definition at line 119 of file itkImageToImageMetric.h.

◆ FixedImagePixelType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::FixedImagePixelType = typename TFixedImage::PixelType

Definition at line 78 of file itkImageToImageMetric.h.

◆ FixedImagePointType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::FixedImagePointType = typename TransformType::InputPointType

Definition at line 99 of file itkImageToImageMetric.h.

◆ FixedImageRegionType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::FixedImageRegionType = typename FixedImageType::RegionType

Definition at line 80 of file itkImageToImageMetric.h.

◆ FixedImageSampleContainer

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::FixedImageSampleContainer = std::vector<FixedImageSamplePoint>
protected

FixedImageSamplePoint type alias support

Definition at line 409 of file itkImageToImageMetric.h.

◆ FixedImageType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::FixedImageType = TFixedImage

Type of the fixed Image.

Definition at line 77 of file itkImageToImageMetric.h.

◆ GradientImageFilterPointer

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::GradientImageFilterPointer = typename GradientImageFilterType::Pointer

Definition at line 113 of file itkImageToImageMetric.h.

◆ GradientImageFilterType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::GradientImageFilterType = GradientRecursiveGaussianImageFilter<MovingImageType, GradientImageType>

Definition at line 112 of file itkImageToImageMetric.h.

◆ GradientImagePointer

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::GradientImagePointer = SmartPointer<GradientImageType>

Definition at line 111 of file itkImageToImageMetric.h.

◆ GradientImageType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::GradientImageType = Image<GradientPixelType, Self::MovingImageDimension>

Definition at line 110 of file itkImageToImageMetric.h.

◆ GradientPixelType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::GradientPixelType = CovariantVector<RealType, Self::MovingImageDimension>

Definition at line 109 of file itkImageToImageMetric.h.

◆ ImageDerivativesType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::ImageDerivativesType = CovariantVector<double, Self::MovingImageDimension>
protected

Definition at line 509 of file itkImageToImageMetric.h.

◆ IndexValueType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::IndexValueType = typename BSplineTransformIndexArrayType::ValueType
protected

Definition at line 494 of file itkImageToImageMetric.h.

◆ InputPointType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::InputPointType = typename TransformType::InputPointType

Definition at line 90 of file itkImageToImageMetric.h.

◆ InterpolatorPointer

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::InterpolatorPointer = typename InterpolatorType::Pointer

Definition at line 115 of file itkImageToImageMetric.h.

◆ InterpolatorType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::InterpolatorType = InterpolateImageFunction<MovingImageType, CoordinateRepresentationType>

Type of the Interpolator Base class

Definition at line 105 of file itkImageToImageMetric.h.

◆ MovingImageConstPointer

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::MovingImageConstPointer = typename MovingImageType::ConstPointer

Definition at line 74 of file itkImageToImageMetric.h.

◆ MovingImageIndexType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::MovingImageIndexType = typename MovingImageType::IndexType

Definition at line 98 of file itkImageToImageMetric.h.

◆ MovingImageMaskConstPointer

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::MovingImageMaskConstPointer = typename MovingImageMaskType::ConstPointer

Definition at line 127 of file itkImageToImageMetric.h.

◆ MovingImageMaskPointer

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::MovingImageMaskPointer = typename MovingImageMaskType::Pointer

Definition at line 126 of file itkImageToImageMetric.h.

◆ MovingImageMaskType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::MovingImageMaskType = SpatialObject<Self::MovingImageDimension>

Type for the mask of the moving image. Only pixels that are "inside" this mask will be considered for the computation of the metric

Definition at line 125 of file itkImageToImageMetric.h.

◆ MovingImagePixelType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::MovingImagePixelType = typename TMovingImage::PixelType

Definition at line 73 of file itkImageToImageMetric.h.

◆ MovingImagePointArrayType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::MovingImagePointArrayType = std::vector<MovingImagePointType>
protected

Definition at line 497 of file itkImageToImageMetric.h.

◆ MovingImagePointType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::MovingImagePointType = typename TransformType::OutputPointType

Definition at line 100 of file itkImageToImageMetric.h.

◆ MovingImageType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::MovingImageType = TMovingImage

Type of the moving Image.

Definition at line 72 of file itkImageToImageMetric.h.

◆ MultiThreaderType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::MultiThreaderType = MultiThreaderBase

Definition at line 352 of file itkImageToImageMetric.h.

◆ OutputPointType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::OutputPointType = typename TransformType::OutputPointType

Definition at line 91 of file itkImageToImageMetric.h.

◆ Pointer

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::Pointer = SmartPointer<Self>

Definition at line 62 of file itkImageToImageMetric.h.

◆ RealType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::RealType = typename NumericTraits<MovingImagePixelType>::RealType

Gaussian filter to compute the gradient of the Moving Image

Definition at line 108 of file itkImageToImageMetric.h.

◆ Self

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::Self = ImageToImageMetric

Standard class type aliases.

Definition at line 60 of file itkImageToImageMetric.h.

◆ Superclass

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::Superclass = SingleValuedCostFunction

Definition at line 61 of file itkImageToImageMetric.h.

◆ TransformJacobianType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::TransformJacobianType = typename TransformType::JacobianType

Definition at line 93 of file itkImageToImageMetric.h.

◆ TransformParametersType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::TransformParametersType = typename TransformType::ParametersType

Definition at line 92 of file itkImageToImageMetric.h.

◆ TransformPointer

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::TransformPointer = typename TransformType::Pointer

Definition at line 89 of file itkImageToImageMetric.h.

◆ TransformType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::TransformType = Transform<CoordinateRepresentationType, Self::MovingImageDimension, Self::FixedImageDimension>

Type of the Transform Base class

Definition at line 87 of file itkImageToImageMetric.h.

◆ WeightsValueType

template<typename TFixedImage , typename TMovingImage >
using itk::ImageToImageMetric< TFixedImage, TMovingImage >::WeightsValueType = typename BSplineTransformWeightsType::ValueType
protected

Definition at line 490 of file itkImageToImageMetric.h.

Constructor & Destructor Documentation

◆ ImageToImageMetric()

template<typename TFixedImage , typename TMovingImage >
itk::ImageToImageMetric< TFixedImage, TMovingImage >::ImageToImageMetric ( )
protected

◆ ~ImageToImageMetric()

template<typename TFixedImage , typename TMovingImage >
itk::ImageToImageMetric< TFixedImage, TMovingImage >::~ImageToImageMetric ( )
overrideprotecteddefault

Member Function Documentation

◆ ComputeGradient()

template<typename TFixedImage , typename TMovingImage >
virtual void itk::ImageToImageMetric< TFixedImage, TMovingImage >::ComputeGradient ( )
virtual

Computes the gradient image and assigns it to m_GradientImage

Reimplemented in itk::KappaStatisticImageToImageMetric< TFixedImage, TMovingImage >.

◆ ComputeGradientOn()

template<typename TFixedImage , typename TMovingImage >
virtual void itk::ImageToImageMetric< TFixedImage, TMovingImage >::ComputeGradientOn ( )
virtual

Set/Get gradient computation.

◆ ComputeImageDerivatives()

template<typename TFixedImage , typename TMovingImage >
virtual void itk::ImageToImageMetric< TFixedImage, TMovingImage >::ComputeImageDerivatives ( const MovingImagePointType mappedPoint,
ImageDerivativesType gradient,
ThreadIdType  threadId 
) const
protectedvirtual

Compute image derivatives at a point using a central difference function if we are not using a BSplineInterpolator, which includes derivatives.

◆ GetComputeGradient()

template<typename TFixedImage , typename TMovingImage >
virtual const bool& itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetComputeGradient ( ) const
virtual

Set/Get gradient computation.

◆ GetFixedImage()

template<typename TFixedImage , typename TMovingImage >
virtual const FixedImageType* itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetFixedImage ( ) const
virtual

Get/Set the Fixed Image.

◆ GetFixedImageMask()

template<typename TFixedImage , typename TMovingImage >
virtual const FixedImageMaskType* itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetFixedImageMask ( ) const
virtual

Set/Get the fixed image mask.

◆ GetFixedImageRegion()

template<typename TFixedImage , typename TMovingImage >
virtual const FixedImageRegionType& itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetFixedImageRegion ( ) const
virtual

Get the region over which the metric will be computed

◆ GetFixedImageSamplesIntensityThreshold()

template<typename TFixedImage , typename TMovingImage >
virtual const FixedImagePixelType& itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetFixedImageSamplesIntensityThreshold ( ) const
virtual

◆ GetModifiableGradientImage()

template<typename TFixedImage , typename TMovingImage >
virtual GradientImageType* itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetModifiableGradientImage ( )
virtual

Get Gradient Image.

◆ GetModifiableInterpolator()

template<typename TFixedImage , typename TMovingImage >
virtual InterpolatorType* itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetModifiableInterpolator ( )
virtual

Get a pointer to the Interpolator.

◆ GetModifiableThreader()

template<typename TFixedImage , typename TMovingImage >
virtual MultiThreaderType* itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetModifiableThreader ( )
virtual

Get the Threader.

◆ GetModifiableTransform()

template<typename TFixedImage , typename TMovingImage >
virtual TransformType* itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetModifiableTransform ( )
virtual

Get a pointer to the Transform.

◆ GetMovingImage()

template<typename TFixedImage , typename TMovingImage >
virtual const MovingImageType* itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetMovingImage ( ) const
virtual

Get/Set the Moving Image.

◆ GetMovingImageMask()

template<typename TFixedImage , typename TMovingImage >
virtual const MovingImageMaskType* itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetMovingImageMask ( ) const
virtual

Set/Get the moving image mask.

◆ GetNameOfClass()

template<typename TFixedImage , typename TMovingImage >
const char* itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetNameOfClass ( ) const
overridevirtual

◆ GetNumberOfFixedImageSamples()

template<typename TFixedImage , typename TMovingImage >
virtual const SizeValueType& itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetNumberOfFixedImageSamples ( ) const
virtual

Number of spatial samples to compute the metric.

Sets the number of samples.

◆ GetNumberOfMovingImageSamples()

template<typename TFixedImage , typename TMovingImage >
SizeValueType itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetNumberOfMovingImageSamples ( )
inline

Get the number of pixels considered in the computation.

Definition at line 162 of file itkImageToImageMetric.h.

◆ GetNumberOfParameters()

template<typename TFixedImage , typename TMovingImage >
unsigned int itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetNumberOfParameters ( ) const
inlineoverridevirtual

◆ GetNumberOfPixelsCounted()

template<typename TFixedImage , typename TMovingImage >
virtual const SizeValueType& itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetNumberOfPixelsCounted ( ) const
virtual

◆ GetNumberOfSpatialSamples()

template<typename TFixedImage , typename TMovingImage >
SizeValueType itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetNumberOfSpatialSamples ( )
inline

Definition at line 270 of file itkImageToImageMetric.h.

◆ GetNumberOfWorkUnits()

template<typename TFixedImage , typename TMovingImage >
virtual const ThreadIdType& itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetNumberOfWorkUnits ( ) const
virtual

Set/Get number of work units to use for computations.

◆ GetThreaderTransform()

template<typename TFixedImage , typename TMovingImage >
const TransformPointer* itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetThreaderTransform ( )
inline

Get the Threader.

Definition at line 356 of file itkImageToImageMetric.h.

◆ GetUseAllPixels()

template<typename TFixedImage , typename TMovingImage >
virtual const bool& itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetUseAllPixels ( ) const
virtual

◆ GetUseCachingOfBSplineWeights()

template<typename TFixedImage , typename TMovingImage >
virtual const bool& itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetUseCachingOfBSplineWeights ( ) const
virtual

This boolean flag is only relevant when this metric is used along with a BSplineBaseTransform. The flag enables/disables the caching of values computed when a physical point is mapped through the BSplineBaseTransform. In particular it will cache the values of the BSpline weights for that points, and the indexes indicating what BSpline-grid nodes are relevant for that specific point. This caching is made optional due to the fact that the memory arrays used for the caching can reach large sizes even for moderate image size problems. For example, for a 3D image of 256^3, using 20% of pixels, these arrays will take about 1 Gigabyte of RAM for storage. The ratio of computing time between using the cache or not using the cache can reach 1:5, meaning that using the caching can provide a five times speed up. It is therefore, interesting to enable the caching, if enough memory is available for it. The caching is enabled by default, in order to preserve backward compatibility with previous versions of ITK.

◆ GetUseFixedImageIndexes()

template<typename TFixedImage , typename TMovingImage >
virtual const bool& itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetUseFixedImageIndexes ( ) const
virtual

◆ GetUseFixedImageSamplesIntensityThreshold()

template<typename TFixedImage , typename TMovingImage >
virtual const bool& itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetUseFixedImageSamplesIntensityThreshold ( ) const
virtual

◆ GetUseSequentialSampling()

template<typename TFixedImage , typename TMovingImage >
virtual const bool& itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetUseSequentialSampling ( ) const
virtual

◆ GetValueAndDerivativeMultiThreaded()

template<typename TFixedImage , typename TMovingImage >
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetValueAndDerivativeMultiThreaded ( void *  workunitInfoAsVoid)
staticprotected

◆ GetValueAndDerivativeMultiThreadedInitiate()

template<typename TFixedImage , typename TMovingImage >
void itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetValueAndDerivativeMultiThreadedInitiate ( ) const
protected

◆ GetValueAndDerivativeMultiThreadedPostProcess()

template<typename TFixedImage , typename TMovingImage >
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetValueAndDerivativeMultiThreadedPostProcess ( void *  workunitInfoAsVoid)
staticprotected

◆ GetValueAndDerivativeMultiThreadedPostProcessInitiate()

template<typename TFixedImage , typename TMovingImage >
void itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetValueAndDerivativeMultiThreadedPostProcessInitiate ( ) const
protected

◆ GetValueAndDerivativeThread()

template<typename TFixedImage , typename TMovingImage >
virtual void itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetValueAndDerivativeThread ( ThreadIdType  threadId) const
inlineprotectedvirtual

◆ GetValueAndDerivativeThreadPostProcess()

template<typename TFixedImage , typename TMovingImage >
virtual void itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetValueAndDerivativeThreadPostProcess ( ThreadIdType  ,
bool   
) const
inlineprotectedvirtual

◆ GetValueAndDerivativeThreadPreProcess()

template<typename TFixedImage , typename TMovingImage >
virtual void itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetValueAndDerivativeThreadPreProcess ( ThreadIdType  ,
bool   
) const
inlineprotectedvirtual

◆ GetValueAndDerivativeThreadProcessSample()

template<typename TFixedImage , typename TMovingImage >
virtual bool itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetValueAndDerivativeThreadProcessSample ( ThreadIdType  ,
SizeValueType  ,
const MovingImagePointType ,
double  ,
const ImageDerivativesType  
) const
inlineprotectedvirtual

◆ GetValueMultiThreaded()

template<typename TFixedImage , typename TMovingImage >
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetValueMultiThreaded ( void *  workunitInfoAsVoid)
staticprotected

Get the match Measure.

◆ GetValueMultiThreadedInitiate()

template<typename TFixedImage , typename TMovingImage >
void itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetValueMultiThreadedInitiate ( ) const
protected

Get the match Measure.

◆ GetValueMultiThreadedPostProcess()

template<typename TFixedImage , typename TMovingImage >
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetValueMultiThreadedPostProcess ( void *  workunitInfoAsVoid)
staticprotected

Get the match Measure.

◆ GetValueMultiThreadedPostProcessInitiate()

template<typename TFixedImage , typename TMovingImage >
void itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetValueMultiThreadedPostProcessInitiate ( ) const
protected

Get the match Measure.

◆ GetValueThread()

template<typename TFixedImage , typename TMovingImage >
virtual void itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetValueThread ( ThreadIdType  threadId) const
inlineprotectedvirtual

Get the match Measure.

◆ GetValueThreadPostProcess()

template<typename TFixedImage , typename TMovingImage >
virtual void itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetValueThreadPostProcess ( ThreadIdType  ,
bool   
) const
inlineprotectedvirtual

Get the match Measure.

Reimplemented in itk::MattesMutualInformationImageToImageMetric< TFixedImage, TMovingImage >.

Definition at line 672 of file itkImageToImageMetric.h.

◆ GetValueThreadPreProcess()

template<typename TFixedImage , typename TMovingImage >
virtual void itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetValueThreadPreProcess ( ThreadIdType  ,
bool   
) const
inlineprotectedvirtual

Get the match Measure.

Reimplemented in itk::MattesMutualInformationImageToImageMetric< TFixedImage, TMovingImage >.

Definition at line 661 of file itkImageToImageMetric.h.

◆ GetValueThreadProcessSample()

template<typename TFixedImage , typename TMovingImage >
virtual bool itk::ImageToImageMetric< TFixedImage, TMovingImage >::GetValueThreadProcessSample ( ThreadIdType  ,
SizeValueType  ,
const MovingImagePointType ,
double   
) const
inlineprotectedvirtual

◆ Initialize()

template<typename TFixedImage , typename TMovingImage >
virtual void itk::ImageToImageMetric< TFixedImage, TMovingImage >::Initialize ( )
virtual

◆ MultiThreadingInitialize()

template<typename TFixedImage , typename TMovingImage >
virtual void itk::ImageToImageMetric< TFixedImage, TMovingImage >::MultiThreadingInitialize ( )
virtual

Initialize the components related to supporting multiple threads

◆ PreComputeTransformValues()

template<typename TFixedImage , typename TMovingImage >
virtual void itk::ImageToImageMetric< TFixedImage, TMovingImage >::PreComputeTransformValues ( )
protectedvirtual

Cache pre-transformed points, weights and indices.

◆ PrintSelf()

template<typename TFixedImage , typename TMovingImage >
void itk::ImageToImageMetric< TFixedImage, TMovingImage >::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
overrideprotectedvirtual

◆ ReinitializeSeed() [1/2]

template<typename TFixedImage , typename TMovingImage >
void itk::ImageToImageMetric< TFixedImage, TMovingImage >::ReinitializeSeed ( )

Reinitialize the seed of the random number generator that selects the sample of pixels used for estimating the image histograms and the joint histogram. By nature, this metric is not deterministic, since at each run it may select a different set of pixels. By initializing the random number generator seed to the same value you can restore determinism. On the other hand, calling the method ReinitializeSeed() without arguments will use the clock from your machine in order to have a very random initialization of the seed. This will indeed increase the non-deterministic behavior of the metric.

◆ ReinitializeSeed() [2/2]

template<typename TFixedImage , typename TMovingImage >
void itk::ImageToImageMetric< TFixedImage, TMovingImage >::ReinitializeSeed ( int  seed)

Reinitialize the seed of the random number generator that selects the sample of pixels used for estimating the image histograms and the joint histogram. By nature, this metric is not deterministic, since at each run it may select a different set of pixels. By initializing the random number generator seed to the same value you can restore determinism. On the other hand, calling the method ReinitializeSeed() without arguments will use the clock from your machine in order to have a very random initialization of the seed. This will indeed increase the non-deterministic behavior of the metric.

◆ SampleFixedImageIndexes()

template<typename TFixedImage , typename TMovingImage >
virtual void itk::ImageToImageMetric< TFixedImage, TMovingImage >::SampleFixedImageIndexes ( FixedImageSampleContainer samples) const
protectedvirtual

Use the indexes that have been passed to the metric.

◆ SampleFixedImageRegion()

template<typename TFixedImage , typename TMovingImage >
virtual void itk::ImageToImageMetric< TFixedImage, TMovingImage >::SampleFixedImageRegion ( FixedImageSampleContainer samples) const
protectedvirtual

Uniformly select a sample set from the fixed image domain.

Samples the fixed image using a random walk.

◆ SampleFullFixedImageRegion()

template<typename TFixedImage , typename TMovingImage >
virtual void itk::ImageToImageMetric< TFixedImage, TMovingImage >::SampleFullFixedImageRegion ( FixedImageSampleContainer samples) const
protectedvirtual

Sample the fixed image domain using all pixels in the Fixed image region.

Gathers all the pixels from the fixed image domain.

◆ SetComputeGradient()

template<typename TFixedImage , typename TMovingImage >
virtual void itk::ImageToImageMetric< TFixedImage, TMovingImage >::SetComputeGradient ( bool  _arg)
virtual

Set/Get gradient computation.

◆ SetFixedImage()

template<typename TFixedImage , typename TMovingImage >
virtual void itk::ImageToImageMetric< TFixedImage, TMovingImage >::SetFixedImage ( const FixedImageType _arg)
virtual

Get/Set the Fixed Image.

◆ SetFixedImageIndexes()

template<typename TFixedImage , typename TMovingImage >
void itk::ImageToImageMetric< TFixedImage, TMovingImage >::SetFixedImageIndexes ( const FixedImageIndexContainer indexes)

Set the fixed image indexes to be used as the samples when computing the match metric

◆ SetFixedImageMask()

template<typename TFixedImage , typename TMovingImage >
virtual void itk::ImageToImageMetric< TFixedImage, TMovingImage >::SetFixedImageMask ( const FixedImageMaskType _arg)
virtual

Set/Get the fixed image mask.

◆ SetFixedImageRegion()

template<typename TFixedImage , typename TMovingImage >
virtual void itk::ImageToImageMetric< TFixedImage, TMovingImage >::SetFixedImageRegion ( const FixedImageRegionType  reg)
virtual

Set the region over which the metric will be computed

◆ SetFixedImageSamplesIntensityThreshold()

template<typename TFixedImage , typename TMovingImage >
void itk::ImageToImageMetric< TFixedImage, TMovingImage >::SetFixedImageSamplesIntensityThreshold ( const FixedImagePixelType thresh)

Minimum fixed-image intensity needed for a sample to be used in the metric computation

◆ SetInterpolator()

template<typename TFixedImage , typename TMovingImage >
virtual void itk::ImageToImageMetric< TFixedImage, TMovingImage >::SetInterpolator ( InterpolatorType _arg)
virtual

Connect the Interpolator.

◆ SetMovingImage()

template<typename TFixedImage , typename TMovingImage >
virtual void itk::ImageToImageMetric< TFixedImage, TMovingImage >::SetMovingImage ( const MovingImageType _arg)
virtual

Get/Set the Moving Image.

◆ SetMovingImageMask()

template<typename TFixedImage , typename TMovingImage >
virtual void itk::ImageToImageMetric< TFixedImage, TMovingImage >::SetMovingImageMask ( const MovingImageMaskType _arg)
virtual

Set/Get the moving image mask.

◆ SetNumberOfFixedImageSamples()

template<typename TFixedImage , typename TMovingImage >
virtual void itk::ImageToImageMetric< TFixedImage, TMovingImage >::SetNumberOfFixedImageSamples ( SizeValueType  numSamples)
virtual

Number of spatial samples to compute the metric.

Sets the number of samples.

◆ SetNumberOfSpatialSamples()

template<typename TFixedImage , typename TMovingImage >
void itk::ImageToImageMetric< TFixedImage, TMovingImage >::SetNumberOfSpatialSamples ( SizeValueType  num)
inline

Number of spatial samples to used to compute metric This sets the number of samples.

Definition at line 264 of file itkImageToImageMetric.h.

◆ SetNumberOfWorkUnits()

template<typename TFixedImage , typename TMovingImage >
void itk::ImageToImageMetric< TFixedImage, TMovingImage >::SetNumberOfWorkUnits ( ThreadIdType  numberOfThreads)

Set/Get number of work units to use for computations.

◆ SetTransform()

template<typename TFixedImage , typename TMovingImage >
virtual void itk::ImageToImageMetric< TFixedImage, TMovingImage >::SetTransform ( TransformType _arg)
virtual

◆ SetTransformParameters()

template<typename TFixedImage , typename TMovingImage >
void itk::ImageToImageMetric< TFixedImage, TMovingImage >::SetTransformParameters ( const ParametersType parameters) const

Set the parameters defining the Transform.

◆ SetUseAllPixels()

template<typename TFixedImage , typename TMovingImage >
void itk::ImageToImageMetric< TFixedImage, TMovingImage >::SetUseAllPixels ( bool  useAllPixels)

Select whether the metric will be computed using all the pixels on the fixed image region, or only using a set of randomly selected pixels. This value override IntensityThreshold, Masks, and SequentialSampling.

◆ SetUseCachingOfBSplineWeights()

template<typename TFixedImage , typename TMovingImage >
virtual void itk::ImageToImageMetric< TFixedImage, TMovingImage >::SetUseCachingOfBSplineWeights ( bool  _arg)
virtual

This boolean flag is only relevant when this metric is used along with a BSplineBaseTransform. The flag enables/disables the caching of values computed when a physical point is mapped through the BSplineBaseTransform. In particular it will cache the values of the BSpline weights for that points, and the indexes indicating what BSpline-grid nodes are relevant for that specific point. This caching is made optional due to the fact that the memory arrays used for the caching can reach large sizes even for moderate image size problems. For example, for a 3D image of 256^3, using 20% of pixels, these arrays will take about 1 Gigabyte of RAM for storage. The ratio of computing time between using the cache or not using the cache can reach 1:5, meaning that using the caching can provide a five times speed up. It is therefore, interesting to enable the caching, if enough memory is available for it. The caching is enabled by default, in order to preserve backward compatibility with previous versions of ITK.

◆ SetUseFixedImageIndexes()

template<typename TFixedImage , typename TMovingImage >
void itk::ImageToImageMetric< TFixedImage, TMovingImage >::SetUseFixedImageIndexes ( bool  useIndexes)

◆ SetUseFixedImageSamplesIntensityThreshold()

template<typename TFixedImage , typename TMovingImage >
void itk::ImageToImageMetric< TFixedImage, TMovingImage >::SetUseFixedImageSamplesIntensityThreshold ( bool  useThresh)

◆ SetUseSequentialSampling()

template<typename TFixedImage , typename TMovingImage >
void itk::ImageToImageMetric< TFixedImage, TMovingImage >::SetUseSequentialSampling ( bool  useSequential)

If set to true, then every pixel in the fixed image will be scanned to determine if it should be used in registration metric computation. A pixel will be chosen if it meets any mask or threshold limits set. If set to false, then UseAllPixels will be set to false.

◆ SynchronizeTransforms()

template<typename TFixedImage , typename TMovingImage >
virtual void itk::ImageToImageMetric< TFixedImage, TMovingImage >::SynchronizeTransforms ( ) const
protectedvirtual

Synchronizes the threader transforms with the transform member variable.

This method can be const because we are not altering the m_ThreaderTransform pointer. We are altering the object that m_ThreaderTransform[idx] points at.* This is allowed under C++ const rules.

◆ TransformPoint()

template<typename TFixedImage , typename TMovingImage >
virtual void itk::ImageToImageMetric< TFixedImage, TMovingImage >::TransformPoint ( unsigned int  sampleNumber,
MovingImagePointType mappedPoint,
bool &  sampleOk,
double &  movingImageValue,
ThreadIdType  threadId 
) const
protectedvirtual

Transform a point from FixedImage domain to MovingImage domain.

This function also checks if mapped point is within support region.

◆ TransformPointWithDerivatives()

template<typename TFixedImage , typename TMovingImage >
virtual void itk::ImageToImageMetric< TFixedImage, TMovingImage >::TransformPointWithDerivatives ( unsigned int  sampleNumber,
MovingImagePointType mappedPoint,
bool &  sampleOk,
double &  movingImageValue,
ImageDerivativesType movingImageGradient,
ThreadIdType  threadId 
) const
protectedvirtual

Transform a point from FixedImage domain to MovingImage domain.

This function also checks if mapped point is within support region.

◆ UseAllPixelsOff()

template<typename TFixedImage , typename TMovingImage >
void itk::ImageToImageMetric< TFixedImage, TMovingImage >::UseAllPixelsOff ( )
inline

Definition at line 300 of file itkImageToImageMetric.h.

◆ UseAllPixelsOn()

template<typename TFixedImage , typename TMovingImage >
void itk::ImageToImageMetric< TFixedImage, TMovingImage >::UseAllPixelsOn ( )
inline

Definition at line 294 of file itkImageToImageMetric.h.

◆ UseCachingOfBSplineWeightsOn()

template<typename TFixedImage , typename TMovingImage >
virtual void itk::ImageToImageMetric< TFixedImage, TMovingImage >::UseCachingOfBSplineWeightsOn ( )
virtual

This boolean flag is only relevant when this metric is used along with a BSplineBaseTransform. The flag enables/disables the caching of values computed when a physical point is mapped through the BSplineBaseTransform. In particular it will cache the values of the BSpline weights for that points, and the indexes indicating what BSpline-grid nodes are relevant for that specific point. This caching is made optional due to the fact that the memory arrays used for the caching can reach large sizes even for moderate image size problems. For example, for a 3D image of 256^3, using 20% of pixels, these arrays will take about 1 Gigabyte of RAM for storage. The ratio of computing time between using the cache or not using the cache can reach 1:5, meaning that using the caching can provide a five times speed up. It is therefore, interesting to enable the caching, if enough memory is available for it. The caching is enabled by default, in order to preserve backward compatibility with previous versions of ITK.

Member Data Documentation

◆ DeformationSplineOrder

template<typename TFixedImage , typename TMovingImage >
constexpr unsigned int itk::ImageToImageMetric< TFixedImage, TMovingImage >::DeformationSplineOrder = 3
staticconstexprprotected

Definition at line 484 of file itkImageToImageMetric.h.

◆ FixedImageDimension

template<typename TFixedImage , typename TMovingImage >
constexpr unsigned int itk::ImageToImageMetric< TFixedImage, TMovingImage >::FixedImageDimension = TFixedImage::ImageDimension
staticconstexpr

Definition at line 84 of file itkImageToImageMetric.h.

◆ m_BSplineInterpolator

template<typename TFixedImage , typename TMovingImage >
BSplineInterpolatorType::Pointer itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_BSplineInterpolator {}
protected

Pointer to BSplineInterpolator.

Definition at line 564 of file itkImageToImageMetric.h.

◆ m_BSplineParametersOffset

template<typename TFixedImage , typename TMovingImage >
BSplineParametersOffsetType itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_BSplineParametersOffset {}
protected

Definition at line 518 of file itkImageToImageMetric.h.

◆ m_BSplinePreTransformPointsArray

template<typename TFixedImage , typename TMovingImage >
MovingImagePointArrayType itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_BSplinePreTransformPointsArray {}
protected

Definition at line 515 of file itkImageToImageMetric.h.

◆ m_BSplineTransform

template<typename TFixedImage , typename TMovingImage >
BSplineTransformType::Pointer itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_BSplineTransform {}
protected

Definition at line 511 of file itkImageToImageMetric.h.

◆ m_BSplineTransformIndices

template<typename TFixedImage , typename TMovingImage >
BSplineTransformIndexArrayType itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_BSplineTransformIndices {}
mutableprotected

Definition at line 524 of file itkImageToImageMetric.h.

◆ m_BSplineTransformIndicesArray

template<typename TFixedImage , typename TMovingImage >
BSplineTransformIndicesArrayType itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_BSplineTransformIndicesArray {}
protected

Definition at line 514 of file itkImageToImageMetric.h.

◆ m_BSplineTransformWeights

template<typename TFixedImage , typename TMovingImage >
BSplineTransformWeightsType itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_BSplineTransformWeights {}
mutableprotected

Definition at line 523 of file itkImageToImageMetric.h.

◆ m_BSplineTransformWeightsArray

template<typename TFixedImage , typename TMovingImage >
BSplineTransformWeightsArrayType itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_BSplineTransformWeightsArray {}
protected

Definition at line 513 of file itkImageToImageMetric.h.

◆ m_ComputeGradient

template<typename TFixedImage , typename TMovingImage >
bool itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_ComputeGradient { true }
protected

Definition at line 452 of file itkImageToImageMetric.h.

◆ m_ConstSelfWrapper

template<typename TFixedImage , typename TMovingImage >
std::unique_ptr<ConstantPointerWrapper> itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_ConstSelfWrapper
protected

Get the match Measure.

Definition at line 636 of file itkImageToImageMetric.h.

◆ m_DerivativeCalculator

template<typename TFixedImage , typename TMovingImage >
DerivativeFunctionType::Pointer itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_DerivativeCalculator {}
protected

Pointer to central difference calculator.

Definition at line 567 of file itkImageToImageMetric.h.

◆ m_FixedImage

template<typename TFixedImage , typename TMovingImage >
FixedImageConstPointer itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_FixedImage {}
protected

Definition at line 440 of file itkImageToImageMetric.h.

◆ m_FixedImageIndexes

template<typename TFixedImage , typename TMovingImage >
FixedImageIndexContainer itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_FixedImageIndexes {}
protected

Definition at line 403 of file itkImageToImageMetric.h.

◆ m_FixedImageMask

template<typename TFixedImage , typename TMovingImage >
FixedImageMaskConstPointer itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_FixedImageMask {}
protected

Definition at line 455 of file itkImageToImageMetric.h.

◆ m_FixedImageRegion

template<typename TFixedImage , typename TMovingImage >
FixedImageRegionType itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_FixedImageRegion {}
private

Definition at line 716 of file itkImageToImageMetric.h.

◆ m_FixedImageSamples

template<typename TFixedImage , typename TMovingImage >
FixedImageSampleContainer itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_FixedImageSamples {}
protected

Container to store a set of points and fixed image values.

Definition at line 430 of file itkImageToImageMetric.h.

◆ m_FixedImageSamplesIntensityThreshold

template<typename TFixedImage , typename TMovingImage >
FixedImagePixelType itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_FixedImageSamplesIntensityThreshold {}
protected

Definition at line 406 of file itkImageToImageMetric.h.

◆ m_GradientImage

template<typename TFixedImage , typename TMovingImage >
GradientImagePointer itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_GradientImage {}
protected

Definition at line 453 of file itkImageToImageMetric.h.

◆ m_Interpolator

template<typename TFixedImage , typename TMovingImage >
InterpolatorPointer itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_Interpolator {}
protected

Definition at line 450 of file itkImageToImageMetric.h.

◆ m_MovingImage

template<typename TFixedImage , typename TMovingImage >
MovingImageConstPointer itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_MovingImage {}
protected

Definition at line 441 of file itkImageToImageMetric.h.

◆ m_MovingImageMask

template<typename TFixedImage , typename TMovingImage >
MovingImageMaskConstPointer itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_MovingImageMask {}
protected

Definition at line 456 of file itkImageToImageMetric.h.

◆ m_NumberOfFixedImageSamples

template<typename TFixedImage , typename TMovingImage >
SizeValueType itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_NumberOfFixedImageSamples { 50000 }
protected

Definition at line 434 of file itkImageToImageMetric.h.

◆ m_NumberOfParameters

template<typename TFixedImage , typename TMovingImage >
SizeValueType itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_NumberOfParameters { 0 }
protected

Definition at line 432 of file itkImageToImageMetric.h.

◆ m_NumberOfPixelsCounted

template<typename TFixedImage , typename TMovingImage >
SizeValueType itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_NumberOfPixelsCounted { 0 }
mutableprotected

Definition at line 438 of file itkImageToImageMetric.h.

◆ m_NumberOfWorkUnits

template<typename TFixedImage , typename TMovingImage >
ThreadIdType itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_NumberOfWorkUnits { 1 }
protected

Definition at line 458 of file itkImageToImageMetric.h.

◆ m_NumBSplineWeights

template<typename TFixedImage , typename TMovingImage >
SizeValueType itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_NumBSplineWeights { 0 }
protected

Types and variables related to BSpline deformable transforms. If the transform is of type third order BSplineBaseTransform, then we can speed up the metric derivative calculation by only inspecting the parameters within the support region of a mapped point.
The number of BSpline transform weights is the number of of parameter in the support region (per dimension ).

Definition at line 482 of file itkImageToImageMetric.h.

◆ m_RandomSeed

template<typename TFixedImage , typename TMovingImage >
int itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_RandomSeed {}
mutableprotected

Definition at line 465 of file itkImageToImageMetric.h.

◆ m_ReseedIterator

template<typename TFixedImage , typename TMovingImage >
bool itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_ReseedIterator { false }
protected

Definition at line 463 of file itkImageToImageMetric.h.

◆ m_Threader

template<typename TFixedImage , typename TMovingImage >
MultiThreaderType::Pointer itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_Threader {}
protected

Get the match Measure.

Definition at line 635 of file itkImageToImageMetric.h.

◆ m_ThreaderBSplineTransformIndices

template<typename TFixedImage , typename TMovingImage >
std::unique_ptr<BSplineTransformIndexArrayType[]> itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_ThreaderBSplineTransformIndices
mutableprotected

Definition at line 527 of file itkImageToImageMetric.h.

◆ m_ThreaderBSplineTransformWeights

template<typename TFixedImage , typename TMovingImage >
std::unique_ptr<BSplineTransformWeightsType[]> itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_ThreaderBSplineTransformWeights
mutableprotected

Definition at line 526 of file itkImageToImageMetric.h.

◆ m_ThreaderNumberOfMovingImageSamples

template<typename TFixedImage , typename TMovingImage >
std::unique_ptr<unsigned int[]> itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_ThreaderNumberOfMovingImageSamples
mutableprotected

Get the match Measure.

Definition at line 637 of file itkImageToImageMetric.h.

◆ m_ThreaderTransform

template<typename TFixedImage , typename TMovingImage >
std::unique_ptr<TransformPointer[]> itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_ThreaderTransform
protected

Copies of Transform helpers per thread (N-1 of them, since m_Transform will do the work for thread=0.

Definition at line 448 of file itkImageToImageMetric.h.

◆ m_Transform

template<typename TFixedImage , typename TMovingImage >
TransformPointer itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_Transform {}
protected

Main transform to be used in thread = 0

Definition at line 444 of file itkImageToImageMetric.h.

◆ m_UseAllPixels

template<typename TFixedImage , typename TMovingImage >
bool itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_UseAllPixels { false }
protected

Definition at line 460 of file itkImageToImageMetric.h.

◆ m_UseCachingOfBSplineWeights

template<typename TFixedImage , typename TMovingImage >
bool itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_UseCachingOfBSplineWeights { true }
protected

Definition at line 522 of file itkImageToImageMetric.h.

◆ m_UseFixedImageIndexes

template<typename TFixedImage , typename TMovingImage >
bool itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_UseFixedImageIndexes { false }
protected

Definition at line 402 of file itkImageToImageMetric.h.

◆ m_UseFixedImageSamplesIntensityThreshold

template<typename TFixedImage , typename TMovingImage >
bool itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_UseFixedImageSamplesIntensityThreshold { false }
protected

Definition at line 405 of file itkImageToImageMetric.h.

◆ m_UseSequentialSampling

template<typename TFixedImage , typename TMovingImage >
bool itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_UseSequentialSampling { false }
protected

Definition at line 461 of file itkImageToImageMetric.h.

◆ m_WithinBSplineSupportRegionArray

template<typename TFixedImage , typename TMovingImage >
BooleanArrayType itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_WithinBSplineSupportRegionArray {}
protected

Definition at line 516 of file itkImageToImageMetric.h.

◆ m_WithinThreadPostProcess

template<typename TFixedImage , typename TMovingImage >
bool itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_WithinThreadPostProcess { false }
protected

Get the match Measure.

Definition at line 639 of file itkImageToImageMetric.h.

◆ m_WithinThreadPreProcess

template<typename TFixedImage , typename TMovingImage >
bool itk::ImageToImageMetric< TFixedImage, TMovingImage >::m_WithinThreadPreProcess { false }
protected

Get the match Measure.

Definition at line 638 of file itkImageToImageMetric.h.

◆ MovingImageDimension

template<typename TFixedImage , typename TMovingImage >
constexpr unsigned int itk::ImageToImageMetric< TFixedImage, TMovingImage >::MovingImageDimension = TMovingImage::ImageDimension
staticconstexpr

Constants for the image dimensions

Definition at line 83 of file itkImageToImageMetric.h.


The documentation for this class was generated from the following file: