CTL
0.6.1
Computed Tomography Library
|
Base class for detector components. More...
#include <abstractdetector.h>
Public Types | |
enum | { Type = 100 } |
enum | SaturationModelType { Extinction, PhotonCount, Intensity, Undefined } |
typedef mat::Location | ModuleLocation |
![]() | |
enum | { Type = 0 } |
![]() | |
enum | { Type = -1, UserType = 65536 } |
Public Member Functions | |
int | type () const override |
virtual QVector< ModuleLocation > | moduleLocations () 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 AbstractDataModel * | saturationModel () const |
const AbstractDataModel * | spectralResponseModel () 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< GenericDetector > | toGeneric () const |
![]() | |
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 | |
AbstractDetector (const QString &name) | |
AbstractDetector (const AbstractDetector &)=default | |
AbstractDetector (AbstractDetector &&)=default | |
AbstractDetector & | operator= (const AbstractDetector &)=default |
AbstractDetector & | operator= (AbstractDetector &&)=default |
![]() | |
SerializationInterface ()=default | |
SerializationInterface (const SerializationInterface &)=default | |
SerializationInterface (SerializationInterface &&)=default | |
SerializationInterface & | operator= (const SerializationInterface &)=default |
SerializationInterface & | operator= (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< AbstractDetector > | makeDetector (ConstructorArguments &&... arguments) |
![]() | |
std::unique_ptr< ComponentType > | makeComponent (ConstructorArguments &&... arguments) |
std::unique_ptr< SystemComponent > | makeComponentFromJson (const QJsonObject &object, bool fallbackToGenericType) |
Additional Inherited Members | |
![]() | |
static QString | defaultName () |
![]() | |
static QString | typeInfoString (const std::type_info &type) |
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).
Synonym for mat::Location.
Specification of whether the saturation model of this instance relates to intensity or extinction values.
|
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).
|
inlineprotected |
Constructs an empty 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::CylindricalDetector, CTL::GenericDetector, and CTL::FlatPanelDetector.
|
inline |
Returns true if this instance has a saturation model.
|
inline |
Returns true if this instance has a saturation model.
|
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:
Reimplemented from CTL::SystemComponent.
Reimplemented in CTL::CylindricalDetector, CTL::GenericDetector, and CTL::FlatPanelDetector.
|
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.
|
inline |
Returns the (physical) dimensions of an individual detector module as QSizeF. Dimensions are specified as width
x height
.
|
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().
|
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.
|
inline |
Returns the number of detector modules.
Same as moduleLocations().size().
|
inline |
Returns the number of pixels in an individual module as QSize. Dimensions are specified as detector channels
x rows
.
|
inline |
This function has been deprecated. Use pixelSize() instead.
|
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.
|
inline |
Returns a pointer to the saturation model of this instance.
|
inline |
Returns the type of the saturation model, i.e. whether it refers to extinction or intensity values.
|
inline |
Sets the saturation model to model. The argument type must specify whether the passed model refers to extinction values or intensities.
|
inline |
Sets the saturation model to model. The argument type must specify whether the passed model refers to extinction values or intensities.
|
inline |
Sets the spectral response model to model. The model shall contain multiplicative factors describing the sensitivity of the detector to specific photon energies.
|
inline |
Sets the spectral response model to model. The model shall contain multiplicative factors describing the sensitivity of the detector to specific photon energies.
|
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.
|
inline |
Returns a pointer to the spectral response model of this instance.
|
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::CylindricalDetector, CTL::GenericDetector, and CTL::FlatPanelDetector.
|
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.
|
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.
|
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.