CTL
0.6.1
Computed Tomography Library
|
Base class for gantry components. More...
#include <abstractgantry.h>
Public Types | |
enum | { Type = 200 } |
![]() | |
enum | { Type = 0 } |
![]() | |
enum | { Type = -1, UserType = 65536 } |
Public Member Functions | |
int | type () const override |
QString | info () const override |
void | fromVariant (const QVariant &variant) override |
QVariant | toVariant () const override |
mat::Location | sourceLocation () const |
mat::Location | detectorLocation () const |
const mat::Location & | detectorDisplacement () const |
const mat::Location & | gantryDisplacement () const |
const mat::Location & | sourceDisplacement () 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< GenericGantry > | 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 | |
virtual mat::Location | nominalDetectorLocation () const =0 |
virtual mat::Location | nominalSourceLocation () const =0 |
AbstractGantry (const QString &name) | |
AbstractGantry (const AbstractGantry &)=default | |
AbstractGantry (AbstractGantry &&)=default | |
AbstractGantry & | operator= (const AbstractGantry &)=default |
AbstractGantry & | operator= (AbstractGantry &&)=default |
![]() | |
SerializationInterface ()=default | |
SerializationInterface (const SerializationInterface &)=default | |
SerializationInterface (SerializationInterface &&)=default | |
SerializationInterface & | operator= (const SerializationInterface &)=default |
SerializationInterface & | operator= (SerializationInterface &&)=default |
Private Attributes | |
mat::Location | _globalGantryDisplacement |
Displacement of the whole gantry. | |
mat::Location | _detectorDisplacement |
Displacement of the detector component. | |
mat::Location | _sourceDisplacement |
Displacement of the source component. | |
Friends | |
template<class > | |
struct | SerializationHelper::RegisterWithSerializationHelper |
Additional Inherited Members | |
![]() | |
static QString | defaultName () |
![]() | |
static QString | typeInfoString (const std::type_info &type) |
![]() | |
std::unique_ptr< ComponentType > | makeComponent (ConstructorArguments &&... arguments) |
std::unique_ptr< SystemComponent > | makeComponentFromJson (const QJsonObject &object, bool fallbackToGenericType) |
Base class for gantry components.
This class manages the positioning of a source and a detector component. This refers to the components' positions in world coordinate system (WCS) and the transformation matrices that describe the transformation between the component's intrinsic system (see below for details) and the WCS.
The location (i.e. position and rotation) of the components is interpreted as follows:
Source: the position refers to the point in space (in WCS) where the radiation is originating from (e.g. the focal spot of an X-ray tube). The rotation matrix describes the transformation from the source coordinate system to the WCS. Here, the source coordinate system means an unaltered CT coordinate system (right-handed), where the source is located at the origin (0,0,0), the detector is in the x-y-plane and the z-axis points towards the detector.
Detector: the position refers to the mechanical center of the detector system in world coordinates. For example: In case of a flat panel detector in an unaltered CT system, this would be the position of the principal point expressed in world coordinates. The rotation matrix describes the transformation from WCS to CT coordinates of the entire detector system.
The AbstractGantry class provides the option to specify so-called displacements for the source and detector (both individually). This displacement is considered to represent deviations from the actual positioning of the components. It can be used e.g. to simulate errors in the mounting of the compontents and/or influences from various other sources of disturbance (e.g. inaccuracies in position reproducability, deformations due to mechanical stress, movement etc.) The displacement consists of a position term (to describe translational dislocation) and a rotation matrix (to explain orientation deviation). The effect of displacement is automatically considered when querying the location of source or detector via sourceLocation() and detectorLocation() (or their convenience alternatives, respectively).
Sub-classes of AbstractGantry can be created to use customized parametrizations for the location of source and detector. To do so, override the methods nominalDetectorLocation() and nominalSourceLocation() in the new class, such that these methods extract the location of both components (i.e. source and detector) based on your chosen parametrization.
When creating a sub-class of AbstractGantry, 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).
|
inlineprotected |
Constructs an AbstractGantry object named name.
|
inline |
Returns the specified displacement of the detector.
\( L_{\textrm{det}}^{\textrm{displ}}= (t_{\textrm{det}}^{\textrm{displ}},R_{\textrm{det}}^{\textrm{displ}}) \)
|
inline |
Returns the final detector location. This considers (optional) effects of a detector displacement.
The location contains the position in world coordinates as well as the rotation matrix that holds the transformation from world coordinates to the CT coordinate system of the detector as a whole.
\( L_{\textrm{det}}^{\textrm{total}}= (t_{\textrm{det}}^{\textrm{total}},R_{\textrm{det}}^{\textrm{total}}) \)
|
inline |
Convenience method. Returns the final position of the detector center in world coordinates.
\( \begin{align*} t_{\textrm{det}}^{\textrm{total}} & =R_{\textrm{gantry}}^{\textrm{displ}}\cdot \left(t_{\textrm{det}}^{\textrm{nominal}}+\left(R_{\textrm{det}}^{\textrm{displ}}\right)^{T} \cdot R_{\textrm{det}}^{\textrm{nominal}}\cdot t_{\textrm{det}}^{\textrm{displ}}\right) +t_{\textrm{gantry}}^{\textrm{displ}}\\& =R_{\textrm{gantry}}^{\textrm{displ}} \cdot t_{\textrm{det}}^{\textrm{nominal}}+\left(R_{\textrm{det}}^{\textrm{total}}\right)^{T} \cdot t_{\textrm{det}}^{\textrm{displ}}+t_{\textrm{gantry}}^{\textrm{displ}} \end{align*} \)
Same as: detectorLocation().position.
|
inline |
Convenience method. Returns the total transformation matrix from world coordinates to the CT coordinate system of the detector as a whole.
\( R_{\textrm{WCS-CTS}}:=R_{\textrm{det}}^{\textrm{total}}=\left(R_{\textrm{det}}^{\textrm{displ}} \right)^{T}\cdot R_{\textrm{det}}^{\textrm{nominal}}\cdot\left(R_{\textrm{gantry}}^{\textrm{displ}} \right)^{T} \)
Same as: detectorLocation().rotation.
|
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::TubularGantry, CTL::GenericGantry, and CTL::CarmGantry.
|
inline |
Returns the specified displacement of the whole gantry.
\( L_{\textrm{gantry}}^{\textrm{displ}}= (t_{\textrm{gantry}}^{\textrm{displ}},R_{\textrm{gantry}}^{\textrm{displ}}) \)
|
inlineoverridevirtual |
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:
Reimplemented from CTL::SystemComponent.
Reimplemented in CTL::TubularGantry, CTL::GenericGantry, and CTL::CarmGantry.
|
protectedpure virtual |
Returns the nominal location of the detector. Nominal means the positioning without consideration of the displacement. This is the expected (or ideal) location as it would occur in a perfect system.
Implement this method in derived classes such that it extracts the location of the detector component based on the parametrization used in that particular sub-class.
Implemented in CTL::TubularGantry, CTL::GenericGantry, and CTL::CarmGantry.
|
protectedpure virtual |
Returns the nominal location of the source. Nominal means the positioning without consideration of the displacement. This is the expected (or ideal) location as it would occur in a perfect system.
Implement this method in derived classes such that it extracts the location of the source component based on the parametrization used in that particular sub-class.
Implemented in CTL::TubularGantry, CTL::GenericGantry, and CTL::CarmGantry.
|
inline |
Sets the displacement of the detector to displacement.
The detector displacement is defined in the CT coordinate system.
|
inline |
Convenience setter. Sets the rotation component of the detector displacement regarding three rotations specified by rollAngle,tiltAngle and twistAngle. In CT coordinates, these rotations refer to:
|
inline |
Convenience setter. Sets the position component of the detector displacement to position.
|
inline |
Convenience setter. Sets the position component of the detector displacement to (x, y, z).
|
inline |
Sets the displacement of the whole gantry to displacement.
The gantry displacement is defined in the world coordinate system.
|
inline |
Convenience setter. Sets the position component of the whole gantry displacement to position.
|
inline |
Convenience setter. Sets the position component of the whole gantry displacement to (x, y, z).
|
inline |
Sets the displacement of the source to displacement.
The source displacement is defined in the world coordinate system.
|
inline |
Convenience setter. Sets the position component of the source displacement to position.
|
inline |
Convenience setter. Sets the position component of the source displacement to (x, y, z).
|
inline |
Returns the specified displacement of the source.
\( L_{\textrm{src}}^{\textrm{displ}}= (t_{\textrm{src}}^{\textrm{displ}},R_{\textrm{src}}^{\textrm{displ}}) \)
|
inline |
Returns the final source location. This considers (optional) effects of a source displacement.
The location contains the position in world coordinates as well as the rotation matrix that holds the transformation from an unaltered source coordinate system to the WCS.
\( L_{\textrm{src}}^{\textrm{total}}= (t_{\textrm{src}}^{\textrm{total}},R_{\textrm{src}}^{\textrm{total}}) \)
|
inline |
Convenience method. Returns the final source position in world coordinates.
\( t_{\textrm{src}}^{\textrm{total}}=R_{\textrm{gantry}}^{\textrm{displ}} \cdot t_{\textrm{src}}^{\textrm{nominal}}+R_{\textrm{src}}^{\textrm{total}} \cdot t_{\textrm{src}}^{\textrm{displ}}+t_{\textrm{gantry}}^{\textrm{displ}} \)
Same as: sourceLocation().position.
|
inline |
Convenience method. Returns the total transformation matrix from an unaltered source coordinate system to the WCS.
\( R_{\textrm{src}}^{\textrm{total}}=R_{\textrm{gantry}}^{\textrm{displ}} \cdot R_{\textrm{src}}^{\textrm{nominal}}\cdot R_{\textrm{src}}^{\textrm{displ}} \)
Same as sourceLocation().rotation.
|
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::TubularGantry, CTL::GenericGantry, and CTL::CarmGantry.
|
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::TubularGantry, CTL::GenericGantry, and CTL::CarmGantry.