CTL
0.6.1
Computed Tomography Library
|
The AbstractIntegrableDataModel class is the base class for data models that provide a means to integrate the contained data. More...
#include <abstractdatamodel.h>
Public Member Functions | |
virtual float | binIntegral (float position, float binWidth) const =0 |
Returns the integral over model values in the interval [position - 0.5 * binWidth, position + 0.5 * binWidth]. More... | |
virtual AbstractIntegrableDataModel * | clone () const override=0 |
float | meanValue (float position, float binWidth) const |
![]() | |
int | type () const override |
virtual float | valueAt (float position) const =0 |
virtual QVariant | parameter () const |
virtual void | setParameter (const QVariant ¶meter) |
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 |
Additional Inherited Members | |
![]() | |
enum | { Type = 0 } |
![]() | |
enum | { Type = -1, UserType = 65536 } |
![]() | |
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 AbstractIntegrableDataModel class is the base class for data models that provide a means to integrate the contained data.
Sub-classes must implement the method to sample a value at a given position (valueAt()) and a method that computes the integral of the data over a given interval (binIntegral()).
Parameters can be set by passing a QVariant that contains all necessary information. Re-implement the setParameter() method to parse the QVariant into your required format within sub-classes of AbstractIntegrableDataModel.
To enable de-/serialization if sub-class objects, also reimplement the parameter() method such that it stores all parameters of the model in a QVariant. Additionally, call the macro DECLARE_SERIALIZABLE_TYPE(YourNewClassName) within the .cpp file of your new class (substitute "YourNewClassName" with the actual class name). Objects of the new class can then be de-/serialized with any of the serializer classes (see also AbstractSerializer).
Alternatively, the de-/serialization interface methods toVariant() and fromVariant() can be reimplemented directly. This might be required in some specific situations (usually when polymorphic class members are in use). For the majority of cases, using the parameter() / setParameter() approach should be sufficient and is recommended.
|
pure virtual |
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*} \)
Implemented in CTL::HeuristicCubicSpectrumModel, CTL::KramersLawSpectrumModel, CTL::FixedXraySpectrumModel, CTL::GaussianModel1D, CTL::IdentityModel, CTL::XrayLaserSpectrumModel, CTL::ConstantModel, CTL::IntegrableDataModelSub, CTL::IntegrableDataModelAdd, CTL::StepFunctionModel, CTL::XraySpectrumTabulatedModel, CTL::TabulatedDataModel, CTL::SaturatedLinearModel, and CTL::NumericalIntegrationDecorator.
|
overridepure virtual |
Creates a copy of this instance and returns a base class pointer to the new object.
Implements CTL::AbstractDataModel.
Implemented in CTL::TASMIPSpectrumModel, CTL::HeuristicCubicSpectrumModel, CTL::KramersLawSpectrumModel, CTL::FixedXraySpectrumModel, CTL::GaussianModel1D, CTL::IdentityModel, CTL::XrayLaserSpectrumModel, CTL::ConstantModel, CTL::IntegrableDataModelSub, CTL::IntegrableDataModelAdd, CTL::StepFunctionModel, CTL::XraySpectrumTabulatedModel, CTL::TabulatedDataModel, CTL::AbstractXraySpectrumModel, CTL::SaturatedLinearModel, and CTL::NumericalIntegrationDecorator.