ImFusion C++ SDK 4.5.0
ImFusion::CT::Gl2D3DRegistrationController Class Reference

#include <ImFusion/CT/GUI/Gl2D3DRegistrationController.h>

GUI controller for OpenGL-based 2D-3D registration. More...

Inheritance diagram for ImFusion::CT::Gl2D3DRegistrationController:

Detailed Description

GUI controller for OpenGL-based 2D-3D registration.

Provides user interface for GPU-accelerated 2D-3D registration algorithms.

Public Slots

void onGeometryChanged ()
 Called when the CBCT geometry has changed.
void onWeightsChanged ()
 Called when the weights of the Gl2D3DRegistration algorithm have changed to update their rendered Data.
ImageView2Dview ()
 Getter method for the first view.
const std::vector< ImageView2D * > views ()
void setMultipleDRRs (bool multipleDRRs)
 If argument is true, calls setMultipleDRRs(true) of m_reg (and, if applicable, on m_regDRR), and adds/removes views for each projection.
SharedImageSetweightImage (int which)
 Access raw pointer of a weight image which has been rendered as Data in a corresponding DRR view Its ownership remains in this controller.

Signals

void geometryChanged ()

Public Member Functions

 Gl2D3DRegistrationController (Gl2D3DRegistration *reg)
void init () override
 Two-step initialization function to be implemented by subclasses.
void selectionChanged ()
 Update DRR and blend it with original X-Ray image.
void transformationChanged (const Data *data)
 Update DRR in case volume transformation has changed.
void onAlgorithmParametersChanged () override
 Parameters of an algorithm have changed.
void updatePropertiesWidget () override
 Update the properties widget.
void onParameterChanged (const std::string &paramName) override
 Parameter was changed in the GUI.
void onCompute () override
 Override to block signals in the GeometryAlgorithmController.
void computeSilent ()
 Execute the 2D-3D registration, but do not emit geometryChanged or call selectionChanged().
void setRegDRR (Gl2D3DRegistration &regDRR)
 Set an instance of Gl2D3DRegistration to use for showing DRRs.
void setRegOptimize (Gl2D3DRegistration &regOpt)
 Set an instance of Gl2D3DRegistration to use when optimizing.
Public Member Functions inherited from ImFusion::DefaultAlgorithmController
 DefaultAlgorithmController (Algorithm *algo, const QString &uiTemplate="", bool configureOnChanged=false, bool autoDeleteAfterCompute=false)
void setAutoDeleteAfterCompute (bool enable)
 Sets if the algorithm will be deleted after onCompute() was called.
void setConfigureOnChanged (bool enable)
 Sets if the algorithm should be re-configured with each changed value.
void hideComputeButton (bool hide)
 Hides or shows the compute button.
void setAddAlgorithmToHistory (bool toggle)
 Enable/disable algorithm registration on compute.
virtual void copyAlgorithmConfiguration () const
 Copy the algorithm configuration as currently shown in the controller to the clipboard.
virtual void pasteAlgorithmConfiguration ()
 Paste the algorithm configuration from the clipboard.
void setSplitCamelCase (bool enable)
 Calls PropertiesWidget::setSplitCamelCase(enabled) on m_propertiesWidget.
void setCustomWidget (const std::string &subPropertyName, std::unique_ptr< QWidget > widget)
 Assign a custom widget to the subproperty.
OptimizationDialogoptimizationDialog () const
 Getter for the OptimizationDialog.
Public Member Functions inherited from ImFusion::AlgorithmController
 AlgorithmController (Algorithm *algorithm)
 Creates a new AlgorithmController wrapping the given algorithm, which must not be null.
const Algorithmalgorithm () const
 Returns the underlying Algorithm instance.
Algorithmalgorithm ()
void showInputData ()
 Shows the input data in the DisplayWidget.
InputDataVisibility showsInputData ()
 Checks if the input data is currently visible in the DisplayWidget.
void showHelp ()
 Attempts to open the user documentation page for the underlying algorithm.
std::optional< Filesystem::PathhelpPath () const
 Returns the path to the user documentation page if it is available, std::nullopt otherwise.
std::string title () const override
 Returns the original factory name of the underlying Algorithm.
Public Member Functions inherited from ImFusion::Controller
void setMainWindowBase (MainWindowBase *mw)
 Complete the initialization by providing the parent MainWindowBase instance hosting the controller by setting m_main and m_disp and eventually call init().
virtual void onSelectedDataChanged (const DataList &)
 Called by MainWindowBase in the case that the selection in the data model has changed.
virtual void onVisibleDataChanged (const DataList &)
 Called by MainWindowBase in the case that the currently visible data has changed.
virtual std::vector< LocationsupportedLocations () const
 Returns the list of locations in which this controller is allowed to be placed by the parent MainWindowBase.
virtual Location preferredLocation () const
 Returns the preferred location in which the parent MainWindowBase should place this controller.
virtual void onLocationChanged (Location newLocation)
 Callback function called by the parent MainWindowBase/ControllerDecorator whenever the place was changed.
Location location () const
 Convenience function to query the current controller Location from the parent ControllerDecorator.
ControllerDecoratorgetDecorator () const
 Convenience function to return m_main->getControllerDecorator(this) if m_main is set or nullptr otherwise.
template<typename T>
T * getDecorator () const
 Convenience function to dynamic_cast the return value of getDecorator() to a derived type.
Public Member Functions inherited from ImFusion::Configurable
virtual void configure (const Properties *p)
 Configure this object instance by de-serializing the given Properties.
virtual void configuration (Properties *p) const
 Serialize the current object configuration into the given Properties object.
virtual void configureDefaults ()
 Retrieve the properties of this object, replaces values with their defaults and sets it again.
void registerParameter (ParameterBase *param)
 Register the given Parameter or SubProperty, so that it will be configured during configure()/configuration().
void unregisterParameter (const ParameterBase *param)
 Remove the given Parameter or SubProperty from the list of registered parameters.
 Configurable (const Configurable &rhs)
 Configurable (Configurable &&rhs) noexcept
Configurable & operator= (const Configurable &)
Configurable & operator= (Configurable &&) noexcept
Public Member Functions inherited from ImFusion::SignalReceiver
 SignalReceiver ()=default
 Default constructor.
 SignalReceiver (const SignalReceiver &other)
 Copy constructor, does not copy any existing signal connections from other.
SignalReceiveroperator= (SignalReceiver rhs)
 Assignment operator, disconnects all existing connections, does not copy any existing signal connections from rhs.
virtual ~SignalReceiver ()
 Virtual destructor disconnects from all connected signals.

Additional Inherited Members

Public Types inherited from ImFusion::AlgorithmController
enum class  InputDataVisibility { None = 0 , All = 1 , Some = 2 }
 Enumeration of possible return values for showsInputData(). More...
Public Types inherited from ImFusion::Controller
enum class  Location : int {
  Unknown = -1 , Naked = 0 , PrimaryDock = 1 , SecondaryDock = 2 ,
  Detached = 3 , ToolBar = 4 , UserLocation = 100
}
 Enumeration of possible placement/decoration options of a Controller. More...
Public Attributes inherited from ImFusion::Controller
Signal signalTitleChanged
 Signal emitted when the title() has changed.
Public Attributes inherited from ImFusion::Configurable
Signal signalParametersChanged
 Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted.
Protected Member Functions inherited from ImFusion::DefaultAlgorithmController
void addButton (const QString &title, const std::function< void()> &callback, int position=-1)
 Adds a button at the end of the widget One can pass a position to indicate the order of the added buttons, by passing nothing, the button is added to the end Note: Buttons must be added before the init method is called.
virtual void fillActionMenu (QMenu &menu)
 Fill a QMenu with all available actions.
void onAlgorithmOutputChanged () override
 Callback called when the Algorithm's signalOutputChanged signal was emitted.
QVBoxLayout * layout () const
 Return the main layout of the controller.
virtual OwningDataList postprocessOutput (OwningDataList output)
 This function will be called directly on the output generated by the algorithm.
void duplicateAlgorithmOnSelectedData () const override
 Instantiates a new copy of underlying Algorithm on the currently selected Data in the DataModel and adds it to the ApplicationController.
Protected Member Functions inherited from ImFusion::AlgorithmController
virtual void closeAlgorithm (bool executed=false)
 Removes the algorithm from the ApplicationController and closes the controller.
void addToDataAndAnnotationModels (OwningDataList data)
 Adds the contents of data to the DataModel of the parent MainWindowBase.
Protected Member Functions inherited from ImFusion::SignalReceiver
void disconnectAll ()
 Disconnects all existing connections.
Protected Attributes inherited from ImFusion::DefaultAlgorithmController
bool m_autoDeleteAfterCompute
bool m_configureOnChanged
bool m_isInitialized = false
bool m_addAlgorithmToHistory = true
 enable/disable register algorithm on compute()
bool m_optUpdatesDisplay = false
 enable/disable display updates from the optimizer
PropertiesWidgetm_propertiesWidget = nullptr
OptimizationDialogm_optDialog = nullptr
QVBoxLayout * m_layout = nullptr
QPushButton * m_optDialogButton = nullptr
QPushButton * m_computeButton = nullptr
QList< QPushButton * > m_buttons
Protected Attributes inherited from ImFusion::AlgorithmController
Algorithmm_algorithm = nullptr
 The underlying algorithm.
Protected Attributes inherited from ImFusion::Controller
MainWindowBasem_main = nullptr
 The parent MainWindowBase instance hosting this Controller.
DisplayWidgetMultim_disp = nullptr
 The main DisplayWidget instance, convenience shortcut for m_main->display().
Protected Attributes inherited from ImFusion::Configurable
std::vector< Paramm_params
 List of all registered Parameter and SubProperty instances.

Member Function Documentation

◆ init()

void ImFusion::CT::Gl2D3DRegistrationController::init ( )
overridevirtual

Two-step initialization function to be implemented by subclasses.

This function is called by setMainWindowBase() after the m_disp and m_main attributes have been set and hence a complete initialization of the controller is possible at this point.

Reimplemented from ImFusion::DefaultAlgorithmController.

◆ selectionChanged()

void ImFusion::CT::Gl2D3DRegistrationController::selectionChanged ( )

Update DRR and blend it with original X-Ray image.

This may update the display options of the DRR from m_regDRR (which it treats as a reference)

◆ onAlgorithmParametersChanged()

void ImFusion::CT::Gl2D3DRegistrationController::onAlgorithmParametersChanged ( )
overridevirtual

Parameters of an algorithm have changed.

Reimplemented from ImFusion::DefaultAlgorithmController.

◆ updatePropertiesWidget()

void ImFusion::CT::Gl2D3DRegistrationController::updatePropertiesWidget ( )
overridevirtual

Update the properties widget.

Reimplemented from ImFusion::DefaultAlgorithmController.

◆ onParameterChanged()

void ImFusion::CT::Gl2D3DRegistrationController::onParameterChanged ( const std::string & paramName)
overridevirtual

Parameter was changed in the GUI.

Reimplemented from ImFusion::DefaultAlgorithmController.

◆ onCompute()

void ImFusion::CT::Gl2D3DRegistrationController::onCompute ( )
overridevirtual

Override to block signals in the GeometryAlgorithmController.

Reimplemented from ImFusion::DefaultAlgorithmController.

◆ computeSilent()

void ImFusion::CT::Gl2D3DRegistrationController::computeSilent ( )

Execute the 2D-3D registration, but do not emit geometryChanged or call selectionChanged().

This function can be used for the case where

Parameters
optcomes from an OptimizationDialog not managed by this controller and more fine-grained control than onCompute() permits is required.

◆ setRegDRR()

void ImFusion::CT::Gl2D3DRegistrationController::setRegDRR ( Gl2D3DRegistration & regDRR)

Set an instance of Gl2D3DRegistration to use for showing DRRs.

This can be used e.g. for displaying DRRs in a different resolution to that managed by the "original" registration algorithm. The idea here is that there is a "main" Gl2D3DRegistration algorithm given at construction, but also auxillary algorithms that can be patched into the display. Warning: this does not connect to any signals of the registration, Changes in the controller in the Algorithm dock still propagate only to the original Gl2D3DRegistration instance passed at construction. The user is responsible for keeping the state of regDRR consistent with that of the original registration algorithm.

Parameters
regDRRmust have the same number of images in its data() member as the original registration algorithm.

◆ setRegOptimize()

void ImFusion::CT::Gl2D3DRegistrationController::setRegOptimize ( Gl2D3DRegistration & regOpt)

Set an instance of Gl2D3DRegistration to use when optimizing.

Update underlying optimizer of the Optimization dialog

◆ setMultipleDRRs

void ImFusion::CT::Gl2D3DRegistrationController::setMultipleDRRs ( bool multipleDRRs)
slot

If argument is true, calls setMultipleDRRs(true) of m_reg (and, if applicable, on m_regDRR), and adds/removes views for each projection.

If argument is false, leaves the settings of m_reg unchanged (except if either m_reg or m_regDRR already have multiple DRRs enabled, in which case they are enabled for both) but removes all views except the first one.

Warning
calling this once will permanently change the number of DRRs m_reg and m_regDRR will produce. Has no effect if multipleDRRs does not change the setting for either algorithm and the number of views is already correct. Must not be called before init()

The documentation for this class was generated from the following file:
  • ImFusion/CT/GUI/Gl2D3DRegistrationController.h
Search Tab / S to search, Esc to close