|
CTL
0.6.1
Computed Tomography Library
|
The GaussianModel1D class represents a one-dimensional Gaussian curve. More...
#include <datamodels1d.h>


Public Types | |
| enum | { Type = 54 } |
Public Types inherited from CTL::AbstractDataModel | |
| enum | { Type = 0 } |
Public Types inherited from CTL::SerializationInterface | |
| 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 |
| GaussianModel1D (float amplitude=1.0f, float mean=0.0f, float std=1.0f) | |
| Constructs a GaussianModel1D representing a one-dimensional Gaussian curve. More... | |
| QVariant | toVariant () const override |
| QVariant | parameter () const override |
| void | setParameter (const QVariant ¶meter) override |
| Sets the parameters contained in parameter (a QVariantMap). More... | |
Public Member Functions inherited from CTL::AbstractIntegrableDataModel | |
| float | meanValue (float position, float binWidth) const |
Public Member Functions inherited from CTL::AbstractDataModel | |
| void | fromVariant (const QVariant &variant) override |
| bool | isIntegrable () const |
| void | setName (const QString &name) |
| const QString & | name () const |
Public Member Functions inherited from CTL::SerializationInterface | |
| virtual | ~SerializationInterface ()=default |
Private Attributes | |
| float | _ampl = 1.0f |
| float | _mean = 0.0f |
| float | _std = 1.0f |
Friends | |
| template<class > | |
| struct | SerializationHelper::RegisterWithSerializationHelper |
Additional Inherited Members | |
Protected Member Functions inherited from CTL::AbstractIntegrableDataModel | |
| AbstractIntegrableDataModel (const AbstractIntegrableDataModel &)=default | |
| AbstractIntegrableDataModel (AbstractIntegrableDataModel &&)=default | |
| AbstractIntegrableDataModel & | operator= (const AbstractIntegrableDataModel &)=default |
| AbstractIntegrableDataModel & | operator= (AbstractIntegrableDataModel &&)=default |
Protected Member Functions inherited from CTL::AbstractDataModel | |
| AbstractDataModel (const AbstractDataModel &)=default | |
| AbstractDataModel (AbstractDataModel &&)=default | |
| AbstractDataModel & | operator= (const AbstractDataModel &)=default |
| AbstractDataModel & | operator= (AbstractDataModel &&)=default |
Protected Member Functions inherited from CTL::SerializationInterface | |
| SerializationInterface ()=default | |
| SerializationInterface (const SerializationInterface &)=default | |
| SerializationInterface (SerializationInterface &&)=default | |
| SerializationInterface & | operator= (const SerializationInterface &)=default |
| SerializationInterface & | operator= (SerializationInterface &&)=default |
Related Functions inherited from CTL::AbstractDataModel | |
| 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 GaussianModel1D class represents a one-dimensional Gaussian curve.
This model maps input values according to a one-dimensional Gaussian function.
|
explicit |
Constructs a GaussianModel1D representing a one-dimensional Gaussian curve.
This creates a model representing a one-dimensional Gaussian function specified by amplitude, mean, and std.
std must be strictly positive, i.e. std > 0; throws an std::domain_error for invalid input.
|
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 a QVariant.
Re-implement this method within your sub-class such that it encapsulates all necessary information into a QVariant.
Best practice is to invoke the base class version of this method to take care of all content originating from underlying base classes.
A typical reimplementation in sub-classes might look like this:
Reimplemented from CTL::AbstractDataModel.
|
overridevirtual |
Sets the parameters contained in parameter (a QVariantMap).
The value passed to parameter must be a QVariantMap containing one or multiple of the following (key, value)-pairs:
-("amplitude", [float] amplitude), -("mean", [float] mean), -("std", [float] std).
std must be strictly positive, i.e. std > 0; otherwise, a warning is generated and the parameter will be set to 1.0.
Example: setting mean to 3 and amplitude to 2.5
Reimplemented from CTL::AbstractDataModel.
|
overridevirtual |
Encodes all information required to describe this instance into a QVariant.
Required to provide de-/serialization functionality.
Reimplemented from CTL::AbstractDataModel.
|
inlineoverridevirtual |
Returns the type id of this instance.
Reimplemented from CTL::AbstractDataModel.
|
overridevirtual |
Returns the value from the model at position.
With the defining parameters of the Gaussian curve according to the constructor (see GaussianModel1D()):
the resulting value is given by follwoing relation:
\( f(x)= \frac{A}{\sqrt{2\pi \sigma^2}} \cdot \exp\left[-\frac{1}{2 \sigma^2} \cdot (x-\mu)^2\right] \)
Implements CTL::AbstractDataModel.
1.8.16