Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkMultiLabelSelectionButton Class Reference

Button that displays information about selected labels of a given multi-label segmentation. More...

#include <QmitkMultiLabelSelectionButton.h>

Inheritance diagram for QmitkMultiLabelSelectionButton:
Collaboration diagram for QmitkMultiLabelSelectionButton:

Public Types

using LabelValueType = mitk::MultiLabelSegmentation::LabelValueType
 
using LabelValueVectorType = mitk::MultiLabelSegmentation::LabelValueVectorType
 

Public Slots

void SetSelectedLabels (const LabelValueVectorType &selectedLabels)
 Transform a list of label values into the new selection of the inspector. More...
 
void SetSelectedLabel (mitk::MultiLabelSegmentation::LabelValueType selectedLabel)
 The passed label will be used as new selection in the widget. More...
 
void SetMultiLabelSegmentation (mitk::MultiLabelSegmentation *segmentation)
 Sets the segmentation that will be used and monitored by the widget. More...
 
void SetMultiLabelNode (mitk::DataNode *node)
 Sets the segmentation node that will be used /monitored by the widget. More...
 
void SetHighlightingActivated (bool visiblityMod)
 
void SetEmptyInfo (QString info)
 

Signals

void CurrentSelectionChanged (LabelValueVectorType labels) const
 A signal that will be emitted if the selected labels change. More...
 

Public Member Functions

 QmitkMultiLabelSelectionButton (QWidget *parent=nullptr)
 Constructs the multi-label selection button. More...
 
 ~QmitkMultiLabelSelectionButton ()
 
bool GetHighlightingActivated () const
 Returns whether label highlighting in render windows is activated. More...
 
mitk::MultiLabelSegmentation * GetMultiLabelSegmentation () const
 Returns the currently set segmentation. More...
 
mitk::DataNode * GetMultiLabelNode () const
 Returns the segmentation data node. More...
 
QString GetEmptyInfo () const
 Returns the info text displayed when no label is selected. More...
 
LabelValueVectorType GetSelectedLabels () const
 Retrieve the currently selected labels (equals the last CurrentSelectionChanged values). More...
 

Protected Member Functions

void paintEvent (QPaintEvent *p) override
 
void changeEvent (QEvent *event) override
 
void enterEvent (QEnterEvent *event) override
 
void leaveEvent (QEvent *event) override
 

Detailed Description

Button that displays information about selected labels of a given multi-label segmentation.

If the given node is a nullptr the node info text will be shown. The node info can be formatted text (e.g. HTML code; like the tooltip text).

Definition at line 31 of file QmitkMultiLabelSelectionButton.h.

Member Typedef Documentation

◆ LabelValueType

◆ LabelValueVectorType

Constructor & Destructor Documentation

◆ QmitkMultiLabelSelectionButton()

QmitkMultiLabelSelectionButton::QmitkMultiLabelSelectionButton ( QWidget *  parent = nullptr)

Constructs the multi-label selection button.

◆ ~QmitkMultiLabelSelectionButton()

QmitkMultiLabelSelectionButton::~QmitkMultiLabelSelectionButton ( )

Member Function Documentation

◆ changeEvent()

void QmitkMultiLabelSelectionButton::changeEvent ( QEvent *  event)
overrideprotected

◆ CurrentSelectionChanged

void QmitkMultiLabelSelectionButton::CurrentSelectionChanged ( LabelValueVectorType  labels) const
signal

A signal that will be emitted if the selected labels change.

Parameters
labelsA list of label values that are now selected.

◆ enterEvent()

void QmitkMultiLabelSelectionButton::enterEvent ( QEnterEvent *  event)
overrideprotected

◆ GetEmptyInfo()

QString QmitkMultiLabelSelectionButton::GetEmptyInfo ( ) const

Returns the info text displayed when no label is selected.

◆ GetHighlightingActivated()

bool QmitkMultiLabelSelectionButton::GetHighlightingActivated ( ) const

Returns whether label highlighting in render windows is activated.

◆ GetMultiLabelNode()

mitk::DataNode* QmitkMultiLabelSelectionButton::GetMultiLabelNode ( ) const

Returns the segmentation data node.

◆ GetMultiLabelSegmentation()

mitk::MultiLabelSegmentation* QmitkMultiLabelSelectionButton::GetMultiLabelSegmentation ( ) const

Returns the currently set segmentation.

◆ GetSelectedLabels()

LabelValueVectorType QmitkMultiLabelSelectionButton::GetSelectedLabels ( ) const

Retrieve the currently selected labels (equals the last CurrentSelectionChanged values).

◆ leaveEvent()

void QmitkMultiLabelSelectionButton::leaveEvent ( QEvent *  event)
overrideprotected

◆ paintEvent()

void QmitkMultiLabelSelectionButton::paintEvent ( QPaintEvent *  p)
overrideprotected

◆ SetEmptyInfo

void QmitkMultiLabelSelectionButton::SetEmptyInfo ( QString  info)
slot

Set the info text that should be displayed if no label is selected. The string can contain HTML code, if desired.

◆ SetHighlightingActivated

void QmitkMultiLabelSelectionButton::SetHighlightingActivated ( bool  visiblityMod)
slot

◆ SetMultiLabelNode

void QmitkMultiLabelSelectionButton::SetMultiLabelNode ( mitk::DataNode *  node)
slot

Sets the segmentation node that will be used /monitored by the widget.

Parameters
nodeA pointer to the segmentation node.
Remarks
If not set, highlighting in render windows will not work.

◆ SetMultiLabelSegmentation

void QmitkMultiLabelSelectionButton::SetMultiLabelSegmentation ( mitk::MultiLabelSegmentation *  segmentation)
slot

Sets the segmentation that will be used and monitored by the widget.

Parameters
segmentationA pointer to the segmentation to set.
Remarks
You cannot set the segmentation directly if a segmentation node is also set. Reset the node (nullptr) if you want to change to direct segmentation setting.
Precondition
Segmentation node is nullptr.

◆ SetSelectedLabel

void QmitkMultiLabelSelectionButton::SetSelectedLabel ( mitk::MultiLabelSegmentation::LabelValueType  selectedLabel)
slot

The passed label will be used as new selection in the widget.

Parameters
selectedLabelValue of the selected label.
Remarks
Using this method to select labels will not trigger the CurrentSelectionChanged signal. Observers should regard that to avoid signal loops.

◆ SetSelectedLabels

void QmitkMultiLabelSelectionButton::SetSelectedLabels ( const LabelValueVectorType &  selectedLabels)
slot

Transform a list of label values into the new selection of the inspector.

Parameters
selectedLabelsA list of selected label values.
Remarks
Using this method to select labels will not trigger the CurrentSelectionChanged signal. Observers should regard that to avoid signal loops.

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