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

Generic implementation of a gantry component. More...

#include <genericgantry.h>

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

Public Types

enum  { Type = 201 }
 
- Public Types inherited from CTL::AbstractGantry
enum  { Type = 200 }
 
- 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
 
 GenericGantry (const QString &name=defaultName())
 
 GenericGantry (const mat::Location &sourceLocation, const mat::Location &detectorLocation, const QString &name=defaultName())
 
 GenericGantry (const Vector3x1 &sourcePosition, const Matrix3x3 &sourceRotation, const Vector3x1 &detectorPosition, const Matrix3x3 &detectorRotation, const QString &name=defaultName())
 
SystemComponentclone () const override
 
QString info () const override
 
void fromVariant (const QVariant &variant) override
 
QVariant toVariant () const override
 
void setDetectorLocation (const mat::Location &location)
 
void setSourceLocation (const mat::Location &location)
 
void setDetectorPosition (const Vector3x1 &detectorPosition)
 
void setDetectorRotation (const Matrix3x3 &detectorRotation)
 
void setSourcePosition (const Vector3x1 &sourcePosition)
 
void setSourceRotation (const Matrix3x3 &sourceRotation)
 
- Public Member Functions inherited from CTL::AbstractGantry
mat::Location sourceLocation () const
 
mat::Location detectorLocation () const
 
const mat::LocationdetectorDisplacement () const
 
const mat::LocationgantryDisplacement () const
 
const mat::LocationsourceDisplacement () const
 
void setDetectorDisplacement (const mat::Location &displacement)
 
void setGantryDisplacement (const mat::Location &displacement)
 
void setSourceDisplacement (const mat::Location &displacement)
 
Vector3x1 sourcePosition () const
 
Matrix3x3 sourceRotation () const
 
Vector3x1 detectorPosition () const
 
Matrix3x3 detectorRotation () const
 
void setDetectorDisplacementAngles (double rollAngle, double tiltAngle, double twistAngle)
 
void setDetectorDisplacementPosition (const Vector3x1 &position)
 
void setDetectorDisplacementPosition (double x, double y, double z)
 
void setGantryDisplacementPosition (const Vector3x1 &position)
 
void setGantryDisplacementPosition (double x, double y, double z)
 
void setSourceDisplacementPosition (const Vector3x1 &position)
 
void setSourceDisplacementPosition (double x, double y, double z)
 
std::unique_ptr< GenericGantrytoGeneric () 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 QString defaultName ()
 
static std::unique_ptr< GenericGantryfromOther (const AbstractGantry &other)
 
- Static Public Member Functions inherited from CTL::SystemComponent
static QString defaultName ()
 

Protected Member Functions

mat::Location nominalDetectorLocation () const override
 
mat::Location nominalSourceLocation () const override
 
- Protected Member Functions inherited from CTL::AbstractGantry
 AbstractGantry (const QString &name)
 
 AbstractGantry (const AbstractGantry &)=default
 
 AbstractGantry (AbstractGantry &&)=default
 
AbstractGantryoperator= (const AbstractGantry &)=default
 
AbstractGantryoperator= (AbstractGantry &&)=default
 
- Protected Member Functions inherited from CTL::SerializationInterface
 SerializationInterface ()=default
 
 SerializationInterface (const SerializationInterface &)=default
 
 SerializationInterface (SerializationInterface &&)=default
 
SerializationInterfaceoperator= (const SerializationInterface &)=default
 
SerializationInterfaceoperator= (SerializationInterface &&)=default
 

Private Attributes

mat::Location _detectorLocation
 Location of the detector component.
 
mat::Location _sourceLocation
 Location of the source component.
 

Friends

template<class >
struct SerializationHelper::RegisterWithSerializationHelper
 

Additional Inherited Members

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

Detailed Description

Generic implementation of a gantry component.

This class implements AbstractGantry with a straightforward parametrization of the locations of its detector and source component. In particular, this parametrization consists of the locations (in world coordinates) themselves. These are stored as private members. The abstract interface methods nominalDetectorLocation() and nominalSourceLocation() are implemented such that they simply return their corresponding private members.

Use the setter methods setDetectorLocation() or setSourceLocation() to change the locations of source and/or detector, respectively. For convenience, setter methods for isolated changes of the position or rotation component of these locations are provided.

Constructor & Destructor Documentation

◆ GenericGantry() [1/3]

CTL::GenericGantry::GenericGantry ( const QString &  name = defaultName())

Constructs a GenericGantry object named name.

◆ GenericGantry() [2/3]

CTL::GenericGantry::GenericGantry ( const mat::Location sourceLocation,
const mat::Location detectorLocation,
const QString &  name = defaultName() 
)

Constructs a GenericGantry with the source placed at sourceLocation (note that this includes its position and rotation) and the detector mounted at detectorLocation.

For details on all coordinate systems: see detailed class description.

◆ GenericGantry() [3/3]

CTL::GenericGantry::GenericGantry ( const Vector3x1 sourcePosition,
const Matrix3x3 sourceRotation,
const Vector3x1 detectorPosition,
const Matrix3x3 detectorRotation,
const QString &  name = defaultName() 
)

Constructs a GenericGantry with a source at sourcePosition (orientation given by sourceRotation) and the detector placed at detectorPosition (orientation given by detectorRotation).

For details on all coordinate systems: see detailed class description.

Member Function Documentation

◆ clone()

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

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

Reimplemented from CTL::SystemComponent.

◆ defaultName()

QString CTL::GenericGantry::defaultName ( )
static

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

◆ fromVariant()

void CTL::GenericGantry::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::AbstractGantry.

◆ info()

QString CTL::GenericGantry::info ( ) const
overridevirtual

Returns a formatted string with information about the object.

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

  • Source position
  • Detector position
  • Source rotation
  • Detector rotation.

Reimplemented from CTL::AbstractGantry.

◆ nominalDetectorLocation()

mat::Location CTL::GenericGantry::nominalDetectorLocation ( ) const
overrideprotectedvirtual

Returns the nominal detector location. This ignores any (optional) detector displacement.

Override this method when sub-classing GenericGantry allows for customization of the parametrization of the components' locations.

See also
detectorLocation().

Implements CTL::AbstractGantry.

◆ nominalSourceLocation()

mat::Location CTL::GenericGantry::nominalSourceLocation ( ) const
overrideprotectedvirtual

Returns the nominal source location. This ignores any (optional) source displacement.

Override this method when sub-classing GenericGantry allows for customization of the parametrization of the components' locations.

See also
sourceLocation().

Implements CTL::AbstractGantry.

◆ setDetectorLocation()

void CTL::GenericGantry::setDetectorLocation ( const mat::Location location)

Sets the location (i.e. position and rotation) of the detector to location. Must not contain effects considered by the displacement.

◆ setDetectorPosition()

void CTL::GenericGantry::setDetectorPosition ( const Vector3x1 detectorPosition)

Convenience setter. Sets the position of the detector to detectorPosition.

See also
setDetectorLocation()

◆ setDetectorRotation()

void CTL::GenericGantry::setDetectorRotation ( const Matrix3x3 detectorRotation)

Convenience setter. Sets the rotation of the detector to detectorRotation.

The rotation matrix describes the transformation from WCS to CTS.

See also
setDetectorLocation()

◆ setSourceLocation()

void CTL::GenericGantry::setSourceLocation ( const mat::Location location)

Sets the location (i.e. position and rotation) of the source to location. Must not contain effects considered by the displacement.

◆ setSourcePosition()

void CTL::GenericGantry::setSourcePosition ( const Vector3x1 sourcePosition)

Convenience setter. Sets the position of the source to sourcePosition.

See also
setSourceLocation()

◆ setSourceRotation()

void CTL::GenericGantry::setSourceRotation ( const Matrix3x3 sourceRotation)

Convenience setter. Sets the rotation of the source to sourceRotation.

The rotation matrix describes the transformation from the intrinsic source coordinate system to the WCS.

See also
setSourceLocation()

◆ toVariant()

QVariant CTL::GenericGantry::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::AbstractGantry.

◆ type()

int CTL::GenericGantry::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::AbstractGantry.


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