CTL
0.6.1
Computed Tomography Library
|
The AbstractXraySpectrumModel class is the abstract base class for data models representing X-ray spectra. More...
#include <abstractxrayspectrummodel.h>
Public Member Functions | |
virtual AbstractXraySpectrumModel * | clone () const override=0 |
void | setParameter (const QVariant ¶meter) override |
Sets the energy parameter to parameter. More... | |
QVariant | parameter () const override |
![]() | |
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... | |
float | meanValue (float position, float binWidth) const |
![]() | |
int | type () const override |
virtual float | valueAt (float position) const =0 |
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 |
Protected Attributes | |
float | _energy = 0.0f |
Control parameter of device setting (usually tube voltage). | |
Additional Inherited Members | |
![]() | |
enum | { Type = 0 } |
![]() | |
enum | { Type = -1, UserType = 65536 } |
![]() | |
AbstractIntegrableDataModel (const AbstractIntegrableDataModel &)=default | |
AbstractIntegrableDataModel (AbstractIntegrableDataModel &&)=default | |
AbstractIntegrableDataModel & | operator= (const AbstractIntegrableDataModel &)=default |
AbstractIntegrableDataModel & | operator= (AbstractIntegrableDataModel &&)=default |
![]() | |
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 |
![]() | |
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 AbstractXraySpectrumModel class is the abstract base class for data models representing X-ray spectra.
This class serves as base class for all data models that hold X-ray spectra. Values sampled from such models represent the (relative) photon count emitted at the energy the value has been sampled from - e.g., valueAt(45.0f) would return the contribution at 45 keV. Note that these are differential quantities. The bin integral values (see binIntegral()) return actual photon counts within the given energy range of the bin. Sub-classes must provide an implementation of binIntegral(); in addition to the plain valueAt() method.
This class introduces an additional float
member that is used to store the energy that the data model currently describes. This allows for having a single data model that can provide spectral data for differing device settings (such as varying tube voltage). The energy parameter can be set thorugh setParameter().
For details on de-/serializability of sub-classes, please refer to the documentation of AbstractIntegrableDataModel.
|
overridepure virtual |
Creates a copy of this instance and returns a base class pointer to the new object.
Implements CTL::AbstractIntegrableDataModel.
Implemented in CTL::TASMIPSpectrumModel, CTL::HeuristicCubicSpectrumModel, CTL::KramersLawSpectrumModel, CTL::FixedXraySpectrumModel, CTL::XrayLaserSpectrumModel, and CTL::XraySpectrumTabulatedModel.
|
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.
Reimplemented in CTL::FixedXraySpectrumModel, and CTL::XraySpectrumTabulatedModel.
|
overridevirtual |
Sets the energy parameter to parameter.
parameter can be either a single float
(i.e. the energy in keV) or a QVariantMap that contains the key-value-pair ("energy", [float
] value_to_set).
Note that, when used within an actual source component (AbstractSource::setSpectrumModel()), you do not need to deal with setting this parameter. This should be done automatically by the specific source component class.
Reimplemented from CTL::AbstractDataModel.
Reimplemented in CTL::TASMIPSpectrumModel, CTL::FixedXraySpectrumModel, and CTL::XraySpectrumTabulatedModel.