CTL
0.6.1
Computed Tomography Library
|
The SaturatedSplineModel is a data model to map values according to a dependency composed of a linear central segment and a fade in/out from/to a constant level by quadratic splines. More...
#include <datamodels1d.h>
Public Types | |
enum | { Type = 20 } |
![]() | |
enum | { Type = 0 } |
![]() | |
enum | { Type = -1, UserType = 65536 } |
Public Member Functions | |
int | type () const override |
float | valueAt (float position) const override |
AbstractDataModel * | clone () const override |
SaturatedSplineModel (float lowerCap=0.0f, float upperCap=FLT_MAX, float softening=0.0f) | |
SaturatedSplineModel (float lowerCap, float upperCap, float softLower, float softUpper) | |
QVariant | parameter () const override |
void | setParameter (const QVariant ¶meter) override |
![]() | |
void | fromVariant (const QVariant &variant) override |
QVariant | toVariant () const override |
bool | isIntegrable () const |
void | setName (const QString &name) |
const QString & | name () const |
![]() | |
virtual | ~SerializationInterface ()=default |
Private Member Functions | |
void | setParFromList (const QVariantList &list) |
void | setParFromMap (const QVariantMap &map) |
float | spline1 (float x) const |
float | spline2 (float x) const |
Private Attributes | |
float | _a = 0.0f |
lower saturation level | |
float | _b = FLT_MAX |
upper saturation level | |
float | _softA = 0.0f |
softening margin of lower saturation | |
float | _softB = 0.0f |
softening margin of upper saturation | |
Friends | |
template<class > | |
struct | SerializationHelper::RegisterWithSerializationHelper |
Related Functions | |
(Note that these are not member functions.) | |
DetectorSaturationSplineModel | |
Alias for SaturatedSplineModel used here to map true (or expected) values to actually measured values. | |
![]() | |
DataModelPtr | |
Template alias name for CopyableUniquePtr<ModelType> to a suitable ModelType. | |
AbstractDataModelPtr | |
Alias name for DataModelPtr<AbstractDataModel>. More... | |
std::unique_ptr< ModelType > | makeDataModel (ConstructorArguments &&... arguments) |
using DataModelPtr | CopyableUniquePtr |
Alias name for CopyableUniquePtr<ModelType> to a suitable ModelType. | |
Additional Inherited Members | |
![]() | |
AbstractDataModel (const AbstractDataModel &)=default | |
AbstractDataModel (AbstractDataModel &&)=default | |
AbstractDataModel & | operator= (const AbstractDataModel &)=default |
AbstractDataModel & | operator= (AbstractDataModel &&)=default |
![]() | |
SerializationInterface ()=default | |
SerializationInterface (const SerializationInterface &)=default | |
SerializationInterface (SerializationInterface &&)=default | |
SerializationInterface & | operator= (const SerializationInterface &)=default |
SerializationInterface & | operator= (SerializationInterface &&)=default |
The SaturatedSplineModel is a data model to map values according to a dependency composed of a linear central segment and a fade in/out from/to a constant level by quadratic splines.
The model is defined by four parameters:
This is illustrated in the following figure.
|
explicit |
Constructs a SaturatedSplineModel with (lower/upper) saturation levels at lowerCap and upperCap and equally sized softening margins \( s_{a}=s_{b}=softening \).
CTL::SaturatedSplineModel::SaturatedSplineModel | ( | float | lowerCap, |
float | upperCap, | ||
float | softLower, | ||
float | softUpper | ||
) |
Constructs a SaturatedSplineModel with (lower/upper) saturation levels at lowerCap and upperCap. Softening margins around the saturation levels are set to softLower and softUpper, respectively.
|
overridevirtual |
Creates a copy of this instance and returns a base class pointer to the new object.
Implements CTL::AbstractDataModel.
|
overridevirtual |
Returns the parameters of this instance as QVariant.
This returns a QVariantMap with four key-value-pairs: ("a", a), ("b", b), ("softA", \( s_a \)), ("softB", \( s_b \)). Here, a and b denote the lower and upper saturation level, respectively, and \( s_a \) and \( s_b \) are the softening margins of the transitions to/from the linear regime.
Reimplemented from CTL::AbstractDataModel.
|
overridevirtual |
Sets the parameters of this instance based on the passed QVariant parameter.
Parameters can be passed by either of the following two options:
Example:
Reimplemented from CTL::AbstractDataModel.
|
private |
Helper method for setParameter().
|
private |
Helper method for setParameter().
|
private |
Helper method for valueAt().
|
private |
Helper method for valueAt().
|
inlineoverridevirtual |
Returns the type id of this instance.
Reimplemented from CTL::AbstractDataModel.
|
overridevirtual |
Returns the value from the model at position.
\( f(x)=\begin{cases} a & x<a-s_{a}\\ S_{1}(x) & a-s_{a}\leq x<a+s_{a}\\ x & a+s_{a}\leq x<b-s_{b}\\ S_{2}(x) & b-s_{b}\leq x<b+s_{b}\\ b & x\geq b \end{cases} \)
With: \( \begin{align*} S_{1}(x) & =\frac{1}{4s_{a}}x^{2}-\frac{a-s_{a}}{2s_{a}}x+\frac{(a+s_{a})^{2}}{4s_{a}}\\ S_{2}(x) & =-\frac{1}{4s_{b}}x^{2}+\frac{b+s_{b}}{2s_{b}}x+\frac{(b-s_{b})^{2}}{4s_{b}} \end{align*} \)
Implements CTL::AbstractDataModel.