CTL  0.6.1
Computed Tomography Library
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Friends | List of all members
CTL::XrayTube Class Reference
Inheritance diagram for CTL::XrayTube:
Inheritance graph
[legend]
Collaboration diagram for CTL::XrayTube:
Collaboration graph
[legend]

Public Types

enum  { Type = 320 }
 
- Public Types inherited from CTL::AbstractSource
enum  { Type = 300 }
 
- Public Types inherited from CTL::SystemComponent
enum  { Type = 0 }
 
- Public Types inherited from CTL::SerializationInterface
enum  { Type = -1, UserType = 65536 }
 

Public Member Functions

int type () const override
 
virtual EnergyRange nominalEnergyRange () const override
 
 XrayTube (const QString &name)
 
 XrayTube (const QSizeF &focalSpotSize=QSizeF(0.0, 0.0), const Vector3x1 &focalSpotPosition=Vector3x1(0.0), double tubeVoltage=100.0, double mAs=1.0, const QString &name=defaultName())
 
 XrayTube (const QSizeF &focalSpotSize, double tubeVoltage, double mAs, const QString &name=defaultName())
 
 XrayTube (double tubeVoltage, double mAs, const QString &name=defaultName())
 
SystemComponentclone () const override
 
QString info () const override
 
void fromVariant (const QVariant &variant) override
 
QVariant toVariant () const override
 
uint spectrumDiscretizationHint () const override
 
double tubeVoltage () const
 
double mAs () const
 
void setTubeVoltage (double voltage)
 
void setMilliampereSeconds (double mAs)
 
- Public Member Functions inherited from CTL::AbstractSource
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 Vector3x1focalSpotPosition () const
 
const AbstractXraySpectrumModelspectrumModel () 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< GenericSourcetoGeneric () const
 
- Public Member Functions inherited from CTL::SystemComponent
 SystemComponent (const QString &name=defaultName())
 
virtual int elementalType () const
 
const QString & name () const
 
void rename (QString name)
 
- Public Member Functions inherited from CTL::SerializationInterface
virtual ~SerializationInterface ()=default
 

Static Public Member Functions

static QString defaultName ()
 
- Static Public Member Functions inherited from CTL::SystemComponent
static QString defaultName ()
 

Protected Member Functions

virtual double nominalPhotonFlux () const override
 
- Protected Member Functions inherited from CTL::AbstractSource
 AbstractSource (const QString &name)
 
 AbstractSource (const QSizeF &focalSpotSize, const QString &name)
 
 AbstractSource (const QSizeF &focalSpotSize, const Vector3x1 &focalSpotPosition, const QString &name)
 
 AbstractSource (const QSizeF &focalSpotSize, const Vector3x1 &focalSpotPosition, AbstractXraySpectrumModel *spectumModel, const QString &name)
 
 AbstractSource (const AbstractSource &)=default
 
 AbstractSource (AbstractSource &&)=default
 
AbstractSourceoperator= (const AbstractSource &)=default
 
AbstractSourceoperator= (AbstractSource &&)=default
 
- Protected Member Functions inherited from CTL::SerializationInterface
 SerializationInterface ()=default
 
 SerializationInterface (const SerializationInterface &)=default
 
 SerializationInterface (SerializationInterface &&)=default
 
SerializationInterfaceoperator= (const SerializationInterface &)=default
 
SerializationInterfaceoperator= (SerializationInterface &&)=default
 

Protected Attributes

double _tubeVoltage = 100.0
 
double _mAs = 1.0
 
double _intensityConstant = 3.2e8
 
- Protected Attributes inherited from CTL::AbstractSource
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
 

Private Member Functions

void updateIntensityConstant ()
 

Friends

template<class >
struct SerializationHelper::RegisterWithSerializationHelper
 

Additional Inherited Members

- Static Public Attributes inherited from CTL::AbstractSource
static const uint DEFAULT_SPECTRUM_RESOLUTION_HINT = 10
 
- Static Protected Member Functions inherited from CTL::SystemComponent
static QString typeInfoString (const std::type_info &type)
 

Constructor & Destructor Documentation

◆ XrayTube() [1/4]

CTL::XrayTube::XrayTube ( const QString &  name)

Constructs an XrayTube named name.

This constructor defaults the focal spot size to QSizeF(0.0,0.0) and the focal spot position to Vector3x1(0.0). The tube (acceleration) voltage is set to 100 kV and the emission-current- time-product (used for a single X-ray shot) to 1.0 mAs.

◆ XrayTube() [2/4]

CTL::XrayTube::XrayTube ( const QSizeF &  focalSpotSize = QSizeF(0.0, 0.0),
const Vector3x1 focalSpotPosition = Vector3x1(0.0),
double  tubeVoltage = 100.0,
double  mAs = 1.0,
const QString &  name = defaultName() 
)

Constructs an XrayTube with a focal spot size of focalSpotSize and its focal spot positioned at focalSpotPosition. Sets the tube (acceleration) voltage to tubeVoltage and the emission- current-time-product (used for a single X-ray shot) to mAs. Also sets the component's name to name.

◆ XrayTube() [3/4]

CTL::XrayTube::XrayTube ( const QSizeF &  focalSpotSize,
double  tubeVoltage,
double  mAs,
const QString &  name = defaultName() 
)

Constructs an XrayTube with a focal spot size of focalSpotSize. Sets the tube (acceleration) voltage to tubeVoltage and the emission-current-time-product (used for a single X-ray shot) to mAs. Also sets the component's name to name.

This constructor defaults the focal spot position to Vector3x1(0.0).

◆ XrayTube() [4/4]

CTL::XrayTube::XrayTube ( double  tubeVoltage,
double  mAs,
const QString &  name = defaultName() 
)

Constructs an XrayTube with a tube (acceleration) voltage of tubeVoltage and an emission- current-time-product (used for a single X-ray shot) of mAs. Also sets the component's name to name.

This constructor defaults the focal spot size to QSizeF(0.0,0.0) and the focal spot position to Vector3x1(0.0).

Member Function Documentation

◆ clone()

SystemComponent * CTL::XrayTube::clone ( ) const
overridevirtual

Constructs a copy of the object and returns a base class pointer to it.

Reimplemented from CTL::SystemComponent.

◆ defaultName()

QString CTL::XrayTube::defaultName ( )
static

Returns the default name for the component: "X-ray tube".

◆ fromVariant()

void CTL::XrayTube::fromVariant ( const QVariant &  variant)
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:

DirectBaseClass::fromVariant(variant);
// assuming our class has a member "double _myMemberVariable"
_myMemberVariable = variant.toMap().value("my member variable").toDouble();

Reimplemented from CTL::AbstractSource.

◆ info()

QString CTL::XrayTube::info ( ) const
overridevirtual

Returns a formatted string with information about the object.

In addition to the information from the base class (SystemComponent), the info string contains the following details:

  • Tube voltage
  • Emission-current-time-product (mAs)

Reimplemented from CTL::AbstractSource.

◆ mAs()

double CTL::XrayTube::mAs ( ) const

Returns the emission-current-time-product (in mAs) for an individual X-ray shot.

◆ nominalEnergyRange()

EnergyRange CTL::XrayTube::nominalEnergyRange ( ) const
overridevirtual

Returns the energy range [in keV] of the radiation emitted by this instance.

This is [0 keV, e * tubeVoltage].

Implements CTL::AbstractSource.

◆ nominalPhotonFlux()

double CTL::XrayTube::nominalPhotonFlux ( ) const
overrideprotectedvirtual

Returns the nominal photon flux (photons/cm² in 1m distance).

This is the product of the emission-current-time-product (mAs) and the intensity constant.

Implements CTL::AbstractSource.

◆ setMilliampereSeconds()

void CTL::XrayTube::setMilliampereSeconds ( double  mAs)

Sets the emission-current-time-product [in mAs] (used for a single X-ray shot) to mAs.

◆ setTubeVoltage()

void CTL::XrayTube::setTubeVoltage ( double  voltage)

Sets the tube (acceleration) voltage to voltage (in kV).

◆ spectrumDiscretizationHint()

uint CTL::XrayTube::spectrumDiscretizationHint ( ) const
overridevirtual

Returns a hint for a reasonable number of sampling points when querying a spectrum of the XrayTube instance. This returns the number of samples (rounded up) required to cover the full energy range of this instance (see energyRange()) with a resolution of (at least) 10 keV. Returns a minimum of one sample.

Example:

XrayTube tube; // Default tube voltage is 100kV.
qInfo() << "Energy range:" << tube.energyRange().start() << tube.energyRange().end() << "keV";
qInfo() << "Recommended nb. of samples:" << tube.spectrumDiscretizationHint();
tube.setTubeVoltage(75.0);
qInfo() << "Energy range:" << tube.energyRange().start() << tube.energyRange().end() << "keV";
qInfo() << "Recommended nb. of samples:" << tube.spectrumDiscretizationHint();
// Output:
// Energy range: 0 100 keV
// Recommended nb. of samples: 10
// Energy range: 0 75 keV
// Recommended nb. of samples: 8

Reimplemented from CTL::AbstractSource.

◆ toVariant()

QVariant CTL::XrayTube::toVariant ( ) const
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:

QVariantMap ret = DirectBaseClass::toVariant().toMap();
ret.insert("my member variable", _myMemberVariable);
return ret;

Reimplemented from CTL::AbstractSource.

◆ tubeVoltage()

double CTL::XrayTube::tubeVoltage ( ) const

Returns the tube (acceleration) voltage (in kV).

◆ type()

int CTL::XrayTube::type ( ) const
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.


The documentation for this class was generated from the following files: