CTL
0.6.1
Computed Tomography Library
|
The HuberRegularizer class is a regularizer based on the Huber potential function. More...
#include <regularizers.h>
Public Types | |
enum | { Type = 2013 } |
![]() | |
enum | { Type = 2000 } |
![]() | |
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 ¶meter) override |
Sets the parameters contained in parameter (a QVariantMap). More... | |
![]() | |
void | fromVariant (const QVariant &variant) override |
QVariant | toVariant () const override |
![]() | |
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 | |
![]() | |
AbstractVolumeFilter (const AbstractVolumeFilter &)=default | |
AbstractVolumeFilter (AbstractVolumeFilter &&)=default | |
AbstractVolumeFilter & | operator= (const AbstractVolumeFilter &)=default |
AbstractVolumeFilter & | operator= (AbstractVolumeFilter &&)=default |
![]() | |
SerializationInterface ()=default | |
SerializationInterface (const SerializationInterface &)=default | |
SerializationInterface (SerializationInterface &&)=default | |
SerializationInterface & | operator= (const SerializationInterface &)=default |
SerializationInterface & | operator= (SerializationInterface &&)=default |
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.
|
explicit |
Constructs a HuberRegularizer with the given parameters (see details).
The parameters define the following things:
|
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.
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].
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
|
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:
float
]),float
]),float
]),float
]),float
])Example: setting filter strength to 0.75 and direct Z-neighbor weighting to 2.0.
Reimplemented from CTL::AbstractVolumeFilter.
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].
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].
|
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.