go home Home | Main Page | Topics | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itk::ImpactImageToImageMetric< TFixedImage, TMovingImage >::LossPerThreadStruct Struct Reference

#include <itkImpactImageToImageMetric.h>

Detailed Description

template<typename TFixedImage, typename TMovingImage>
struct itk::ImpactImageToImageMetric< TFixedImage, TMovingImage >::LossPerThreadStruct

Thread-local structure for accumulating loss values and gradients for each layer.

Protected Typedefs

This structure encapsulates one loss object per output layer (defined by the layersMask), enabling multi-layer loss computation and weighted aggregation. It allows efficient computation of the final loss and its gradients by keeping track of the contributions from each layer.

This structure is designed to be used in a multi-threaded environment, where each thread maintains its own instance to store intermediate results, ensuring thread-safety during parallel loss and gradient computations.

Definition at line 273 of file itkImpactImageToImageMetric.h.

Public Member Functions

DerivativeType GetDerivative ()
double GetValue ()
void init (std::vector< std::string > distanceName, std::vector< float > layersWeight, unsigned int seed)
LossPerThreadStructoperator+= (const LossPerThreadStruct &other)
void reset ()
void setNumberOfParameters (int numberOfParameters)

Public Attributes

std::vector< floatm_LayersWeight
std::vector< std::unique_ptr< ImpactLoss::Loss > > m_Losses
int m_NumberOfParameters
SizeValueType m_NumberOfPixelsCounted
std::mt19937 m_RandomGenerator

Member Function Documentation

◆ GetDerivative()

template<typename TFixedImage, typename TMovingImage>
DerivativeType itk::ImpactImageToImageMetric< TFixedImage, TMovingImage >::LossPerThreadStruct::GetDerivative ( )
inline

Definition at line 331 of file itkImpactImageToImageMetric.h.

◆ GetValue()

template<typename TFixedImage, typename TMovingImage>
double itk::ImpactImageToImageMetric< TFixedImage, TMovingImage >::LossPerThreadStruct::GetValue ( )
inline

Definition at line 320 of file itkImpactImageToImageMetric.h.

◆ init()

template<typename TFixedImage, typename TMovingImage>
void itk::ImpactImageToImageMetric< TFixedImage, TMovingImage >::LossPerThreadStruct::init ( std::vector< std::string > distanceName,
std::vector< float > layersWeight,
unsigned int seed )
inline

Definition at line 282 of file itkImpactImageToImageMetric.h.

◆ operator+=()

template<typename TFixedImage, typename TMovingImage>
LossPerThreadStruct & itk::ImpactImageToImageMetric< TFixedImage, TMovingImage >::LossPerThreadStruct::operator+= ( const LossPerThreadStruct & other)
inline

Definition at line 347 of file itkImpactImageToImageMetric.h.

◆ reset()

template<typename TFixedImage, typename TMovingImage>
void itk::ImpactImageToImageMetric< TFixedImage, TMovingImage >::LossPerThreadStruct::reset ( )
inline

Definition at line 310 of file itkImpactImageToImageMetric.h.

◆ setNumberOfParameters()

template<typename TFixedImage, typename TMovingImage>
void itk::ImpactImageToImageMetric< TFixedImage, TMovingImage >::LossPerThreadStruct::setNumberOfParameters ( int numberOfParameters)
inline

Definition at line 300 of file itkImpactImageToImageMetric.h.

Member Data Documentation

◆ m_LayersWeight

template<typename TFixedImage, typename TMovingImage>
std::vector<float> itk::ImpactImageToImageMetric< TFixedImage, TMovingImage >::LossPerThreadStruct::m_LayersWeight

Definition at line 276 of file itkImpactImageToImageMetric.h.

◆ m_Losses

template<typename TFixedImage, typename TMovingImage>
std::vector<std::unique_ptr<ImpactLoss::Loss> > itk::ImpactImageToImageMetric< TFixedImage, TMovingImage >::LossPerThreadStruct::m_Losses

Definition at line 275 of file itkImpactImageToImageMetric.h.

◆ m_NumberOfParameters

template<typename TFixedImage, typename TMovingImage>
int itk::ImpactImageToImageMetric< TFixedImage, TMovingImage >::LossPerThreadStruct::m_NumberOfParameters

Definition at line 278 of file itkImpactImageToImageMetric.h.

◆ m_NumberOfPixelsCounted

template<typename TFixedImage, typename TMovingImage>
SizeValueType itk::ImpactImageToImageMetric< TFixedImage, TMovingImage >::LossPerThreadStruct::m_NumberOfPixelsCounted

Definition at line 277 of file itkImpactImageToImageMetric.h.

◆ m_RandomGenerator

template<typename TFixedImage, typename TMovingImage>
std::mt19937 itk::ImpactImageToImageMetric< TFixedImage, TMovingImage >::LossPerThreadStruct::m_RandomGenerator

Definition at line 279 of file itkImpactImageToImageMetric.h.



Generated on 26-02-2026 for elastix by doxygen 1.16.1 (669aeeefca743c148e2d935b3d3c69535c7491e6) elastix logo