CTL  0.6.1
Computed Tomography Library
Public Types | Public Member Functions | Private Attributes | Friends | List of all members
CTL::HuberRegularizer Class Reference

The HuberRegularizer class is a regularizer based on the Huber potential function. More...

#include <regularizers.h>

Inheritance diagram for CTL::HuberRegularizer:
Inheritance graph
[legend]
Collaboration diagram for CTL::HuberRegularizer:
Collaboration graph
[legend]

Public Types

enum  { Type = 2013 }
 
- Public Types inherited from CTL::AbstractVolumeFilter
enum  { Type = 2000 }
 
- Public Types inherited from CTL::SerializationInterface
enum  { Type = -1, UserType = 65536 }
 

Public Member Functions

int type () const override
 
void filter (VoxelVolume< float > &volume) override
 
 HuberRegularizer (float strength=1.0f, float huberEdgeIn100HU=1.0, float weightZ=1.0f, float weightXY=1.0f, float directZweight=1.0f)
 Constructs a HuberRegularizer with the given parameters (see details). More...
 
void setRegularizationStrength (float strength)
 Sets the regularization parameter to strength. More...
 
void setHuberEdge (float edgeIn100HU)
 Sets the Huber edge to edgeIn100HU times 100 HU. More...
 
void setRelativeWeighting (float weightZ, float weightXY=1.0f)
 Sets the relative strength of the regularization in Z- and XY- plane to weightZ and weightXY, respectively. More...
 
void setDirectZNeighborWeight (float weight)
 Sets the weighting factor for direct neighbors in Z-direction to weight. More...
 
QVariant parameter () const override
 
void setParameter (const QVariant &parameter) override
 Sets the parameters contained in parameter (a QVariantMap). More...
 
- Public Member Functions inherited from CTL::AbstractVolumeFilter
void fromVariant (const QVariant &variant) override
 
QVariant toVariant () const override
 
- Public Member Functions inherited from CTL::SerializationInterface
virtual ~SerializationInterface ()=default
 

Private Attributes

float _strength = 0.01f
 
float _huberEdge = 100.0f * 0.02269f/1000.0f
 
float _betaZ = 1.0f
 
float _betaXY = 1.0f
 
float _directZ = 1.0f
 

Friends

template<class >
struct SerializationHelper::RegisterWithSerializationHelper
 

Additional Inherited Members

- Protected Member Functions inherited from CTL::AbstractVolumeFilter
 AbstractVolumeFilter (const AbstractVolumeFilter &)=default
 
 AbstractVolumeFilter (AbstractVolumeFilter &&)=default
 
AbstractVolumeFilteroperator= (const AbstractVolumeFilter &)=default
 
AbstractVolumeFilteroperator= (AbstractVolumeFilter &&)=default
 
- Protected Member Functions inherited from CTL::SerializationInterface
 SerializationInterface ()=default
 
 SerializationInterface (const SerializationInterface &)=default
 
 SerializationInterface (SerializationInterface &&)=default
 
SerializationInterfaceoperator= (const SerializationInterface &)=default
 
SerializationInterfaceoperator= (SerializationInterface &&)=default
 

Detailed Description

The HuberRegularizer class is a regularizer based on the Huber potential function.

This is the CPU version of the HuberRegularizer; for the GPU version, see OCL::HuberRegularizer.

This regularizer uses the so-called Huber potential, which consists of a quadratic part that transitions into a linear part for arguments whose absolute value exceeds a defined threshold (called Huber edge here). Consequently, voxel differences (wrt. absolute value) below the threshold contribute to the gradient linearly wrt. their difference. Differences above said threshold are capped by that threshold value, thus, resulting in a TV-like contribution to the regularization.

The regularizer can be configured through a set of parameters, with the following effects:

Parameters can be set during construction or later on through their specific setters.

Constructor & Destructor Documentation

◆ HuberRegularizer()

CTL::HuberRegularizer::HuberRegularizer ( float  strength = 1.0f,
float  huberEdgeIn100HU = 1.0,
float  weightZ = 1.0f,
float  weightXY = 1.0f,
float  directZweight = 1.0f 
)
explicit

Constructs a HuberRegularizer with the given parameters (see details).

The parameters define the following things:

  • strength linearly scales the portion of the gradient that is applied to change a single voxel's value in one execution of filter() [1.0 means 1% of the gradient is applied].
  • huberEdgeIn100HU defines the (absolute) difference threshold in multiples of 100 HU (at 50 keV) to which differences will be clamped for computation of the gradient. For differences above the threshold, the regularization effect is comparable to TV minimization [1.0 means the Huber edges are +-100 HU].
  • weightZ and weightXY specify the relative strength of the regularization in Z- and XY- plane, respectively (in most settings, this refers to between-plane and in-plane regularization) [weightZ = weightXY means all dimensions are treated equally].
  • directZweight is a separate multiplicative weight factor for the two voxels that are direct Z-neighbors of the voxel of interest [1.0 means the direct Z-Neighbors are treated the same as all other Z-Neighbors].

Member Function Documentation

◆ filter()

void CTL::HuberRegularizer::filter ( VoxelVolume< float > &  volume)
overridevirtual

This applies the Huber regularization to volume. volume must have a minimum size of 3x3x3 voxels; throws std::domain_error otherwise.

This regularizer uses the so-called Huber potential, which consists of a quadratic part that transitions into a linear part for arguments whose absolute value exceeds a defined threshold (called Huber edge here). Consequently, voxel differences (wrt. absolute value) below the threshold contribute to the gradient linearly wrt. their difference. Differences above said threshold are capped by that threshold value, thus, resulting in a TV-like contribution to the regularization.

The regularization effect can be controlled with a series of parameters; see HuberRegularizer (main class documentation) for more details.

Implements CTL::AbstractVolumeFilter.

◆ setDirectZNeighborWeight()

void CTL::HuberRegularizer::setDirectZNeighborWeight ( float  weight)

Sets the weighting factor for direct neighbors in Z-direction to weight.

directZNeighborWeight is a separate multiplicative weight factor for the two voxels that are direct Z-neighbors (i.e. with same x, and y coordinate) of the voxel of interest [1.0 means the direct Z-Neighbors are treated the same as all other Z-Neighbors].

◆ setHuberEdge()

void CTL::HuberRegularizer::setHuberEdge ( float  edgeIn100HU)

Sets the Huber edge to edgeIn100HU times 100 HU.

The parameter edgeIn100HU defines the (absolute) difference threshold in multiples of 100 HU (at 50 keV) to which differences will be clamped for computation of the gradient. For differences larger than the threshold, the regularization effect is comparable to TV minimization

◆ setParameter()

void CTL::HuberRegularizer::setParameter ( const QVariant &  parameter)
overridevirtual

Sets the parameters contained in parameter (a QVariantMap).

Note: it is not recommended to set parameters of the filter this way. Consider using the regular setter methods instead.

The value passed to parameter must be a QVariantMap containing one or multiple of the following (key, value)-pairs:

  • ("strength", [float]),
  • ("Huber edge", [float]),
  • ("betaZ", [float]),
  • ("betaXY", [float]),
  • ("directZ", [float])

Example: setting filter strength to 0.75 and direct Z-neighbor weighting to 2.0.

filt.setParameter(QVariantMap{ { "strength", 0.75f },
{ "directZ", 2.0f } } );

Reimplemented from CTL::AbstractVolumeFilter.

◆ setRegularizationStrength()

void CTL::HuberRegularizer::setRegularizationStrength ( float  strength)

Sets the regularization parameter to strength.

The parameter strength linearly scales the portion of the gradient that is applied to change a single voxel's value in one execution of filter() [strength=1.0 means 1% of the gradient is applied].

◆ setRelativeWeighting()

void CTL::HuberRegularizer::setRelativeWeighting ( float  weightZ,
float  weightXY = 1.0f 
)

Sets the relative strength of the regularization in Z- and XY- plane to weightZ and weightXY, respectively.

Note that in most settings, weightZ refers to between-plane and weightXY to in-plane regularization [weightZ = weightXY means all dimensions are treated equally].

◆ type()

int CTL::HuberRegularizer::type ( ) const
inlineoverridevirtual

Returns the type-id of the serializable object. Used in deserialization to determine the proper object type.

Add derived classes to the enumeration using the CTL_TYPE_ID macro.

Reimplemented from CTL::AbstractVolumeFilter.


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