CTL
0.6.1
Computed Tomography Library
|
The SaturatedLinearModel is a data model to map values according to a linear central segment that connects two constant regimes (saturation). More...
#include <datamodels1d.h>
Public Types | |
enum | { Type = 10 } |
![]() | |
enum | { Type = 0 } |
![]() | |
enum | { Type = -1, UserType = 65536 } |
Public Member Functions | |
int | type () const override |
float | valueAt (float position) const override |
Returns the value from the model at position. More... | |
float | binIntegral (float position, float binWidth) const override |
Returns the integral over model values in the interval [position - 0.5 * binWidth, position + 0.5 * binWidth]. More... | |
AbstractIntegrableDataModel * | clone () const override |
SaturatedLinearModel (float lowerCap=0.0f, float upperCap=FLT_MAX) | |
QVariant | parameter () const override |
void | setParameter (const QVariant ¶meter) override |
![]() | |
float | meanValue (float position, float binWidth) const |
![]() | |
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) |
Private Attributes | |
float | _a = 0.0f |
lower saturation level | |
float | _b = FLT_MAX |
upper saturation level | |
Friends | |
template<class > | |
struct | SerializationHelper::RegisterWithSerializationHelper |
Related Functions | |
(Note that these are not member functions.) | |
DetectorSaturationLinearModel | |
Alias for SaturatedLinearModel 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. | |
The SaturatedLinearModel is a data model to map values according to a linear central segment that connects two constant regimes (saturation).
The model is defined by two parameters:
This is illustrated in the following figure.
|
explicit |
Constructs a SaturatedLinearModel with (lower/upper) saturation levels at lowerCap and upperCap.
|
overridevirtual |
Returns the integral over model values in the interval [position - 0.5 * binWidth, position + 0.5 * binWidth].
If the model output to input parameter \( x \) is given by \( f(x) \), this method computes and returns:
\( \begin{align*} \int_{position-\frac{binWidth}{2}}^{position+\frac{binWidth}{2}} f(x) \,dx \end{align*} \)
Implements CTL::AbstractIntegrableDataModel.
|
overridevirtual |
Creates a copy of this instance and returns a base class pointer to the new object.
Implements CTL::AbstractIntegrableDataModel.
|
overridevirtual |
Returns the parameters of this instance as QVariant.
This returns a QVariantMap with two key-value-pairs: ("a",a), ("b",b), where a and b denote the lower and upper saturation level, respectively.
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().
|
inlineoverridevirtual |
Returns the type id of this instance.
Reimplemented from CTL::AbstractDataModel.
|
overridevirtual |
Returns the value from the model at position.
The resulting value is described by the follwoing relation: \( f(x)=\begin{cases} a & x<a\\ x & a\leq x\leq b\\ b & x>b \end{cases} \)
Implements CTL::AbstractDataModel.