CTL
0.6.1
Computed Tomography Library
|
Base class for components that modify the X-ray beam. More...
#include <abstractbeammodifier.h>
Public Types | |
enum | { Type = 400 } |
![]() | |
enum | { Type = 0 } |
![]() | |
enum | { Type = -1, UserType = 65536 } |
Public Member Functions | |
int | type () const override |
virtual IntervalDataSeries | modifiedSpectrum (const IntervalDataSeries &inputSpectrum)=0 |
virtual double | modifiedFlux (double inputFlux, const IntervalDataSeries &inputSpectrum)=0 |
QString | info () const override |
void | fromVariant (const QVariant &variant) override |
QVariant | toVariant () const override |
![]() | |
int | type () const override |
SystemComponent (const QString &name=defaultName()) | |
virtual int | elementalType () const |
virtual SystemComponent * | clone () const |
void | fromVariant (const QVariant &variant) override |
QVariant | toVariant () const override |
const QString & | name () const |
void | rename (QString name) |
![]() | |
virtual | ~SerializationInterface ()=default |
Protected Member Functions | |
AbstractBeamModifier (const QString &name) | |
AbstractBeamModifier (const AbstractBeamModifier &)=default | |
AbstractBeamModifier (AbstractBeamModifier &&)=default | |
AbstractBeamModifier & | operator= (const AbstractBeamModifier &)=default |
AbstractBeamModifier & | operator= (AbstractBeamModifier &&)=default |
![]() | |
SerializationInterface ()=default | |
SerializationInterface (const SerializationInterface &)=default | |
SerializationInterface (SerializationInterface &&)=default | |
SerializationInterface & | operator= (const SerializationInterface &)=default |
SerializationInterface & | operator= (SerializationInterface &&)=default |
Friends | |
template<class > | |
struct | SerializationHelper::RegisterWithSerializationHelper |
Additional Inherited Members | |
![]() | |
static QString | defaultName () |
![]() | |
static QString | typeInfoString (const std::type_info &type) |
![]() | |
std::unique_ptr< ComponentType > | makeComponent (ConstructorArguments &&... arguments) |
std::unique_ptr< SystemComponent > | makeComponentFromJson (const QJsonObject &object, bool fallbackToGenericType) |
Base class for components that modify the X-ray beam.
This is the base class for system components that modify the X-ray beam. Possible examples are radiation filters or collimator systems.
Sub-classes of AbstractBeamModifier can be created to define all kinds of individual modifiers. A sub-class needs to implement the two methods that describe the modification of the spectrum and flux: The modifiedSpectrum() method takes a (constant) reference to the incident radiation spectrum and must return the spectrum afted the radiation passed the beam modifier component. The modifiedFlux() method takes the input flux and a (constant) reference to the incident radiation spectrum and must return the remaining flux behind the beam modifier component.
When creating a sub-class of AbstractBeamModifier, make sure to register the new component in the enumeration using the CTL_TYPE_ID(newIndex) macro. It is required to specify a value for newIndex that is not already in use. This can be easily achieved by use of values starting from GenericComponent::UserType, as these are reserved for user-defined types.
To enable de-/serialization of objects of the new sub-class, reimplement the toVariant() and fromVariant() methods. These should take care of all newly introduced information of the sub-class. 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).
|
inlineprotected |
Constructs an AbstractBeamModifier object named name.
|
inlineoverridevirtual |
Interface to read all member variables from the QVariant variant.
Reimplement this method such that it reads all newly introduced content when sub-classing. A typical reimplementation in sub-classes might look like this:
Reimplemented from CTL::SerializationInterface.
Reimplemented in CTL::AttenuationFilter, and CTL::GenericBeamModifier.
|
inlineoverridevirtual |
Returns a formatted string that contains information about the component.
Reimplemented from CTL::SystemComponent.
Reimplemented in CTL::AttenuationFilter, and CTL::GenericBeamModifier.
|
inlineoverridevirtual |
Interface to store all member variables in a QVariant.
Stores the object's type-id.
Reimplement this method such that it stores all newly introduced object data when sub-classing. This needs to cover everything that is necessary to fully determine the state of an object. 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::SerializationInterface.
Reimplemented in CTL::AttenuationFilter, and CTL::GenericBeamModifier.
|
inlineoverridevirtual |
Returns the type-id of the serializable object. Used in deserialization to determine the proper object type.
Add derived classes to the enumeration using the CTL_TYPE_ID macro.
Reimplemented from CTL::SerializationInterface.
Reimplemented in CTL::GenericBeamModifier, and CTL::AttenuationFilter.