Medical Imaging Interaction Toolkit  2025.08.99-f7084adb
Medical Imaging Interaction Toolkit
QmitkMultiLabelSelectionWidget Class Reference

#include <QmitkMultiLabelSelectionWidget.h>

Inheritance diagram for QmitkMultiLabelSelectionWidget:
Collaboration diagram for QmitkMultiLabelSelectionWidget:

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 SetMultiSelectionMode (bool multiMode)
 
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...
 
void SegmentationChanged () const
 Signal is emitted, if the segmentation is changed that is observed by the inspector. More...
 

Public Member Functions

 QmitkMultiLabelSelectionWidget (QWidget *parent=nullptr)
 
 ~QmitkMultiLabelSelectionWidget ()
 
bool GetMultiSelectionMode () const
 
bool GetHighlightingActivated () const
 
mitk::MultiLabelSegmentationGetMultiLabelSegmentation () const
 
mitk::DataNodeGetMultiLabelNode () const
 
QString GetEmptyInfo () const
 
mitk::Image::Pointer CreateSelectedLabelMask () const
 
LabelValueVectorType GetSelectedLabels () const
 Retrieve the currently selected labels (equals the last CurrentSelectionChanged values). More...
 

Protected Member Functions

void resizeEvent (QResizeEvent *event) override
 

Detailed Description

Definition at line 35 of file QmitkMultiLabelSelectionWidget.h.

Member Typedef Documentation

◆ LabelValueType

◆ LabelValueVectorType

Constructor & Destructor Documentation

◆ QmitkMultiLabelSelectionWidget()

QmitkMultiLabelSelectionWidget::QmitkMultiLabelSelectionWidget ( QWidget *  parent = nullptr)

◆ ~QmitkMultiLabelSelectionWidget()

QmitkMultiLabelSelectionWidget::~QmitkMultiLabelSelectionWidget ( )

Member Function Documentation

◆ CreateSelectedLabelMask()

mitk::Image::Pointer QmitkMultiLabelSelectionWidget::CreateSelectedLabelMask ( ) const

Convenience function that creates a binary mask that represents the selected label in the segmentation. If no segmentation is defined or no label is selected, a null ptr is returned.

Precondition
Currently the function is only implemented for MultiSelectionMode==false;

◆ CurrentSelectionChanged

void QmitkMultiLabelSelectionWidget::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.

◆ GetEmptyInfo()

QString QmitkMultiLabelSelectionWidget::GetEmptyInfo ( ) const

◆ GetHighlightingActivated()

bool QmitkMultiLabelSelectionWidget::GetHighlightingActivated ( ) const

◆ GetMultiLabelNode()

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

◆ GetMultiLabelSegmentation()

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

◆ GetMultiSelectionMode()

bool QmitkMultiLabelSelectionWidget::GetMultiSelectionMode ( ) const

◆ GetSelectedLabels()

LabelValueVectorType QmitkMultiLabelSelectionWidget::GetSelectedLabels ( ) const

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

◆ resizeEvent()

void QmitkMultiLabelSelectionWidget::resizeEvent ( QResizeEvent *  event)
overrideprotected

◆ SegmentationChanged

void QmitkMultiLabelSelectionWidget::SegmentationChanged ( ) const
signal

Signal is emitted, if the segmentation is changed that is observed by the inspector.

◆ SetEmptyInfo

void QmitkMultiLabelSelectionWidget::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 QmitkMultiLabelSelectionWidget::SetHighlightingActivated ( bool  visiblityMod)
slot

◆ SetMultiLabelNode

void QmitkMultiLabelSelectionWidget::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 some features (e.g. highlighting in render windows) of the inspectors are not active.
Currently it is also needed to circumvent the fact that modification of data does not directly trigger modification of the node (see T27307).

◆ SetMultiLabelSegmentation

void QmitkMultiLabelSelectionWidget::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.

◆ SetMultiSelectionMode

void QmitkMultiLabelSelectionWidget::SetMultiSelectionMode ( bool  multiMode)
slot

◆ SetSelectedLabel

void QmitkMultiLabelSelectionWidget::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 QmitkMultiLabelSelectionWidget::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: