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

Specialized sub-class of AbstractDetector for detector systems with cylindrical arrangement of modules. More...

#include <cylindricaldetector.h>

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

Public Types

enum  { Type = 110 }
 
- 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
 Computes the locations, i.e. their relative position and orientation w.r.t. the center of the full detector, of all detector modules. More...
 
 CylindricalDetector (const QSize &nbPixelPerModule, const QSizeF &pixelSize, uint nbDetectorModules, double angulationPerModule, double moduleSpacing, const QString &name=defaultName())
 
SystemComponentclone () const override
 
QString info () const override
 
void fromVariant (const QVariant &variant) override
 
QVariant toVariant () const override
 
double angulationOfModule (uint module) const
 
double moduleSpacing () const
 
double coneAngle () const
 
double curvatureRadius () const
 
double fanAngle () const
 
double rowCoverage () const
 
- 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 CylindricalDetector fromAngulationAndSpacing (const QSize &nbPixelPerModule, const QSizeF &pixelSize, uint nbDetectorModules, double angulationPerModule, double moduleSpacing, const QString &name=defaultName())
 
static CylindricalDetector fromRadiusAndFanAngle (const QSize &nbPixelPerModule, const QSizeF &pixelSize, uint nbDetectorModules, double radius, double fanAngle, const QString &name=defaultName())
 
static QString defaultName ()
 
- Static Public Member Functions inherited from CTL::SystemComponent
static QString defaultName ()
 

Protected Attributes

uint _nbModules
 Number of individual (flat-panel) modules in the detector.
 
double _angulationPerModule
 Angulation (in rad) between adjacent detector modules.
 
double _moduleSpacing
 Gap between adjacent detector modules (zero if fitting tight).
 
- 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

 CylindricalDetector (const QString &name=defaultName())
 
double moduleWidth () const
 
void setAngulationFromFanAngle (uint nbModules, double fanAngle, double radius)
 
void setSpacingFromRadius (double radius)
 
QVector< double > moduleAngulations () const
 
QVector< ModuleLocationmoduleLocationsFlatApprox () const
 Computes the locations, i.e. their relative position and orientation w.r.t. the center of the full detector, of all detector modules based on a flat detector approximation. More...
 

Static Private Attributes

static constexpr auto MIN_ANGUL = 1.0e-6
 

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

Specialized sub-class of AbstractDetector for detector systems with cylindrical arrangement of modules.

This class implements a structure to describe cylindrical detector systems. The detector system consists of multiple flat panel modules that are organized in a linear fashion, i.e. the system can be described as one row of modules. In this geometry, all center points of the modules lay on a cylindrical surface. The geometry is specified by the angulation between adjacent modules and the (optional) spacing in between them.

Constructor & Destructor Documentation

◆ CylindricalDetector() [1/2]

CTL::CylindricalDetector::CylindricalDetector ( const QSize &  nbPixelPerModule,
const QSizeF &  pixelSize,
uint  nbDetectorModules,
double  angulationPerModule,
double  moduleSpacing,
const QString &  name = defaultName() 
)

Constructs a CylindricalDetector object that is composed of nbDetectorModules (flat-panel) detector modules, each of which with nbPixelPerModule pixels with physical dimensions pixelSize. The arrangement of the individual modules is constructed based on the angulationPerModule and moduleSpacing parameters.

◆ CylindricalDetector() [2/2]

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

Constructs an empty (invalid) CylindricalDetector object.

To be used only in combination with deserialization by means of fromVariant().

Member Function Documentation

◆ angulationOfModule()

double CTL::CylindricalDetector::angulationOfModule ( uint  module) const

Returns the angulation of module module (in radians) with respect to the center of the detector.

◆ clone()

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

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

Reimplemented from CTL::SystemComponent.

◆ coneAngle()

double CTL::CylindricalDetector::coneAngle ( ) const

Returns the cone angle of the detector.

The cone angle is computed under the assumption that a point source located at the distance of the curvature radius is used.

◆ curvatureRadius()

double CTL::CylindricalDetector::curvatureRadius ( ) const

Returns the curvature radius of the given detector arrangement.

This is computed as: \(r=d/\sqrt{2(1-\cos\alpha)}\) where \(r\) denotes the curvature radius and \(\alpha=\mathtt{\_angulationPerModule}\). The length \(d\) is computed as follows: \(d=\mathtt{\_moduleSpacing}+\mathtt{\_moduleWidth}\cdot\cos\left(\alpha/2\right)\).

Returns std::numeric_limits<double>::max() if the module angulation is zero (flat panel),

◆ defaultName()

QString CTL::CylindricalDetector::defaultName ( )
static

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

◆ fanAngle()

double CTL::CylindricalDetector::fanAngle ( ) const

Returns the total fan angle covered by the detector.

This contains the angle between all modules and the fan angle of one isolated module (two times half a module at the borders of the detector): \(\mathtt{fanAngle}=\left(\mathtt{nbModule}-1\right)\cdot\alpha+2\cdot\arctan(\mathtt{moduleWidth}/ (2\cdot\mathtt{radius})\)

◆ fromAngulationAndSpacing()

CylindricalDetector CTL::CylindricalDetector::fromAngulationAndSpacing ( const QSize &  nbPixelPerModule,
const QSizeF &  pixelSize,
uint  nbDetectorModules,
double  angulationPerModule,
double  moduleSpacing,
const QString &  name = defaultName() 
)
static

Factory method to construct a CylindricalDetector from the parameters angulationPerModule and moduleSpacing. This method simply calls the constructor.

See also
CylindricalDetector().

◆ fromRadiusAndFanAngle()

CylindricalDetector CTL::CylindricalDetector::fromRadiusAndFanAngle ( const QSize &  nbPixelPerModule,
const QSizeF &  pixelSize,
uint  nbDetectorModules,
double  radius,
double  fanAngle,
const QString &  name = defaultName() 
)
static

Factory method to construct a CylindricalDetector from the parameters radius and fanAngle instead of module spacing and angulation (as used in the constructor). Use this factory if you want to specify the detector system by its curvature radius and fan angle.

Module angulation and spacing are computed using setAngulationFromFanAngle() and setSpacingFromRadius(), respectively.

◆ fromVariant()

void CTL::CylindricalDetector::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::CylindricalDetector::info ( ) const
overridevirtual

Returns a formatted string with information about the object.

In addition to the information from the base classes (GenericDetector and GenericComponent), the info string contains the following details:

  • Fan angle
  • Cone angle
  • Row coverage
  • Curvature radius

Reimplemented from CTL::AbstractDetector.

◆ moduleAngulations()

QVector< double > CTL::CylindricalDetector::moduleAngulations ( ) const
private

Computes and returns a vector \(\vec{\varphi}\) with equidistributed angulation values.

For a given number of \(N\) modules (extracted using nbDetectorModules()) and an angulation \(\alpha\) between adjacent modules (angulationPerModule), this is yields: \( \vec{\varphi}=\begin{cases} \left(-(N-1)/2\cdot\alpha,-(N-2)/2\cdot\alpha,...,0,...,(N-2)/2\cdot\alpha,(N-1)/2\cdot\alpha \right) & N\,\textrm{odd}\\ \left(-(N-1)/2\cdot\alpha,-(N-2)/2\cdot\alpha,...,-1/2\cdot\alpha,1/2\cdot\alpha,...,(N-2)/2 \cdot\alpha,(N-1)/2\cdot\alpha\right) & N\,\textrm{even} \end{cases} \)

◆ moduleLocations()

QVector< AbstractDetector::ModuleLocation > CTL::CylindricalDetector::moduleLocations ( ) const
overridevirtual

Computes the locations, i.e. their relative position and orientation w.r.t. the center of the full detector, of all detector modules.

Computation is based on the defining parameters radius (extracted using curvatureRadius()) and _angulationPerModule.

This will be delegated to the flat panel approximation if _angulationPerModule < MIN_ANGUL.

See also
moduleLocationsFlatApprox().

Implements CTL::AbstractDetector.

◆ moduleLocationsFlatApprox()

QVector< AbstractDetector::ModuleLocation > CTL::CylindricalDetector::moduleLocationsFlatApprox ( ) const
private

Computes the locations, i.e. their relative position and orientation w.r.t. the center of the full detector, of all detector modules based on a flat detector approximation.

This will be used when the module angulation is smaller than MIN_ANGUL. In this approximation, all modules will be placed within one plane, with their centers aligned on the x-axis. The spacing between the modules will be the requested _moduleSpacing.

Note that other (informative) values of this instance, such as curvatureRadius() and angle coverages (fanAngle(), coneAngle()) will contain inconsistent information in this approximation case.

◆ moduleSpacing()

double CTL::CylindricalDetector::moduleSpacing ( ) const

Returns the spacing between individual modules in this instance. Spacing refers to the edge-to-edge distance between adjacent modules in x-direction.

◆ moduleWidth()

double CTL::CylindricalDetector::moduleWidth ( ) const
private

Returns the width (in mm) of an individual module. Computes as number of pixels times width of a pixel.

◆ rowCoverage()

double CTL::CylindricalDetector::rowCoverage ( ) const

Returns the total coverage (in mm) by the rows of the detector. This is computed as number of rows times height of a module.

◆ setAngulationFromFanAngle()

void CTL::CylindricalDetector::setAngulationFromFanAngle ( uint  nbModules,
double  fanAngle,
double  radius 
)
private

Sets the module angulations based on the parameters nbModules, fanAngle, and radius.

To do so, the required angulation per module \(\alpha\) is computed as: \(\alpha=\left(\mathtt{fanAngle}-2\cdot\arctan(\mathtt{moduleWidth}/(2\cdot\mathtt{radius}) \right)/\left(\mathtt{nbModule}-1\right).\)

◆ setSpacingFromRadius()

void CTL::CylindricalDetector::setSpacingFromRadius ( double  radius)
private

Sets the module spacing based on the radius.

◆ toVariant()

QVariant CTL::CylindricalDetector::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::CylindricalDetector::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: