![]() |
ImFusion C++ SDK 4.4.0
|
#include <ImFusion/GUI/AlgorithmController.h>
Specialization of the Controller interface to be used with Algorithm instances. More...
Inherits ImFusion::Controller, and ImFusion::SignalReceiver.
Inherited by ImFusion::ASCAlgorithmController, ImFusion::AnatomyController, ImFusion::AnatomyPlugin::InspectStyleSheetsController, ImFusion::BasicImageProcessingController, ImFusion::BullseyeVisualizationController, ImFusion::CT::ConeBeamGeometryController, ImFusion::CT::ConeBeamSimulationController, ImFusion::DefaultAlgorithmController, ImFusion::DeformationEditorController, ImFusion::DescriptorsRegistrationController, ImFusion::DisplayRecorderController, ImFusion::EvaluateLinearShapeModelController, ImFusion::FilterController, ImFusion::IGTL::CreateDeviceController, ImFusion::ImFusionFileIoController, ImFusion::ImageRegistrationController, ImFusion::ImageResamplingController, ImFusion::ImageStatisticsController, ImFusion::InteractiveSegmentationController, ImFusion::IoController, ImFusion::LabelingController, ImFusion::LiftChartOverlayController, ImFusion::LiveHandEyeCalibrationController, ImFusion::LiveHandEyeEvaluationController, ImFusion::LiveStereoCalibrationController, ImFusion::MaskEditorController, ImFusion::MeshCollisionDetectionController, ImFusion::MeshDistanceController, ImFusion::MeshMeasurementsController, ImFusion::MeshPointCloudCroppingController, ImFusion::ParametricImageRegistrationController, ImFusion::PlottingAlgorithmController, ImFusion::PointCloudAnalysisController, ImFusion::PointCorrespondenceController, ImFusion::PointCorrespondencesController, ImFusion::RegistrationResultsController, ImFusion::Seg::StructuresViewAlgorithmController, ImFusion::SetModalityController, ImFusion::SpineBaseController, ImFusion::SplineSlicingController, ImFusion::StreamControllerBase, ImFusion::StreamRecorderController, ImFusion::ToolVisualizationController, ImFusion::TrackedSharedImageSetProperties, ImFusion::TrackedSharedImageSetPropertiesLegacy, ImFusion::TrackingStreamProperties, ImFusion::TrackingToolCalibrationWizard, ImFusion::US::BoneSegmentationController, ImFusion::US::ExportCalibrationController, ImFusion::US::FrameGeometryPropertiesController, ImFusion::US::FrameGrabbingConfigEditorController, ImFusion::US::FrameGrabbingController, ImFusion::US::ImportCalibrationController, ImFusion::US::LiveSweepRecordingVisualizationController, ImFusion::US::NeedleSweepCalibrationController, ImFusion::US::SweepCompoundingController, ImFusion::US::SweepGlobalInitController, ImFusion::US::SweepPointCorrController, ImFusion::US::SweepRecorderController, ImFusion::US::UltrasoundCalibrationController, ImFusion::US::UltrasoundCalibrationWizard, ImFusion::US::UltrasoundRegistrationController, and ImFusion::VideoCameraStreamPropertiesInspectorController.
Specialization of the Controller interface to be used with Algorithm instances.
An AlgorithmController is supposed to provide a GUI enabling the user to configure and control the underlying Algorithm. In contrast to the Algorithm interface the AlgorithmController has access to the parent MainWindowBase instance and can therefore also access entities that usually would not be accessible by the Algorithm (e.g. DisplayWidget, DataModel, other Algorithms, ...).
AlgorithmControllers receive different callbacks:
Furthermore, it extends the base Controller interface with extra functionality specific to Algorithms. If wrapped in a DefaultControllerContainer, it will decorate it with additional buttons for showInputData() and showHelp().
Public Types | |
| 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 Member Functions | |
| AlgorithmController (Algorithm *algorithm) | |
| Creates a new AlgorithmController wrapping the given algorithm, which must not be null. | |
| const Algorithm * | algorithm () const |
| Returns the underlying Algorithm instance. | |
| Algorithm * | algorithm () |
| 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::Path > | helpPath () 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< Location > | supportedLocations () 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. | |
| ControllerDecorator * | getDecorator () 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. | |
| SignalReceiver & | operator= (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. | |
Protected Member Functions | |
| virtual void | closeAlgorithm (bool executed=false) |
| Removes the algorithm from the ApplicationController and closes the controller. | |
| virtual void | onAlgorithmParametersChanged () |
| Callback called when the Algorithm's signalParametersChanged signal was emitted. | |
| virtual void | onAlgorithmOutputChanged () |
| Callback called when the Algorithm's signalOutputChanged signal was emitted. | |
| virtual void | duplicateAlgorithmOnSelectedData () const |
| Instantiates a new copy of underlying Algorithm on the currently selected Data in the DataModel and adds it to the ApplicationController. | |
| void | addToDataAndAnnotationModels (OwningDataList data) |
| Adds the contents of data to the DataModel of the parent MainWindowBase. | |
| Protected Member Functions inherited from ImFusion::Controller | |
| virtual void | init ()=0 |
| Two-step initialization function to be implemented by subclasses. | |
| Protected Member Functions inherited from ImFusion::SignalReceiver | |
| void | disconnectAll () |
| Disconnects all existing connections. | |
Protected Attributes | |
| Algorithm * | m_algorithm = nullptr |
| The underlying algorithm. | |
| Protected Attributes inherited from ImFusion::Controller | |
| MainWindowBase * | m_main = nullptr |
| The parent MainWindowBase instance hosting this Controller. | |
| DisplayWidgetMulti * | m_disp = nullptr |
| The main DisplayWidget instance, convenience shortcut for m_main->display(). | |
| Protected Attributes inherited from ImFusion::Configurable | |
| std::vector< Param > | m_params |
| List of all registered Parameter and SubProperty instances. | |
Additional Inherited Members | |
| 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. | |
|
strong |
Enumeration of possible return values for showsInputData().
| Enumerator | |
|---|---|
| None | None of the input data is currently visible. |
| All | All of the input data is currently visible. |
| Some | A subset of the input data is currently visible. |
|
explicit |
Creates a new AlgorithmController wrapping the given algorithm, which must not be null.
The Algorithm::signalParametersChanged and Algorithm::signalOutputChanged signals will be connected to the corresponding member functions.
| void ImFusion::AlgorithmController::showHelp | ( | ) |
Attempts to open the user documentation page for the underlying algorithm.
|
overridevirtual |
Returns the original factory name of the underlying Algorithm.
Implements ImFusion::Controller.
|
protectedvirtual |
Removes the algorithm from the ApplicationController and closes the controller.
|
inlineprotectedvirtual |
Callback called when the Algorithm's signalParametersChanged signal was emitted.
Reimplemented in ImFusion::BasicImageProcessingController, ImFusion::CT::GeometryAlgorithmController, ImFusion::CT::Gl2D3DRegistrationController, ImFusion::CT::XRay2D3DRegistrationAlgorithmController, ImFusion::DefaultAlgorithmController, ImFusion::ImageResamplingController, ImFusion::InteractiveSegmentationController, ImFusion::LabelingController, ImFusion::StreamRecorderController, ImFusion::US::BoneSegmentationController, and ImFusion::US::SweepRecorderController.
|
inlineprotectedvirtual |
Callback called when the Algorithm's signalOutputChanged signal was emitted.
Reimplemented in ImFusion::DefaultAlgorithmController, ImFusion::InteractiveSegmentationController, ImFusion::LabelingController, ImFusion::StreamRecorderController, ImFusion::ThresholdingFiducialExtractionController, ImFusion::TrackingToolCalibrationWizard, ImFusion::US::BoneSegmentationController, ImFusion::US::GeometryDetectionController, ImFusion::US::SweepRecorderController, ImFusion::US::UltrasoundCalibrationWizard, and ImFusion::VertebraDissectionLegacyController.
|
protectedvirtual |
Instantiates a new copy of underlying Algorithm on the currently selected Data in the DataModel and adds it to the ApplicationController.
Reimplemented in ImFusion::DefaultAlgorithmController.
|
protected |
Adds the contents of data to the DataModel of the parent MainWindowBase.
If a dataset is annotation data (Data::isAnnotationType()) it will take care of also adding it to the AnnotationModel.