CTL
0.6.1
Computed Tomography Library
|
Public Types | |
enum | { Type = 301 } |
![]() | |
enum | { Type = 300 } |
![]() | |
enum | { Type = 0 } |
![]() | |
enum | { Type = -1, UserType = 65536 } |
Public Member Functions | |
int | type () const override |
virtual EnergyRange | nominalEnergyRange () const override |
GenericSource (const QString &name) | |
GenericSource (const IntervalDataSeries &spectrum, double photonFlux=-1.0, const QSizeF &focalSpotSize=QSizeF(0.0, 0.0), const Vector3x1 &focalSpotPosition=Vector3x1(0.0), const QString &name=defaultName()) | |
GenericSource (const QSizeF &focalSpotSize=QSizeF(0.0, 0.0), const Vector3x1 &focalSpotPosition=Vector3x1(0.0), const QString &name=defaultName()) | |
SystemComponent * | clone () const override |
QString | info () const override |
uint | spectrumDiscretizationHint () const override |
void | fromVariant (const QVariant &variant) override |
QVariant | toVariant () const override |
void | setEnergyRange (const EnergyRange &range) |
void | setSpectrum (const IntervalDataSeries &spectrum, bool updateFlux=false) |
void | setPhotonFlux (double flux) |
![]() | |
virtual IntervalDataSeries | spectrum (uint nbSamples) const |
Returns the (relative) emitted radiation spectrum sampled with nbSamples bins covering the energy range of [energyRange().start(), energyRange().end()] keV. More... | |
virtual void | setSpectrumModel (AbstractXraySpectrumModel *model) |
EnergyRange | energyRange () const |
float | meanEnergy () const |
double | photonFlux () const |
double | fluxModifier () const |
const QSizeF & | focalSpotSize () const |
const Vector3x1 & | focalSpotPosition () const |
const AbstractXraySpectrumModel * | spectrumModel () const |
void | setFluxModifier (double modifier) |
void | setFocalSpotSize (const QSizeF &size) |
void | setFocalSpotSize (double width, double height) |
void | setFocalSpotPosition (const Vector3x1 &position) |
void | setFocalSpotPosition (double x, double y, double z) |
void | setEnergyRangeRestriction (const EnergyRange &window) |
IntervalDataSeries | spectrum (EnergyRange range, uint nbSamples) const |
bool | hasSpectrumModel () const |
void | setSpectrumModel (std::unique_ptr< AbstractXraySpectrumModel > model) |
std::unique_ptr< GenericSource > | toGeneric () const |
![]() | |
int | type () const override |
SystemComponent (const QString &name=defaultName()) | |
virtual int | elementalType () const |
void | fromVariant (const QVariant &variant) override |
QVariant | toVariant () const override |
const QString & | name () const |
void | rename (QString name) |
![]() | |
virtual | ~SerializationInterface ()=default |
Static Public Member Functions | |
static QString | defaultName () |
static void | setPhotonCountInSystem (SimpleCTSystem *system, double photonsPerPixel) |
static std::unique_ptr< GenericSource > | fromOther (const AbstractSource &other, uint nbSamplesForSpectrum=0) |
![]() | |
static QString | defaultName () |
Protected Attributes | |
EnergyRange | _energyRange = { 0.0f, 0.0f } |
Energy range of the emitted radiation. | |
uint | _samplingHint = 0 |
Number of samples from last set spectrum. | |
double | _totalFlux = 0.0 |
Total photon flux (photons/cm² in 1m distance). | |
![]() | |
QSizeF | _focalSpotSize = QSizeF(0.0, 0.0) |
Size of the focal spot (in mm). | |
Vector3x1 | _focalSpotPosition = Vector3x1(0.0) |
Position of the focal spot (relative to source center). | |
double | _fluxModifier = 1.0 |
Global (multiplicative) modifier for the photon flux. | |
DataModelPtr< AbstractXraySpectrumModel > | _spectrumModel |
Data model for the emitted radiation spectrum. | |
EnergyRange | _restrictedEnergyWindow = { 0.0f, 0.0f } |
Windowed energy range. | |
bool | _hasRestrictedEnergyWindow = false |
Friends | |
template<class > | |
struct | SerializationHelper::RegisterWithSerializationHelper |
Additional Inherited Members | |
![]() | |
static const uint | DEFAULT_SPECTRUM_RESOLUTION_HINT = 10 |
![]() | |
static QString | typeInfoString (const std::type_info &type) |
![]() | |
EnergyRange | |
Alias name for CTL::Range<float>. More... | |
![]() | |
std::unique_ptr< ComponentType > | makeComponent (ConstructorArguments &&... arguments) |
std::unique_ptr< SystemComponent > | makeComponentFromJson (const QJsonObject &object, bool fallbackToGenericType) |
CTL::GenericSource::GenericSource | ( | const QString & | name | ) |
Constructs a GenericSource with the name name.
Focal spot size defaults to QSizeF(0.0, 0.0) and the focal spot position to Vector3x1(0.0f).
CTL::GenericSource::GenericSource | ( | const QSizeF & | focalSpotSize = QSizeF(0.0, 0.0) , |
const Vector3x1 & | focalSpotPosition = Vector3x1(0.0) , |
||
const QString & | name = defaultName() |
||
) |
Constructs a GenericSource with a focal spot size of focalSpotSize, the focal spot positioned at focalSpotPosition and the name name.
|
overridevirtual |
Constructs a copy of the object and returns a base class pointer to it.
Reimplemented from CTL::SystemComponent.
|
static |
Returns the default name for the component: "Generic source".
|
overridevirtual |
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::AbstractSource.
|
overridevirtual |
Returns a formatted string with information about the object.
Reimplemented from CTL::AbstractSource.
|
overridevirtual |
Returns the energy range [in keV] of the radiation emitted by this instance.
Implements CTL::AbstractSource.
|
overrideprotectedvirtual |
Returns the nominal photon flux (photons/cm² in 1m distance).
Implements CTL::AbstractSource.
void CTL::GenericSource::setEnergyRange | ( | const EnergyRange & | range | ) |
Sets the energy range to range.
Note that an appropriate energy range will be set automatically when using setSpectrum(). Use this method only if you specifically intend to change the energy range and yor are sure that meaningful information for range is available from the spectrum set to this instance.
void CTL::GenericSource::setPhotonFlux | ( | double | flux | ) |
Sets total photon flux to flux (in photons/cm² in 1m distance).
void CTL::GenericSource::setSpectrum | ( | const IntervalDataSeries & | spectrum, |
bool | updateFlux = false |
||
) |
Sets the spectrum of this instance to the sampled data provided by spectrum. Also sets the energy range of this instance to the range covered by spectrum and stores the number of samples in spectrum for later use in spectrumDiscretizationHint().
Internally, a TabulatedDataModel is created that stores the data passed by spectrum. This model is then used as this component's spectral model. Hence, calling spectrum(spectrumDiscretizationHint()) after setting a spectrum using this method will return the same data series as has been set.
If updateFlux = true
, the total flux will be set to the integral over the samples from spectrum. Otherwise, the total flux remains unchanged. Use this only if you provide unnormalized spectral data that encodes the total flux by its scaling.
|
overridevirtual |
Returns a hint for a reasonable number of sampling points when querying a spectrum of the component. This returns the number of samples of the last spectrum set using setSpectrum().
Reimplemented from CTL::AbstractSource.
|
overridevirtual |
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::AbstractSource.
|
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::AbstractSource.