CTL
0.6.1
Computed Tomography Library
|
Generic implementation of a detector component. More...
#include <genericdetector.h>
Public Types | |
enum | { Type = 101 } |
![]() | |
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 |
QVector< ModuleLocation > | moduleLocations () const override |
GenericDetector (const QSize &nbPixelPerModule, uint nbModules, const QString &name=defaultName()) | |
GenericDetector (const QSize &nbPixelPerModule, const QSizeF &pixelSize, QVector< ModuleLocation > moduleLocations, const QString &name=defaultName()) | |
SystemComponent * | clone () const override |
QString | info () const override |
void | fromVariant (const QVariant &variant) override |
QVariant | toVariant () const override |
std::unique_ptr< GenericDetector > | cloneWithOtherModuleLocations (QVector< ModuleLocation > moduleLocations) const |
void | setModuleLocations (QVector< ModuleLocation > moduleLocations) |
void | setPixelSize (const QSizeF &size) |
void | setSkewAngle (double skewAngle) |
![]() | |
AbstractDetector (const QSize &nbPixelPerModule, const QSizeF &pixelSize, const QString &name) | |
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 |
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 std::unique_ptr< GenericDetector > | fromOther (const AbstractDetector &other) |
static QString | defaultName () |
![]() | |
static QString | defaultName () |
Protected Attributes | |
QVector< ModuleLocation > | _moduleLocations |
Vector of locations of all detector modules. | |
![]() | |
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. | |
Private Member Functions | |
GenericDetector (const QString &name=defaultName()) | |
Friends | |
template<class > | |
struct | SerializationHelper::RegisterWithSerializationHelper |
Additional Inherited Members | |
![]() | |
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 |
![]() | |
static QString | typeInfoString (const std::type_info &type) |
![]() | |
std::unique_ptr< AbstractDetector > | makeDetector (ConstructorArguments &&... arguments) |
![]() | |
std::unique_ptr< ComponentType > | makeComponent (ConstructorArguments &&... arguments) |
std::unique_ptr< SystemComponent > | makeComponentFromJson (const QJsonObject &object, bool fallbackToGenericType) |
Generic implementation of a detector component.
This class implements AbstractDetector with a straightforward parametrization of the locations of individual flat panel detector modules. In particular, for each module, the location (i.e. position and rotation information) is stored in a private member of this class.
The required interface method moduleLocations() then simply returns this private member.
Use setModuleLocations() to change the location of the modules.
CTL::GenericDetector::GenericDetector | ( | const QSize & | nbPixelPerModule, |
uint | nbModules, | ||
const QString & | name = defaultName() |
||
) |
Constructs a generic detector element with nbModules modules that have nbPixelPerModule pixels (channels
x rows
) with. The moduleLocation will have default constructed locations (position (0,0,0) and unity rotation matrix). Make sure to properly set the module locations using setModuleLocations(). The pixel size is initialized with default values of 1mm x 1mm (width
mm x height
mm). If necessary, adjust them using setPixelSize().
CTL::GenericDetector::GenericDetector | ( | const QSize & | nbPixelPerModule, |
const QSizeF & | pixelSize, | ||
QVector< ModuleLocation > | moduleLocations, | ||
const QString & | name = defaultName() |
||
) |
Constructs a generic detector element with modules that have nbPixelPerModule pixels (channels
x rows
) with physical dimensions of pixelSize (width
mm x height
mm). The arrangement of the individual modules with respect to the entire detector system are specified in moduleLocations as a vector of ModuleLocation elements (each of which contain the modules position and rotation).
|
private |
Constructs an empty object named 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 detector".
|
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::AbstractDetector.
|
overridevirtual |
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::AbstractDetector.
|
overridevirtual |
Returns the vector that stores the module locations.
Each ModuleLocation object contains 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).
Implements CTL::AbstractDetector.
void CTL::GenericDetector::setModuleLocations | ( | QVector< ModuleLocation > | moduleLocations | ) |
Sets the module locations to moduleLocations.
void CTL::GenericDetector::setPixelSize | ( | const QSizeF & | size | ) |
Sets the pixel size to size.
Pixel sizes always refer to the pixel's rectangular (i.e. unskewed) shape.
void CTL::GenericDetector::setSkewAngle | ( | double | skewAngle | ) |
Sets the skew angle to skewAngle. The skew angle refers to the angle between the oblique pixel edge and the (imaginary) edge of a corresponding rectangular pixel.
This is zero if the detector coordinate system is orthogonal.
|
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::AbstractDetector.
|
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::AbstractDetector.