Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkSegWithPreviewToolGUIBase Class Reference

GUI base class for tools derived from mitk::SegWithPreviewTool. More...

#include <QmitkSegWithPreviewToolGUIBase.h>

Inheritance diagram for QmitkSegWithPreviewToolGUIBase:
Collaboration diagram for QmitkSegWithPreviewToolGUIBase:

Public Member Functions

 mitkClassMacro (QmitkSegWithPreviewToolGUIBase, QmitkToolGUI)
 
Pointer Clone () const
 
virtual bool GetMode2D () const
 
- Public Member Functions inherited from QmitkToolGUI
 mitkClassMacroItkParent (QmitkToolGUI, itk::Object)
 
void SetTool (mitk::Tool *tool)
 Associates the given tool with this GUI, emitting NewToolAssociated. More...
 
void SetMultiLabelInspector (QmitkMultiLabelInspector *inspector)
 Provides the segmentation view's label inspector to this GUI. More...
 
QmitkMultiLabelInspector * GetMultiLabelInspector () const
 Returns the inspector associated with this GUI, or null if none. More...
 
void Register () const override
 Intentional no-op; prevents ITK reference counting from interfering with Qt ownership. More...
 
void UnRegister () const ITK_NOEXCEPT ITK_OVERRIDE
 Intentional no-op; prevents ITK reference counting from interfering with Qt ownership. More...
 
void SetReferenceCount (int) override
 Intentional no-op; prevents ITK reference counting from interfering with Qt ownership. More...
 
 ~QmitkToolGUI () override
 

Protected Types

using EnableConfirmSegBtnFunctionType = std::function< bool(bool)>
 

Protected Slots

void OnNewToolAssociated (mitk::Tool *)
 
void OnAcceptPreview ()
 
void OnPreviewOpacityChanged (int value)
 
void OnPreviewVisibilityToggled (bool checked)
 

Protected Member Functions

 QmitkSegWithPreviewToolGUIBase (bool mode2D, bool enableProcessingOfAllTimeSteps=true)
 
 ~QmitkSegWithPreviewToolGUIBase () override
 
virtual void DisconnectOldTool (mitk::SegWithPreviewTool *oldTool)
 
virtual void ConnectNewTool (mitk::SegWithPreviewTool *newTool)
 
virtual void InitializeUI (QBoxLayout *mainLayout)
 
void BusyStateChanged (bool isBusy) override
 Called when the tool's busy state changes. Override to enable/disable UI elements. More...
 
virtual void EnableWidgets (bool enabled)
 
template<class TTool >
TTool * GetConnectedToolAs ()
 
void SetMergeStyle (mitk::MultiLabelSegmentation::MergeStyle mergeStyle)
 
void SetOverwriteStyle (mitk::MultiLabelSegmentation::OverwriteStyle overwriteStyle)
 
QPushButton * GetConfirmSegmentationButton () const
 
QCheckBox * GetPreviewVisibilityCheckBox () const
 
QLabel * GetPreviewLabel () const
 
- Protected Member Functions inherited from QmitkToolGUI
 QmitkToolGUI ()=default
 

Protected Attributes

EnableConfirmSegBtnFunctionType m_EnableConfirmSegBtnFnc
 
- Protected Attributes inherited from QmitkToolGUI
mitk::Tool::Pointer m_Tool
 
QmitkMultiLabelInspector * m_MultiLabelInspector
 

Additional Inherited Members

- Signals inherited from QmitkToolGUI
void NewToolAssociated (mitk::Tool *)
 Emitted when a new tool is associated with this GUI via SetTool(). More...
 

Detailed Description

GUI base class for tools derived from mitk::SegWithPreviewTool.

Provides the common UI elements shared by all preview-based segmentation tools, including the "Confirm Segmentation" button, merge/overwrite checkboxes, and busy-state handling.

See also
mitk::SegWithPreviewTool
QmitkMultiLabelSegWithPreviewToolGUIBase

Definition at line 38 of file QmitkSegWithPreviewToolGUIBase.h.

Member Typedef Documentation

◆ EnableConfirmSegBtnFunctionType

using QmitkSegWithPreviewToolGUIBase::EnableConfirmSegBtnFunctionType = std::function<bool(bool)>
protected

Definition at line 81 of file QmitkSegWithPreviewToolGUIBase.h.

Constructor & Destructor Documentation

◆ QmitkSegWithPreviewToolGUIBase()

QmitkSegWithPreviewToolGUIBase::QmitkSegWithPreviewToolGUIBase ( bool  mode2D,
bool  enableProcessingOfAllTimeSteps = true 
)
protected
Parameters
mode2DIndicates if the tool is in 2D or 3D mode.
enableProcessingOfAllTimeStepsIf enabled, a checkbox is shown to confirm a preview for all time steps of a dynamic segmentation at once (default).

◆ ~QmitkSegWithPreviewToolGUIBase()

QmitkSegWithPreviewToolGUIBase::~QmitkSegWithPreviewToolGUIBase ( )
overrideprotected

Member Function Documentation

◆ BusyStateChanged()

void QmitkSegWithPreviewToolGUIBase::BusyStateChanged ( bool  )
overrideprotectedvirtual

Called when the tool's busy state changes. Override to enable/disable UI elements.

Reimplemented from QmitkToolGUI.

◆ Clone()

Pointer QmitkSegWithPreviewToolGUIBase::Clone ( ) const

◆ ConnectNewTool()

virtual void QmitkSegWithPreviewToolGUIBase::ConnectNewTool ( mitk::SegWithPreviewTool *  newTool)
protectedvirtual

◆ DisconnectOldTool()

virtual void QmitkSegWithPreviewToolGUIBase::DisconnectOldTool ( mitk::SegWithPreviewTool *  oldTool)
protectedvirtual

◆ EnableWidgets()

virtual void QmitkSegWithPreviewToolGUIBase::EnableWidgets ( bool  enabled)
protectedvirtual

This method is used to control/set the enabled state of the tool UI widgets. It is e.g. used if the busy state is changed (see BusyStateChanged). Override the default implementation, e.g. if a tool adds his own UI elements (normally by overriding InitializeUI()) and wants to control how the widgets are enabled/disabled.

Reimplemented in QmitkPickingToolGUI, QmitkOtsuTool3DGUI, QmitkMultiLabelSegWithPreviewToolGUIBase, QmitkMonaiLabelToolGUI, and QmitkGrowCutToolGUI.

◆ GetConfirmSegmentationButton()

QPushButton* QmitkSegWithPreviewToolGUIBase::GetConfirmSegmentationButton ( ) const
protected

◆ GetConnectedToolAs()

template<class TTool >
TTool* QmitkSegWithPreviewToolGUIBase::GetConnectedToolAs ( )
inlineprotected

Definition at line 92 of file QmitkSegWithPreviewToolGUIBase.h.

◆ GetMode2D()

virtual bool QmitkSegWithPreviewToolGUIBase::GetMode2D ( ) const
virtual

◆ GetPreviewLabel()

QLabel* QmitkSegWithPreviewToolGUIBase::GetPreviewLabel ( ) const
protected

◆ GetPreviewVisibilityCheckBox()

QCheckBox* QmitkSegWithPreviewToolGUIBase::GetPreviewVisibilityCheckBox ( ) const
protected

◆ InitializeUI()

virtual void QmitkSegWithPreviewToolGUIBase::InitializeUI ( QBoxLayout *  mainLayout)
protectedvirtual

This method is called by OnNewToolAssociated if the UI is initialized the first time to allow derived classes to introduce own UI code. Overwrite to change. The implementation should ensure that alle widgets needed for the tool UI are properly allocated. If one needs to eecute time (e.g. to connect events between the tool and the UI) each time the tool changes, override the functions ConnectNewTool() and DisconnectOldTool().

Reimplemented in QmitkPickingToolGUI, QmitkOtsuTool3DGUI, QmitkMultiLabelSegWithPreviewToolGUIBase, QmitkMonaiLabelToolGUI, QmitkGrowCutToolGUI, QmitkBinaryThresholdToolGUIBase, QmitkTotalSegmentatorToolGUI, and QmitknnInteractiveToolGUI.

◆ mitkClassMacro()

QmitkSegWithPreviewToolGUIBase::mitkClassMacro ( QmitkSegWithPreviewToolGUIBase  ,
QmitkToolGUI   
)

◆ OnAcceptPreview

void QmitkSegWithPreviewToolGUIBase::OnAcceptPreview ( )
protectedslot

◆ OnNewToolAssociated

void QmitkSegWithPreviewToolGUIBase::OnNewToolAssociated ( mitk::Tool *  )
protectedslot

◆ OnPreviewOpacityChanged

void QmitkSegWithPreviewToolGUIBase::OnPreviewOpacityChanged ( int  value)
protectedslot

◆ OnPreviewVisibilityToggled

void QmitkSegWithPreviewToolGUIBase::OnPreviewVisibilityToggled ( bool  checked)
protectedslot

◆ SetMergeStyle()

void QmitkSegWithPreviewToolGUIBase::SetMergeStyle ( mitk::MultiLabelSegmentation::MergeStyle  mergeStyle)
protected

◆ SetOverwriteStyle()

void QmitkSegWithPreviewToolGUIBase::SetOverwriteStyle ( mitk::MultiLabelSegmentation::OverwriteStyle  overwriteStyle)
protected

Member Data Documentation

◆ m_EnableConfirmSegBtnFnc

EnableConfirmSegBtnFunctionType QmitkSegWithPreviewToolGUIBase::m_EnableConfirmSegBtnFnc
protected

Definition at line 82 of file QmitkSegWithPreviewToolGUIBase.h.


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