CTL  0.6.1
Computed Tomography Library
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CTL::AbstractDetector Class Referenceabstract

Base class for detector components. More...

#include <abstractdetector.h>

Inheritance diagram for CTL::AbstractDetector:
Inheritance graph
[legend]
Collaboration diagram for CTL::AbstractDetector:
Collaboration graph
[legend]

Public Types

enum  { Type = 100 }
 
enum  SaturationModelType { Extinction, PhotonCount, Intensity, Undefined }
 
typedef mat::Location ModuleLocation
 
- 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 QVector< ModuleLocationmoduleLocations () const =0
 
 AbstractDetector (const QSize &nbPixelPerModule, const QSizeF &pixelSize, const QString &name)
 
QString info () const override
 
void fromVariant (const QVariant &variant) override
 
QVariant toVariant () const override
 
void setSaturationModel (AbstractDataModel *model, SaturationModelType type)
 
void setSaturationModel (std::unique_ptr< AbstractDataModel > model, SaturationModelType type)
 
void setSpectralResponseModel (AbstractDataModel *model)
 
void setSpectralResponseModel (std::unique_ptr< AbstractDataModel > model)
 
uint nbDetectorModules () const
 
const QSize & nbPixelPerModule () const
 
const QSizeF & pixelDimensions () const
 
const QSizeF & pixelSize () const
 
ModuleLocation moduleLocation (uint module) const
 
const AbstractDataModelsaturationModel () const
 
const AbstractDataModelspectralResponseModel () const
 
XYDataSeries inputResponse (float from, float to, uint nbSamples) const
 
XYDataSeries spectralResponse (float from, float to, uint nbSamples) const
 
SaturationModelType saturationModelType () const
 
double skewAngle () const
 
bool hasSaturationModel () const
 
bool hasSpectralResponseModel () const
 
QSizeF moduleDimensions () const
 
SingleViewData::Dimensions viewDimensions () const
 
std::unique_ptr< GenericDetectortoGeneric () const
 
- Public Member Functions inherited from CTL::SystemComponent
int type () const override
 
 SystemComponent (const QString &name=defaultName())
 
virtual int elementalType () const
 
virtual SystemComponentclone () const
 
void fromVariant (const QVariant &variant) override
 
QVariant toVariant () const override
 
const QString & name () const
 
void rename (QString name)
 
- Public Member Functions inherited from CTL::SerializationInterface
virtual ~SerializationInterface ()=default
 

Protected Member Functions

 AbstractDetector (const QString &name)
 
 AbstractDetector (const AbstractDetector &)=default
 
 AbstractDetector (AbstractDetector &&)=default
 
AbstractDetectoroperator= (const AbstractDetector &)=default
 
AbstractDetectoroperator= (AbstractDetector &&)=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

QSize _nbPixelPerModule
 Number of pixels in each detector module.
 
QSizeF _pixelSize
 Size of individual pixels (in mm).
 
double _skewAngle = 0.0
 obliqueness angle (specifies non-orthogonality of pixels)
 
AbstractDataModelPtr _spectralResponseModel
 Data model for spectral detector response.
 
AbstractDataModelPtr _saturationModel
 Data model for saturation of measured values.
 
SaturationModelType _saturationModelType = Undefined
 States whether saturation model refers to intensity or extinction values.
 

Friends

template<class >
struct SerializationHelper::RegisterWithSerializationHelper
 

Related Functions

(Note that these are not member functions.)

std::unique_ptr< AbstractDetectormakeDetector (ConstructorArguments &&... arguments)
 

Additional Inherited Members

- Static Public Member Functions inherited from CTL::SystemComponent
static QString defaultName ()
 
- Static Protected Member Functions inherited from CTL::SystemComponent
static QString typeInfoString (const std::type_info &type)
 

Detailed Description

Base class for detector components.

This is the base class for all detector components. Detectors are always considered to be composed of multiple flat panel elements, called modules. The arrangement of all modules is described by a vector of ModuleLocation objects, one for each of the modules. The ModuleLocation object must contain the position of the module in world coordinates as well as a rotation matrix that represents the transformation from the module's coordinate system to the CT-system (i.e. the coordinate system of the detector as a whole). In addition to the arrangement, detector modules are characterized by their number of pixels (channels x rows) and the corresponding dimensions of an individual pixel (width x height).

Custom detector types can be implemented by creating a sub-class of AbstractDetector. Such sub-classes need to implement the method moduleLocations() that should extract the location of all flat panel modules in the detector based on the specific parametrization chosen for the sub-class.

When creating a sub-class of AbstractDetector, 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).

Member Typedef Documentation

◆ ModuleLocation

Synonym for mat::Location.

Member Enumeration Documentation

◆ SaturationModelType

Specification of whether the saturation model of this instance relates to intensity or extinction values.

Constructor & Destructor Documentation

◆ AbstractDetector() [1/2]

CTL::AbstractDetector::AbstractDetector ( const QSize &  nbPixelPerModule,
const QSizeF &  pixelSize,
const QString &  name 
)
inline

Constructs an AbstractDetector object with name name which contains modules that have nbPixelPerModule pixels (channels x rows) with physical dimensions of pixelSize (width mm x height mm).

◆ AbstractDetector() [2/2]

CTL::AbstractDetector::AbstractDetector ( const QString &  name)
inlineprotected

Constructs an empty object named name.

Member Function Documentation

◆ fromVariant()

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

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

Reimplemented from CTL::SerializationInterface.

Reimplemented in CTL::CylindricalDetector, CTL::GenericDetector, and CTL::FlatPanelDetector.

◆ hasSaturationModel()

bool CTL::AbstractDetector::hasSaturationModel ( ) const
inline

Returns true if this instance has a saturation model.

◆ hasSpectralResponseModel()

bool CTL::AbstractDetector::hasSpectralResponseModel ( ) const
inline

Returns true if this instance has a saturation model.

◆ info()

QString CTL::AbstractDetector::info ( ) const
inlineoverridevirtual

Returns a formatted string with information about the object.

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

  • Nb. of detector modules
  • Nb. of pixels per module
  • Pixel size.

Reimplemented from CTL::SystemComponent.

Reimplemented in CTL::CylindricalDetector, CTL::GenericDetector, and CTL::FlatPanelDetector.

◆ inputResponse()

XYDataSeries CTL::AbstractDetector::inputResponse ( float  from,
float  to,
uint  nbSamples 
) const
inline

Returns a sampled series of the saturation model of this instance.

Returns an empty XYDataSeries if this instance does not have a saturation model set.

◆ moduleDimensions()

QSizeF CTL::AbstractDetector::moduleDimensions ( ) const
inline

Returns the (physical) dimensions of an individual detector module as QSizeF. Dimensions are specified as width x height.

◆ moduleLocation()

AbstractDetector::ModuleLocation CTL::AbstractDetector::moduleLocation ( uint  module) const
inline

Returns the location of module module. Same as moduleLocations().at(module).

Using this method is typically very inefficient, as it always requires computation of all module locations. In case you need multiple calls to this method, consider storing a local copy of the entire set of locations (using moduleLocations()) and querying individual module locations from that local copy using QVector::at().

See also
moduleLocations()

◆ moduleLocations()

QVector< ModuleLocation > CTL::AbstractDetector::moduleLocations ( ) const
pure virtual

Returns the location (i.e. position and rotation) of all individual detector modules with respect to the (physical) center of the detector. These locations are considered in addition to the global positioning of the detector (managed by AbstractGantry).

Implement this method in derived classes to compute the locations of individual modules based on the specific parametrization of that particular sub-class.

Implemented in CTL::GenericDetector, CTL::CylindricalDetector, and CTL::FlatPanelDetector.

◆ nbDetectorModules()

uint CTL::AbstractDetector::nbDetectorModules ( ) const
inline

Returns the number of detector modules.

Same as moduleLocations().size().

◆ nbPixelPerModule()

const QSize & CTL::AbstractDetector::nbPixelPerModule ( ) const
inline

Returns the number of pixels in an individual module as QSize. Dimensions are specified as detector channels x rows.

◆ pixelDimensions()

const QSizeF & CTL::AbstractDetector::pixelDimensions ( ) const
inline

This function has been deprecated. Use pixelSize() instead.

◆ pixelSize()

const QSizeF & CTL::AbstractDetector::pixelSize ( ) const
inline

Returns the size of an individual pixel as QSizeF. The pixel size specified as width mm x height mm (or x-spacing and y-spacing, respectively).

Pixel sizes always refer to the pixel's rectangular (i.e. unskewed) shape.

◆ saturationModel()

const AbstractDataModel * CTL::AbstractDetector::saturationModel ( ) const
inline

Returns a pointer to the saturation model of this instance.

◆ saturationModelType()

AbstractDetector::SaturationModelType CTL::AbstractDetector::saturationModelType ( ) const
inline

Returns the type of the saturation model, i.e. whether it refers to extinction or intensity values.

◆ setSaturationModel() [1/2]

void CTL::AbstractDetector::setSaturationModel ( AbstractDataModel model,
AbstractDetector::SaturationModelType  type 
)
inline

Sets the saturation model to model. The argument type must specify whether the passed model refers to extinction values or intensities.

◆ setSaturationModel() [2/2]

void CTL::AbstractDetector::setSaturationModel ( std::unique_ptr< AbstractDataModel model,
SaturationModelType  type 
)
inline

Sets the saturation model to model. The argument type must specify whether the passed model refers to extinction values or intensities.

◆ setSpectralResponseModel() [1/2]

void CTL::AbstractDetector::setSpectralResponseModel ( AbstractDataModel model)
inline

Sets the spectral response model to model. The model shall contain multiplicative factors describing the sensitivity of the detector to specific photon energies.

◆ setSpectralResponseModel() [2/2]

void CTL::AbstractDetector::setSpectralResponseModel ( std::unique_ptr< AbstractDataModel model)
inline

Sets the spectral response model to model. The model shall contain multiplicative factors describing the sensitivity of the detector to specific photon energies.

◆ spectralResponse()

XYDataSeries CTL::AbstractDetector::spectralResponse ( float  from,
float  to,
uint  nbSamples 
) const
inline

Returns a sampled series of the spectral response model of this instance.

Returns an empty XYDataSeries if this instance does not have a spectral response model set.

◆ spectralResponseModel()

const AbstractDataModel * CTL::AbstractDetector::spectralResponseModel ( ) const
inline

Returns a pointer to the spectral response model of this instance.

◆ toVariant()

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

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

Reimplemented from CTL::SerializationInterface.

Reimplemented in CTL::CylindricalDetector, CTL::GenericDetector, and CTL::FlatPanelDetector.

◆ type()

int CTL::AbstractDetector::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::SerializationInterface.

Reimplemented in CTL::GenericDetector, CTL::CylindricalDetector, and CTL::FlatPanelDetector.

◆ viewDimensions()

SingleViewData::Dimensions CTL::AbstractDetector::viewDimensions ( ) const
inline

Returns the dimensions of a single view that would be acquired by this instance. This contains number of channels (per module), number of rows (per module) and number of modules.

Friends And Related Function Documentation

◆ makeDetector()

std::unique_ptr< AbstractDetector > makeDetector ( ConstructorArguments &&...  arguments)
related

Factory method to construct an object of any sub-class of AbstractDetector and wrap the object in an std::unique_ptr<AbstractDetector>.

This is similar to the more general method GenericComponent::makeComponent() with the difference that it returns a unique pointer to the AbstractDetector base type instead of GenericComponent.

See also
GenericComponent::makeComponent().

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