CTL  0.6.1
Computed Tomography Library
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | Friends | List of all members
CTL::GenericDetector Class Reference

Generic implementation of a detector component. More...

#include <genericdetector.h>

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

Public Types

enum  { Type = 101 }
 
- Public Types inherited from CTL::AbstractDetector
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
 
QVector< ModuleLocationmoduleLocations () 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())
 
SystemComponentclone () const override
 
QString info () const override
 
void fromVariant (const QVariant &variant) override
 
QVariant toVariant () const override
 
std::unique_ptr< GenericDetectorcloneWithOtherModuleLocations (QVector< ModuleLocation > moduleLocations) const
 
void setModuleLocations (QVector< ModuleLocation > moduleLocations)
 
void setPixelSize (const QSizeF &size)
 
void setSkewAngle (double skewAngle)
 
- Public Member Functions inherited from CTL::AbstractDetector
 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 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
 
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
 

Static Public Member Functions

static std::unique_ptr< GenericDetectorfromOther (const AbstractDetector &other)
 
static QString defaultName ()
 
- Static Public Member Functions inherited from CTL::SystemComponent
static QString defaultName ()
 

Protected Attributes

QVector< ModuleLocation_moduleLocations
 Vector of locations of all detector modules.
 
- Protected Attributes inherited from CTL::AbstractDetector
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

- Protected Member Functions inherited from CTL::AbstractDetector
 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
 
- Static Protected Member Functions inherited from CTL::SystemComponent
static QString typeInfoString (const std::type_info &type)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ GenericDetector() [1/3]

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().

◆ GenericDetector() [2/3]

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).

◆ GenericDetector() [3/3]

CTL::GenericDetector::GenericDetector ( const QString &  name = defaultName())
private

Constructs an empty object named name.

Member Function Documentation

◆ clone()

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

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

Reimplemented from CTL::SystemComponent.

◆ defaultName()

QString CTL::GenericDetector::defaultName ( )
static

Returns the default name for the component: "Generic detector".

◆ fromVariant()

void CTL::GenericDetector::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::AbstractDetector.

◆ info()

QString CTL::GenericDetector::info ( ) const
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:

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

Reimplemented from CTL::AbstractDetector.

◆ moduleLocations()

QVector< AbstractDetector::ModuleLocation > CTL::GenericDetector::moduleLocations ( ) const
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.

◆ setModuleLocations()

void CTL::GenericDetector::setModuleLocations ( QVector< ModuleLocation moduleLocations)

Sets the module locations to moduleLocations.

◆ setPixelSize()

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.

◆ setSkewAngle()

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.

◆ toVariant()

QVariant CTL::GenericDetector::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::AbstractDetector.

◆ type()

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


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