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

The SimpleCTSystem class is a specialized sub-class of CTSystem for simple systems (i.e. with a single gantry, detector and source). More...

#include <simplectsystem.h>

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

Public Member Functions

 SimpleCTSystem (const AbstractDetector &detector, const AbstractGantry &gantry, const AbstractSource &source)
 
 SimpleCTSystem (AbstractDetector &&detector, AbstractGantry &&gantry, AbstractSource &&source)
 
 Q_DECL_DEPRECATED_X ("Function has been renamed. " "Please consider the new spelling 'fromCTSystem'.") static SimpleCTSystem fromCTsystem(const CTSystem &system
 
 Q_DECL_DEPRECATED_X ("Function has been renamed. " "Please consider the new spelling 'fromCTSystem'.") static SimpleCTSystem fromCTsystem(CTSystem &&system
 
CTSystemclone () const &override
 
CTSystemclone () &&override
 
AbstractDetectordetector () const
 
AbstractGantrygantry () const
 
AbstractSourcesource () const
 
void replaceDetector (AbstractDetector *newDetector)
 
void replaceDetector (std::unique_ptr< AbstractDetector > newDetector)
 
void replaceGantry (AbstractGantry *newGantry)
 
void replaceGantry (std::unique_ptr< AbstractGantry > newGantry)
 
void replaceSource (AbstractSource *newSource)
 
void replaceSource (std::unique_ptr< AbstractSource > newSource)
 
void addBeamModifier (AbstractBeamModifier *modifier)
 
void addBeamModifier (std::unique_ptr< AbstractBeamModifier > modifier)
 
float photonsPerPixelMean () const
 
float photonsPerPixel (uint module) const
 
std::vector< float > photonsPerPixel () const
 
void removeBeamModifiers ()
 Removes all beam modifiers in this system.
 
- Public Member Functions inherited from CTL::CTSystem
 CTSystem (QString name=defaultName())
 
 CTSystem (const CTSystem &other)
 
 CTSystem (CTSystem &&other)=default
 
CTSystemoperator= (CTSystem &&other)=default
 
CTSystemoperator= (const CTSystem &other)
 
virtual ~CTSystem () override=default
 
virtual QString info () const
 
virtual QString overview () const
 
void fromVariant (const QVariant &variant) override
 
QVariant toVariant () const override
 
std::vector< AbstractDetector * > detectors () const
 
std::vector< AbstractGantry * > gantries () const
 
std::vector< AbstractSource * > sources () const
 
std::vector< AbstractBeamModifier * > modifiers () const
 
const std::vector< ComponentPtr > & components () const
 
const QString & name () const
 
uint nbComponents () const
 
void addComponent (ComponentPtr component)
 
void addComponent (SystemComponent *component)
 
void clear ()
 
bool isEmpty () const
 
bool isValid () const
 
bool isSimple () const
 
void rename (QString name)
 
void removeComponent (SystemComponent *component)
 
CTSystemoperator<< (ComponentPtr component)
 
CTSystemoperator<< (SystemComponent *component)
 
- Public Member Functions inherited from CTL::SerializationInterface
virtual int type () const
 
virtual ~SerializationInterface ()=default
 

Static Public Member Functions

static SimpleCTSystem fromCTSystem (const CTSystem &system, bool *ok=nullptr)
 
static SimpleCTSystem fromCTSystem (CTSystem &&system, bool *ok=nullptr)
 
- Static Public Member Functions inherited from CTL::CTSystem
static QString defaultName ()
 

Public Attributes

bool * ok = nullptr)
 

Protected Member Functions

 SimpleCTSystem ()=default
 
 SimpleCTSystem (const CTSystem &)
 
 SimpleCTSystem (CTSystem &&system)
 
- Protected Member Functions inherited from CTL::SerializationInterface
 SerializationInterface ()=default
 
 SerializationInterface (const SerializationInterface &)=default
 
 SerializationInterface (SerializationInterface &&)=default
 
SerializationInterfaceoperator= (const SerializationInterface &)=default
 
SerializationInterfaceoperator= (SerializationInterface &&)=default
 

Private Member Functions

void addComponent (ComponentPtr component)
 
void addComponent (SystemComponent *component)
 
void clear ()
 
void removeComponent (SystemComponent *component)
 
CTSystemoperator<< (ComponentPtr component)
 
CTSystemoperator<< (SystemComponent *component)
 

Additional Inherited Members

- Public Types inherited from CTL::CTSystem
typedef std::unique_ptr< SystemComponentComponentPtr
 Alias for unique pointer to SystemComponent.
 
- Public Types inherited from CTL::SerializationInterface
enum  { Type = -1, UserType = 65536 }
 

Detailed Description

The SimpleCTSystem class is a specialized sub-class of CTSystem for simple systems (i.e. with a single gantry, detector and source).

This class is a specialization of CTSystem to describe systems that have the simple configuration that involves only a single source and detector mounted on a single gantry component.

The CTL framework is based on geometry description that uses projection matrices. These can only fully describe the system geometry for this type of system configuration. Consequently, all further parts of the framework (e.g. geometry encoding, definition of acquisition setups) rely on the SimpleCTSystem class (and their sub-classes).

Instances of this class can be created from "regular" CTSystem objects using the factory method fromCTSystem(). This assures that the configuration of the system is simple. Alternatively, a constructor taking all three essential components can also be used. As it is required for SimpleCTSystem objects at all times to retain a simple configuration, adding further components using addComponent() (or removing components with removeComponent()) is no longer allowed. Instead, beam modifiers - these can be contained in an arbitrary number - can be added using addBeamModifier(). For convenience, each of the three essential components can, however, be replaced by another component of the appropriate type using the corresponding methods replaceDetector(), replaceGantry() and replaceSource().

CTSystem mySystem("A simple system");
// We now create some components and add them to the system.
AbstractDetector* myDetector = new FlatPanelDetector(QSize(100, 100), QSizeF(1.0f, 1.0f));
AbstractSource* mySource = new XrayTube(120.0, 1.0);
AbstractGantry* myGantry = new TubularGantry(1000.0, 500.0);
mySystem << myDetector << mySource;
// The system is still missing a gantry component by now.
std::cout << "simpleSystem is valid: " << simpleSystem.isValid() << std::endl;
// Output: simpleSystem is valid: 0
// We now add the missing gantry.
mySystem << myGantry;
simpleSystem = SimpleCTSystem::fromCTSystem(mySystem);
std::cout << "simpleSystem is valid: " << simpleSystem.isValid() << std::endl;
// Output: simpleSystem is valid: 1
// We can now easily access the central components:
AbstractDetector* theDetector = simpleSystem.detector();
std::cout << theDetector->info().toStdString();
// *** Output ***
// Object(N3CTL17FlatPanelDetectorE) {
// Name: Flat panel detector (2)
// -------PKN3CTL16AbstractDetectorE----------------------
// Nb. of pixels per module: 100 x 100
// Pixel dimensions: 1 mm x 1 mm
// -------PKN3CTL17FlatPanelDetectorE---------------------
// }
// Other example: change the rotation angle of the tubular gantry
TubularGantry* theGantry = dynamic_cast<TubularGantry*>(simpleSystem.gantry());
theGantry->setRotationAngle(90.0_deg);
std::cout << theGantry->info().toStdString();
// *** Output ***
// Object(N3CTL13TubularGantryE) {
// Name: Tubular gantry (2)
// -------PKN3CTL14AbstractGantryE------------------------
// Source Displacement: (0 mm, 0 mm, 0 mm)
// -Rotation:
// |1,000000___0,000000___0,000000|
// |0,000000___1,000000___0,000000|
// |0,000000___0,000000___1,000000|
// Detector Displacement: (0 mm, 0 mm, 0 mm)
// -Rotation:
// |1,000000___0,000000___0,000000|
// |0,000000___1,000000___0,000000|
// |0,000000___0,000000___1,000000|
// -------PKN3CTL13TubularGantryE-------------------------
// Source-to-detector distance: 1000 mm
// Source-to-iso-center distance: 500 mm
// Rotation angle: 90 deg
// Table pitch position: 0 mm
// Tilt angle: 0 deg
// }
See also
isSimple().

Constructor & Destructor Documentation

◆ SimpleCTSystem() [1/5]

CTL::SimpleCTSystem::SimpleCTSystem ( const AbstractDetector detector,
const AbstractGantry gantry,
const AbstractSource source 
)

Constructs a SimpleCTSystem with the components detector, gantry and source.

◆ SimpleCTSystem() [2/5]

CTL::SimpleCTSystem::SimpleCTSystem ( AbstractDetector &&  detector,
AbstractGantry &&  gantry,
AbstractSource &&  source 
)

Constructs a SimpleCTSystem with the components detector, gantry and source.

◆ SimpleCTSystem() [3/5]

CTL::SimpleCTSystem::SimpleCTSystem ( )
protecteddefault

Default constructor. In protected domain and not intended for external use.

◆ SimpleCTSystem() [4/5]

CTL::SimpleCTSystem::SimpleCTSystem ( const CTSystem system)
protected

Constructs a SimpleCTSystem object as a copy of the CTSystem system.

Note that this constructor does not check whether system can properly be "converted" into a SimpleCTSystem. This is acceptable here, since it is protected and is only called from the public factory method fromCTSystem(), which already makes sure that the system is simple (and thus, can be converted).

◆ SimpleCTSystem() [5/5]

CTL::SimpleCTSystem::SimpleCTSystem ( CTSystem &&  system)
protected

Move-constructs a SimpleCTSystem object from CTSystem system.

Note that this constructor does not check whether system can properly be "converted" into a SimpleCTSystem. This is acceptable here, since it is protected and is only called from the public factory method fromCTSystem(), which already makes sure that the system is simple (and thus, can be converted).

Member Function Documentation

◆ addBeamModifier() [1/2]

void CTL::SimpleCTSystem::addBeamModifier ( AbstractBeamModifier modifier)

Adds the AbstractBeamModifier modifier to the system. This instance takes ownership of modifier.

◆ addBeamModifier() [2/2]

void CTL::SimpleCTSystem::addBeamModifier ( std::unique_ptr< AbstractBeamModifier modifier)

Adds the AbstractBeamModifier modifier to the system.

◆ addComponent() [1/2]

void CTL::CTSystem::addComponent
private

Adds component to the system. Does nothing if component is null.

◆ addComponent() [2/2]

void CTL::CTSystem::addComponent
private

Adds component to the system. This CTSystem instance takes ownership of component.

Does nothing if component is null.

◆ clear()

void CTL::CTSystem::clear
private

Removes all components from the system.

◆ clone() [1/2]

CTSystem * CTL::SimpleCTSystem::clone ( ) const &
overridevirtual

Constructs a copy of the system and returns a base-class pointer to the new object.

Reimplemented from CTL::CTSystem.

◆ clone() [2/2]

CTSystem * CTL::SimpleCTSystem::clone ( ) &&
overridevirtual

Constructs a new CTSystem object and moves the content of this instance into the new object. Returns a base class pointer to the new instance.

Reimplemented from CTL::CTSystem.

◆ detector()

AbstractDetector * CTL::SimpleCTSystem::detector ( ) const

Returns a pointer to the detector component in the system. This does not transfer ownership.

◆ fromCTSystem() [1/2]

SimpleCTSystem CTL::SimpleCTSystem::fromCTSystem ( const CTSystem system,
bool *  ok = nullptr 
)
static

Constructs and returns a SimpleCTSystem object from the CTSystem system. Returns an empty object if system is not simple (isEmpty() of the returned object will return true). If ok is nonnull *ok will be set to true if the conversion to a SimpleCTSystem was successful, i.e. system is simple, otherwise *ok will be set to false. If ok is a nullptr and the system is not simple, an exception will be thrown.

◆ fromCTSystem() [2/2]

SimpleCTSystem CTL::SimpleCTSystem::fromCTSystem ( CTSystem &&  system,
bool *  ok = nullptr 
)
static

Overload of SimpleCTSystem::fromCTSystem(const CTSystem& system, bool* ok) that binds to a system passed as a rvalue. An exception will be thrown if system is not simple and ok is a nullptr.

◆ gantry()

AbstractGantry * CTL::SimpleCTSystem::gantry ( ) const

Returns a pointer to the gantry component in the system. This does not transfer ownership.

◆ operator<<() [1/2]

CTSystem & CTL::CTSystem::operator<<
private

Operator style alternative to add component to the system. This CTSystem instance takes ownership of component.

Similar to addComponent() but also returns a reference to this instance.

◆ operator<<() [2/2]

CTSystem & CTL::CTSystem::operator<<
private

Operator style alternative to add component to the system.

Similar to addComponent() but also returns a reference to this instance.

◆ photonsPerPixel() [1/2]

float CTL::SimpleCTSystem::photonsPerPixel ( uint  module) const

Returns the average number of photons that incide on a detector pixel in module module.

◆ photonsPerPixel() [2/2]

std::vector< float > CTL::SimpleCTSystem::photonsPerPixel ( ) const

Returns the average numbers of photons that incide on a detector pixel for all modules.

◆ photonsPerPixelMean()

float CTL::SimpleCTSystem::photonsPerPixelMean ( ) const

Returns the number of photons that incide on a detector pixel averaged over all detector modules.

◆ removeComponent()

void CTL::CTSystem::removeComponent
private

Removes the component component from the system.

◆ replaceDetector() [1/2]

void CTL::SimpleCTSystem::replaceDetector ( AbstractDetector newDetector)

Replaces the detector component of this instance by newDetector. The old detector object is destroyed. This instance takes ownership of newDetector.

Does nothing if a nullptr is passed.

◆ replaceDetector() [2/2]

void CTL::SimpleCTSystem::replaceDetector ( std::unique_ptr< AbstractDetector newDetector)

Replaces the detector component of this instance by newDetector. The old detector object is destroyed. This instance takes ownership of newDetector.

Does nothing if a nullptr is passed.

◆ replaceGantry() [1/2]

void CTL::SimpleCTSystem::replaceGantry ( AbstractGantry newGantry)

Replaces the gantry component of this instance by newGantry. The old gantry object is destroyed. This instance takes ownership of newGantry.

Does nothing if a nullptr is passed.

◆ replaceGantry() [2/2]

void CTL::SimpleCTSystem::replaceGantry ( std::unique_ptr< AbstractGantry newGantry)

Replaces the gantry component of this instance by newGantry. The old gantry object is destroyed. This instance takes ownership of newGantry.

Does nothing if a nullptr is passed.

◆ replaceSource() [1/2]

void CTL::SimpleCTSystem::replaceSource ( AbstractSource newSource)

Replaces the source component of this instance by newSource. The old source object is destroyed. This instance takes ownership of newSource.

Does nothing if a nullptr is passed.

◆ replaceSource() [2/2]

void CTL::SimpleCTSystem::replaceSource ( std::unique_ptr< AbstractSource newSource)

Replaces the source component of this instance by newSource. The old source object is destroyed. This instance takes ownership of newSource.

Does nothing if a nullptr is passed.

◆ source()

AbstractSource * CTL::SimpleCTSystem::source ( ) const

Returns a pointer to the source component in the system. This does not transfer ownership.


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