CTL  0.6.1
Computed Tomography Library
Public Slots | Public Member Functions | Static Public Member Functions | Private Slots | Private Attributes | List of all members
CTL::gui::AcquisitionSetupView Class Reference

The AcquisitionSetupView class provides a tool for visualization of an AcquisitionSetup. More...

#include <acquisitionsetupview.h>

Inheritance diagram for CTL::gui::AcquisitionSetupView:
Inheritance graph
[legend]
Collaboration diagram for CTL::gui::AcquisitionSetupView:
Collaboration graph
[legend]

Public Slots

void addViewVisualization (int view)
 
void animateAcquisition (int msPerView, uint leaveOut=0)
 
void setAnimationStacking (bool enabled)
 
void setSourceOnly (bool enabled)
 
void showFullAcquisition (uint leaveOut=0)
 
void showSourceTrajectory ()
 
void showView (int view)
 
- Public Slots inherited from CTL::gui::CTSystemView
void clearScene ()
 
void resetCamera ()
 
void resetView ()
 

Public Member Functions

 AcquisitionSetupView (QWidget *parent=nullptr, float visualScale=50.0f)
 
void setAcquisitionSetup (AcquisitionSetup acqSetup)
 
void setData (AcquisitionSetup acqSetup)
 
- Public Member Functions inherited from CTL::gui::CTSystemView
 CTSystemView (QWidget *parent=nullptr, float visualScale=50.0f)
 
void setCTSystem (const SimpleCTSystem &system)
 
void setData (const SimpleCTSystem &system)
 
void addSystemVisualization (const SimpleCTSystem &system)
 
void addVolume (const VoxelVolume< uchar > &volume)
 

Static Public Member Functions

static void plot (AcquisitionSetup setup, uint maxNbViews=100, bool sourceOnly=false, float visualScale=50.0f)
 
- Static Public Member Functions inherited from CTL::gui::CTSystemView
static void plot (const SimpleCTSystem &system, float visualScale=50.0f)
 

Private Slots

void updateAnimation ()
 

Private Attributes

AcquisitionSetup _setup
 
QTimer * _animTimer
 
uint _animCurrentView
 
uint _animLeaveOut
 
bool _stackAnimation = false
 
bool _sourceOnly = false
 

Additional Inherited Members

- Protected Member Functions inherited from CTL::gui::CTSystemView
void addBoxObject (const QVector3D &dimensions, const QVector3D &translation, const QQuaternion &rotation, Qt3DRender::QMaterial *material=nullptr)
 
void addBallObject (float radius, const QVector3D &translation, Qt3DRender::QMaterial *material=nullptr)
 
void addDetectorComponent (AbstractGantry *gantry, AbstractDetector *detector)
 
void addSourceComponent (AbstractGantry *gantry, AbstractSource *source)
 
- Protected Attributes inherited from CTL::gui::CTSystemView
QGridLayout * _mainLayout
 
details::CTL3DWindow_view
 
Qt3DCore::QEntity * _rootEntity
 

Detailed Description

The AcquisitionSetupView class provides a tool for visualization of an AcquisitionSetup.

This class enhances the capabilities of CTSystemView, such that it can be used to visualize an AcquisitionSetup. For convenience, the plot() method can be used to achieve a one-line solution, creating a widget that will be destroyed once it is closed by the user.

The following IO operations are supported by this widget:

The setup to be visualized is set via setAcquisitionSetup(). Visualization can be done in two conceptually different ways: static or animated. As a static visualization, the system configuration (ie. source and detector component) can be shown simultaneously for all views in the setup (or with leaving out some views in between) using showFullAcquisition(). It is also possible to visualize only the source component with showSourceTrajectory(). The setup can also be visualized by an animation. Calling animateAcquisition() with a certain time interval will show the system configuration for a single view and proceed to the next view after the specified time interval has passed. You can enable animation stacking using setAnimationStacking() to keep all previous system configurations in the scene during animation. When setSourceOnly() is enabled, only the source component will be shown during animation of the setup.

Example:

auto system = CTSystemBuilder::createFromBlueprint(blueprints::GenericCarmCT());
// create an AcquisitionSetup with 100 views using the system we created
AcquisitionSetup setup(system, 100);
// we apply a circle-plus-line-trajectory with certain settings...
setup.applyPreparationProtocol(protocols::CirclePlusLineTrajectory(600.0, 500.0, 180.0_deg, 200.0_deg, 0.5));
// ... and visualize the setup, showing a maximum of 30 views (for a better overview)
gui::AcquisitionSetupView::plot(setup, 30); // see figure below
// using the property-based approach, we can also create an animation of this setup
auto viewer = new gui::AcquisitionSetupView;
viewer->setAcquisitionSetup(setup);
viewer->show();
viewer->animateAcquisition(100); // show one view each 100 milliseconds (-> 10 FPS)
Visualization (static version) of the setup from the example.

Constructor & Destructor Documentation

◆ AcquisitionSetupView()

CTL::gui::AcquisitionSetupView::AcquisitionSetupView ( QWidget *  parent = nullptr,
float  visualScale = 50.0f 
)
explicit

Creates an AcquisitionSetupView and sets its parent to parent.

If specified, sets the scaling for the visual appearance of components within the scene to visualScale.

Member Function Documentation

◆ addViewVisualization

void CTL::gui::AcquisitionSetupView::addViewVisualization ( int  view)
slot

Adds the visualization of the setup in its configuration for the view index view to the scene. If "Source only" (see setSourceOnly()) mode has been enabled, only the source component will be drawn.

Example: create a visualization of two views from a short scan trajectory with a C-arm system

auto system = CTSystemBuilder::createFromBlueprint(blueprints::GenericCarmCT());
AcquisitionSetup setup(system, 100);
setup.applyPreparationProtocol(protocols::ShortScanTrajectory(600.0));
auto viewer = new gui::AcquisitionSetupView;
viewer->setAcquisitionSetup(setup); // by default, shows view 0
viewer->addViewVisualization(30); // add view 30 to the scene
viewer->show();
Resulting visualization from the example above (window size and zoom adjusted).

◆ animateAcquisition

void CTL::gui::AcquisitionSetupView::animateAcquisition ( int  msPerView,
uint  leaveOut = 0 
)
slot

Shows an animation of the current acquisition setup of this instance. This will draw a visualization of one view from the setup every msPerView milliseconds. If required, views can be skipped by passing to leaveOut the desired number of views to be skipped in between two visualized configurations.

The total animation time will be \( t = \left \lfloor{(N / (1 + leaveOut))}\right \rfloor\cdot msPerView \), where \(N\) denotes the total number of views in the setup.

All settings made for this instance apply to this command. In particular, that means if "Source only" mode has been enabled, only the source component will appear in the animation; and in case "Animation stacking" has been enabled, all system configurations are superimposed in the scene.

Note that you still need to show() the widget.

Example: create an animation of a wobble scan trajectory with a C-arm system

auto system = CTSystemBuilder::createFromBlueprint(blueprints::GenericCarmCT());
AcquisitionSetup setup(system, 100);
setup.applyPreparationProtocol(protocols::WobbleTrajectory(600.0, 180.0_deg, 200.0_deg, 30.0_deg, 2.0f));
auto viewer = new gui::AcquisitionSetupView;
viewer->setAcquisitionSetup(setup);
viewer->show();
viewer->animateAcquisition(50);

◆ plot()

void CTL::gui::AcquisitionSetupView::plot ( AcquisitionSetup  setup,
uint  maxNbViews = 100,
bool  sourceOnly = false,
float  visualScale = 50.0f 
)
static

Creates an AcquisitionSetupView for visualization of setup and shows the window.

The visualization will show a superposition of all views in setup. The total number of views shown in the scene can be limited by maxNbViews. If desired, only the source positions can be drawn by passing true to sourceOnly. The scaling for the visual appearance of components within the scene can be changed with visualScale (see CTSystemView::plot() for an example).

The widget will be deleted automatically if the window is closed.

Example: create visualizations of a (100 view) short scan trajectory with a C-arm system

auto system = CTSystemBuilder::createFromBlueprint(blueprints::GenericCarmCT());
AcquisitionSetup setup(system, 100);
setup.applyPreparationProtocol(protocols::ShortScanTrajectory(600.0));
gui::AcquisitionSetupView::plot(setup); // show all views of the setup (here: 100)
gui::AcquisitionSetupView::plot(setup, 10); // limit number of displayed views to 10
Resulting visualization from the example above (window size and zoom adjusted).

◆ setAcquisitionSetup()

void CTL::gui::AcquisitionSetupView::setAcquisitionSetup ( AcquisitionSetup  acqSetup)

Sets the AcquisitionSetup visualized by this instance to acqSetup; the passed setup is copied. This replaces any previously set system.

By default, this shows the visualization of the setup's configuration prepared for the first view in acqSetup. To change the visualization of the system, use one of the following methods: showView(), addViewVisualization(), showFullAcquisition(), showSourceTrajectory(), or animateAcquisition().

◆ setAnimationStacking

void CTL::gui::AcquisitionSetupView::setAnimationStacking ( bool  enabled)
slot

Sets the "Animation stacking" mode to enabled. When enabled before calling animateAcquisition(), this mode causes all system configurations to be superimposed in the animation's scene.

◆ setData()

void CTL::gui::AcquisitionSetupView::setData ( AcquisitionSetup  acqSetup)

Convenience overload. Same as setAcquisitionSetup(acqSetup).

◆ setSourceOnly

void CTL::gui::AcquisitionSetupView::setSourceOnly ( bool  enabled)
slot

Sets the "Source only" mode to enabled. In "Source only" mode, all visualization commands will only show the source component of the system. This might be useful to prevent cluttered scenes.

Example: helical trajectory with and without "Source only" mode

auto system = CTSystemBuilder::createFromBlueprint(blueprints::GenericTubularCT());
AcquisitionSetup setup(system, 200);
setup.applyPreparationProtocol(protocols::HelicalTrajectory(7.0_deg, -2.0, 200.0));
auto viewer = new gui::AcquisitionSetupView;
viewer->setAcquisitionSetup(setup);
viewer->show();
// viewer->setSourceOnly(true); // uncomment to enable "Source only" mode
viewer->showFullAcquisition(); // shows source and detector
// the same can be achieved with the plot() command (static-approach)
gui::AcquisitionSetupView::plot(setup, 200); // all visible
gui::AcquisitionSetupView::plot(setup, 200, true); // only sources shown
Visualization of a helical trajectory with and without

Source only" mode ((a)-(d) window size and zoom adjusted; (c) and (d) camera moved)." Source only" mode ((a)-(d) window size and zoom adjusted; (c) and (d) camera moved)." Source only" mode ((a)-(d) window size and zoom adjusted; (c) and (d) camera moved)." Source only" mode ((a)-(d) window size and zoom adjusted; (c) and (d) camera moved)."

◆ showFullAcquisition

void CTL::gui::AcquisitionSetupView::showFullAcquisition ( uint  leaveOut = 0)
slot

Visualizes the current acquisition setup of this instance as a superposition of all views from the setup. If required, views can be left out by passing to leaveOut the desired number of views to be skipped in between two visualized configurations.

The total number of configurations shown in the scene will be \( \left \lfloor{(N / (1 + leaveOut))}\right \rfloor \), where \(N\) denotes the total number of views in the setup.

"Source only" mode applies to this command. See setSourceOnly() for details.

Note that you still need to show() the widget.

Example: visualize a wobble scan trajectory of a C-arm system

auto system = CTSystemBuilder::createFromBlueprint(blueprints::GenericCarmCT());
AcquisitionSetup setup(system, 100);
setup.applyPreparationProtocol(protocols::WobbleTrajectory(600.0, 180.0_deg, 200.0_deg, 30.0_deg, 2.0f));
auto viewer = new gui::AcquisitionSetupView;
viewer->setAcquisitionSetup(setup);
viewer->showFullAcquisition(); // shows all views
//viewer->showFullAcquisition(3); // leaves out 3 views between two shown configurations
viewer->show();
Visualization with different number of views left out).

◆ showSourceTrajectory

void CTL::gui::AcquisitionSetupView::showSourceTrajectory ( )
slot

Visualizes the current acquisition setup of this instance in "Source only" mode.

Example: See setSourceOnly().

◆ showView

void CTL::gui::AcquisitionSetupView::showView ( int  view)
slot

Visualizes the system configuration prepared for view index view. This replaces all previous visualizations in the scene.

"Source only" mode applies to this command. See setSourceOnly() for details.

◆ updateAnimation

void CTL::gui::AcquisitionSetupView::updateAnimation ( )
privateslot

Connected to the animation timer. Everytime the timer times out, this prepares the next view (increment depending on _animLeaveOut) and initiates the appropriate visualization; this considers all settings such as "Source only" mode and "Animation stacking".


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