CTL
0.6.1
Computed Tomography Library
|
Holds a CTSystem together with the information about the system settings for all views from which projection images shall be simulated. More...
#include <acquisitionsetup.h>
Classes | |
class | View |
Holds the information about the system settings for a particular view. More... | |
Public Types | |
typedef std::shared_ptr< const AbstractPrepareStep > | PrepareStep |
Alias for shared_ptr to const AbstractPrepareStep. | |
![]() | |
enum | { Type = -1, UserType = 65536 } |
Public Member Functions | |
AcquisitionSetup (const CTSystem &system, uint nbViews=0) | |
AcquisitionSetup (CTSystem &&system, uint nbViews=0) | |
AcquisitionSetup (std::unique_ptr< CTSystem > system, uint nbViews=0) | |
AcquisitionSetup (std::unique_ptr< SimpleCTSystem > system, uint nbViews=0) | |
AcquisitionSetup (uint nbViews) | |
AcquisitionSetup (const AcquisitionSetup &other) | |
AcquisitionSetup & | operator= (const AcquisitionSetup &other) |
AcquisitionSetup (AcquisitionSetup &&other)=default | |
AcquisitionSetup & | operator= (AcquisitionSetup &&other)=default |
void | addView (View view) |
void | applyPreparationProtocol (const AbstractPreparationProtocol &preparation) |
bool | isValid () const |
uint | nbViews () const |
void | prepareView (uint viewNb) |
void | removeAllPrepareSteps (bool keepTimeStamps=true) |
void | removeAllPrepareStepsOfType (int prepareStepType) |
Removes all prepare steps of type prepareStepType from all views of this setup. | |
void | removeAllViews () |
bool | resetSystem (const CTSystem &system) |
bool | resetSystem (CTSystem &&system) |
void | setNbViews (uint nbViews) |
AcquisitionSetup | subset (const std::vector< uint > &viewIds) const |
SimpleCTSystem * | system () |
const SimpleCTSystem * | system () const |
View & | view (uint viewNb) |
const View & | view (uint viewNb) const |
std::vector< View > & | views () |
const std::vector< View > & | views () const |
void | fromVariant (const QVariant &variant) override |
QVariant | toVariant () const override |
![]() | |
virtual int | type () const |
virtual | ~SerializationInterface ()=default |
Private Attributes | |
std::unique_ptr< SimpleCTSystem > | _system |
CTSystem used for the acquisition. | |
std::vector< View > | _views |
List of all views of the acquisition. | |
Additional Inherited Members | |
![]() | |
SerializationInterface ()=default | |
SerializationInterface (const SerializationInterface &)=default | |
SerializationInterface (SerializationInterface &&)=default | |
SerializationInterface & | operator= (const SerializationInterface &)=default |
SerializationInterface & | operator= (SerializationInterface &&)=default |
Holds a CTSystem together with the information about the system settings for all views from which projection images shall be simulated.
The AcquisitionSetup class manages the CTSystem used during an acquisition, i.e. the simulation of multiple views with differing conditions (e.g. varying geometry). The system to be used in the acquisition is either set in the constructor or via resetSystem(). To specify the conditions for all views in the acquisition, three approaches can be used: making use of preparation protocols, specifying each view individually, or using a combination of both. These approaches are explained in full detail at the end of this description (see How to configure the views:).
To bring the system managed by the setup into the state for a certain view, use prepareView(). This will apply all preparation steps associated with that particular view.
When using the 'ctl_qtgui.pri' module (or the submodule 'gui_widgets_3d.pri') within the project, you can use the gui::AcquisitionSetupView class to visualize the setup.
Before using an AcquisitionSetup, the method isValid() can be used to check whether the current configuration is ready to use. Unless isValid() is true
, using the setup in a simulation, calling prepareView() on it, or trying to visualize the setup, might cause an exception.
How to configure the views:
We can also add prepare steps for other parts of the system, for example the X-ray tube. In this example, we switch the tube voltage twice during the acquisition:
Note that in this example, it is not necessary to set the tube voltage for each view between 30 and 50, because it will not be altered by other prepare steps. Hence, it is sufficient for our purpose to just switch the voltage once (and then switch it back again). This can be different if other prepare steps are in use that also change the tube settings (esp. when using multiple preparation protocols, this is a likely option).
Creates an AcquisitionSetup with nbViews views that uses the CTSystem system.
If nbViews = 0, make sure to explicitely set the desired number of views with setNbViews() and adjust the views for the required purpose (either individually or by use of a preparation protocol, see applyPreparationProtocol()) before using the setup. Alternatively all views can be added individually with addView().
Creates an AcquisitionSetup with nbViews views that uses the CTSystem system.
Creates an AcquisitionSetup with nbViews views that uses the CTSystem system.
CTL::AcquisitionSetup::AcquisitionSetup | ( | std::unique_ptr< SimpleCTSystem > | system, |
uint | nbViews = 0 |
||
) |
Creates an AcquisitionSetup with nbViews views that uses the CTSystem system.
CTL::AcquisitionSetup::AcquisitionSetup | ( | uint | nbViews | ) |
Creates an AcquisitionSetup with nbViews views without a CTSystem.
Note that a CTSystem must be set explicitely with resetSystem() before the setup can be used.
CTL::AcquisitionSetup::AcquisitionSetup | ( | const AcquisitionSetup & | other | ) |
Creates a copy of other. This uses CTSystem::clone() to create a deep copy of the CTSystem member variable.
|
default |
Default move constructor.
void CTL::AcquisitionSetup::addView | ( | AcquisitionSetup::View | view | ) |
Adds the View view to this setup.
void CTL::AcquisitionSetup::applyPreparationProtocol | ( | const AbstractPreparationProtocol & | preparation | ) |
Applies the prepration protocol preparation to this setup. This means that the prepare steps created by AbstractPreparationProtocol::prepareSteps() are appended to all views in this setup. The consequences of this aspect are, in particular, that application of multiple preparation protocols is cumulative. When this is not desired, consider removing all prepare steps with removeAllPrepareSteps() before applying a new preparation protocol.
Note that changing the number of views afterwards does not take into account this application of preparation. Consequently, all views that are added later on will not contain the preparation steps from preparation.
|
overridevirtual |
Reads all member variables from the QVariant variant.
Reimplemented from CTL::SerializationInterface.
bool CTL::AcquisitionSetup::isValid | ( | ) | const |
Returns true if this setup is valid. To be valid, the following conditions must be fulfilled:
uint CTL::AcquisitionSetup::nbViews | ( | ) | const |
Returns the number of views in this setup.
AcquisitionSetup & CTL::AcquisitionSetup::operator= | ( | const AcquisitionSetup & | other | ) |
Assigns the content of other to this instance. This uses CTSystem::clone() to create a deep copy of the CTSystem member variable.
|
default |
Default move assignment operator.
void CTL::AcquisitionSetup::prepareView | ( | uint | viewNb | ) |
Prepares the system of this setup for the view viewNb.
This applies all prepare step queued in the corresponding View. Steps are applied in the order they have been added to the View object.
Use this method if you want to inspect the system configuration for a certain view in the setup.
Example: reading the tube voltage of an XrayTube component for all views
void CTL::AcquisitionSetup::removeAllPrepareSteps | ( | bool | keepTimeStamps = true | ) |
Removes all prepare steps from all views of this setup. This leaves the setup with the same number of views as it had beforehand. If keepTimeStamps is true
, the time stamps from the previous views are preserved. Otherwise, views are created with default time stamps.
This method can be used, for instance, to re-use the same setup with a different trajectory protocol applied. In the following example, we use the same setup with a GenericCarmCT once for an acquisition with a short-scan trajectory and then again for a wobble trajectory:
void CTL::AcquisitionSetup::removeAllViews | ( | ) |
Removes all views from the setup. Same as setNbViews(0).
bool CTL::AcquisitionSetup::resetSystem | ( | const CTSystem & | system | ) |
Sets the system of this setup to system. This creates a deep copy of system using CTSystem::clone(). The previous system is deleted.
system must be convertible to a SimpleCTSystem. Otherwise the system will be set to nullptr.
bool CTL::AcquisitionSetup::resetSystem | ( | CTSystem && | system | ) |
Sets the system of this setup to system. This moves system to this instance. The previous system is deleted.
system must be convertible to a SimpleCTSystem. Otherwise the system will be set to nullptr.
void CTL::AcquisitionSetup::setNbViews | ( | uint | nbViews | ) |
Sets the number of views in this setup to nbViews. Depending on the current number of views, this has either of the following effects:
SimpleCTSystem * CTL::AcquisitionSetup::system | ( | ) |
Returns a pointer to the system in this setup.
const SimpleCTSystem * CTL::AcquisitionSetup::system | ( | ) | const |
Returns a pointer to the (constant) system in this setup.
|
overridevirtual |
Stores all member variables in a QVariant.
Reimplemented from CTL::SerializationInterface.
AcquisitionSetup::View & CTL::AcquisitionSetup::view | ( | uint | viewNb | ) |
Returns a reference to the View viewNb of this setup.
This does not perform boundary checks.
const AcquisitionSetup::View & CTL::AcquisitionSetup::view | ( | uint | viewNb | ) | const |
Returns a constant reference to the View viewNb of this setup.
This does not perform boundary checks.
std::vector< AcquisitionSetup::View > & CTL::AcquisitionSetup::views | ( | ) |
Returns a reference to the vector of views of this setup.
const std::vector< AcquisitionSetup::View > & CTL::AcquisitionSetup::views | ( | ) | const |
Returns a constant reference to the vector of views of this setup.