Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
QmitkToolWorkingDataSelectionBox Class Reference

Display the data selection of a ToolManager. More...

#include <QmitkToolWorkingDataSelectionBox.h>

Inheritance diagram for QmitkToolWorkingDataSelectionBox:
Collaboration diagram for QmitkToolWorkingDataSelectionBox:

Public Types

enum  DisplayMode { ListDataIfAllToolsMatch, ListDataIfAnyToolMatches }
 What kind of items should be displayed. More...
 

Signals

void WorkingNodeSelected (const mitk::DataNode *)
 

Public Member Functions

 QmitkToolWorkingDataSelectionBox (QWidget *parent=nullptr)
 
 ~QmitkToolWorkingDataSelectionBox () override
 
mitk::DataStorageGetDataStorage ()
 
void SetDataStorage (mitk::DataStorage &storage)
 
void UpdateDataDisplay ()
 Can be called to trigger an update of the list contents. More...
 
mitk::ToolManagerGetToolManager ()
 Returns the associated mitk::ToolManager. More...
 
void SetToolManager (mitk::ToolManager &)
 Tell this object to listen to another ToolManager. More...
 
mitk::ToolManager::DataVectorType GetAllNodes (bool onlyDerivedFromOriginal=true)
 A list of all displayed DataNode objects. This method might be convenient for program modules that want to display additional information about these nodes, like a total volume of all segmentations, etc. More...
 
mitk::ToolManager::DataVectorType GetSelectedNodes ()
 A list of all selected DataNode objects. This method might be convenient for program modules that want to display additional information about these nodes, like a total volume of all segmentations, etc. More...
 
mitk::DataNodeGetSelectedNode ()
 Like GetSelectedNodes(), but will only return one object. Will only return what QListView gives as selected object (documentation says nothing is returned if list is in Single selection mode). More...
 
void OnToolManagerWorkingDataModified ()
 Callback function, no need to call it. This is used to observe and react to changes in the mitk::ToolManager object. More...
 
void OnToolManagerReferenceDataModified ()
 Callback function, no need to call it. This is used to observe and react to changes in the mitk::ToolManager object. More...
 

Protected Types

typedef std::map< QListWidgetItem *, mitk::DataNode * > ItemNodeMapType
 

Protected Slots

void OnWorkingDataSelectionChanged ()
 

Protected Attributes

mitk::ToolManager::Pointer m_ToolManager
 
ItemNodeMapType m_Node
 
bool m_SelfCall
 
mitk::DataNodem_LastSelectedReferenceData
 
std::string m_ToolGroupsForFiltering
 
bool m_DisplayOnlyDerivedNodes
 

Detailed Description

Display the data selection of a ToolManager.

See also
mitk::ToolManager
mitk::DataStorage

Shows the working data of a ToolManager in a segmentation setting. By default only the segmentation name is shown.

The working images (segmentations) are listed in a QListView, each row telling the color and name of a single segmentation. One or several segmentations can be selected to be the "active" segmentations.

Author
maleike

Definition at line 39 of file QmitkToolWorkingDataSelectionBox.h.

Member Typedef Documentation

◆ ItemNodeMapType

typedef std::map<QListWidgetItem *, mitk::DataNode *> QmitkToolWorkingDataSelectionBox::ItemNodeMapType
protected

Definition at line 123 of file QmitkToolWorkingDataSelectionBox.h.

Member Enumeration Documentation

◆ DisplayMode

What kind of items should be displayed.

Every mitk::Tool holds a NodePredicateBase object, telling the kind of data that this tool will successfully work with. There are two ways that this list box deals with these predicates.

DEFAULT is: list data if ANY one of the displayed tools' predicate matches. Other option: list data if ALL one of the displayed tools' predicate matches

Enumerator
ListDataIfAllToolsMatch 
ListDataIfAnyToolMatches 

Definition at line 54 of file QmitkToolWorkingDataSelectionBox.h.

Constructor & Destructor Documentation

◆ QmitkToolWorkingDataSelectionBox()

QmitkToolWorkingDataSelectionBox::QmitkToolWorkingDataSelectionBox ( QWidget *  parent = nullptr)

◆ ~QmitkToolWorkingDataSelectionBox()

QmitkToolWorkingDataSelectionBox::~QmitkToolWorkingDataSelectionBox ( )
override

Definition at line 38 of file QmitkToolWorkingDataSelectionBox.cpp.

Member Function Documentation

◆ GetAllNodes()

mitk::ToolManager::DataVectorType QmitkToolWorkingDataSelectionBox::GetAllNodes ( bool  onlyDerivedFromOriginal = true)

A list of all displayed DataNode objects. This method might be convenient for program modules that want to display additional information about these nodes, like a total volume of all segmentations, etc.

Build up predicate:

  • ask each tool that is displayed for a predicate (indicating the type of data that this tool will work with)
  • connect all predicates using AND or OR, depending on the parameter m_DisplayMode (ListDataIfAllToolsMatch or ListDataIfAnyToolMatches)
    See also
    SetDisplayMode
    Two modes here:
  • display only nodes below reference data from ToolManager (onlyDerivedFromOriginal == true)
  • display everything matching the predicate (else)

Definition at line 207 of file QmitkToolWorkingDataSelectionBox.cpp.

References mitk::DataStorage::GetAll(), mitk::DataStorage::GetDerivations(), mitk::Tool::GetGroup(), mitk::Tool::GetName(), mitk::DataStorage::GetSubset(), mitk::Tool::GetWorkingDataPreference(), m_ToolGroupsForFiltering, m_ToolManager, and mitk::NodePredicateOr::New().

Referenced by UpdateDataDisplay().

◆ GetDataStorage()

mitk::DataStorage * QmitkToolWorkingDataSelectionBox::GetDataStorage ( )

Definition at line 42 of file QmitkToolWorkingDataSelectionBox.cpp.

References m_ToolManager.

◆ GetSelectedNode()

mitk::DataNode * QmitkToolWorkingDataSelectionBox::GetSelectedNode ( )

Like GetSelectedNodes(), but will only return one object. Will only return what QListView gives as selected object (documentation says nothing is returned if list is in Single selection mode).

Definition at line 192 of file QmitkToolWorkingDataSelectionBox.cpp.

References m_Node.

◆ GetSelectedNodes()

mitk::ToolManager::DataVectorType QmitkToolWorkingDataSelectionBox::GetSelectedNodes ( )

A list of all selected DataNode objects. This method might be convenient for program modules that want to display additional information about these nodes, like a total volume of all segmentations, etc.

Definition at line 163 of file QmitkToolWorkingDataSelectionBox.cpp.

References m_Node.

Referenced by OnWorkingDataSelectionChanged().

◆ GetToolManager()

mitk::ToolManager * QmitkToolWorkingDataSelectionBox::GetToolManager ( )

Returns the associated mitk::ToolManager.

Definition at line 52 of file QmitkToolWorkingDataSelectionBox.cpp.

References m_ToolManager.

◆ OnToolManagerReferenceDataModified()

void QmitkToolWorkingDataSelectionBox::OnToolManagerReferenceDataModified ( )

Callback function, no need to call it. This is used to observe and react to changes in the mitk::ToolManager object.

Definition at line 109 of file QmitkToolWorkingDataSelectionBox.cpp.

References m_LastSelectedReferenceData, m_ToolManager, and UpdateDataDisplay().

Referenced by QmitkToolWorkingDataSelectionBox(), and SetToolManager().

◆ OnToolManagerWorkingDataModified()

void QmitkToolWorkingDataSelectionBox::OnToolManagerWorkingDataModified ( )

Callback function, no need to call it. This is used to observe and react to changes in the mitk::ToolManager object.

Definition at line 98 of file QmitkToolWorkingDataSelectionBox.cpp.

References m_SelfCall, m_ToolManager, UpdateDataDisplay(), and WorkingNodeSelected().

Referenced by QmitkToolWorkingDataSelectionBox(), and SetToolManager().

◆ OnWorkingDataSelectionChanged

void QmitkToolWorkingDataSelectionBox::OnWorkingDataSelectionChanged ( )
protectedslot

◆ SetDataStorage()

void QmitkToolWorkingDataSelectionBox::SetDataStorage ( mitk::DataStorage storage)

Definition at line 47 of file QmitkToolWorkingDataSelectionBox.cpp.

References m_ToolManager.

◆ SetToolManager()

void QmitkToolWorkingDataSelectionBox::SetToolManager ( mitk::ToolManager newManager)

Tell this object to listen to another ToolManager.

Definition at line 57 of file QmitkToolWorkingDataSelectionBox.cpp.

References m_ToolManager, OnToolManagerReferenceDataModified(), OnToolManagerWorkingDataModified(), and UpdateDataDisplay().

◆ UpdateDataDisplay()

void QmitkToolWorkingDataSelectionBox::UpdateDataDisplay ( )

Can be called to trigger an update of the list contents.

Definition at line 120 of file QmitkToolWorkingDataSelectionBox.cpp.

References GetAllNodes(), mitk::DataNode::GetColor(), mitk::DataNode::GetName(), and m_Node.

Referenced by OnToolManagerReferenceDataModified(), OnToolManagerWorkingDataModified(), and SetToolManager().

◆ WorkingNodeSelected

void QmitkToolWorkingDataSelectionBox::WorkingNodeSelected ( const mitk::DataNode )
signal

Member Data Documentation

◆ m_DisplayOnlyDerivedNodes

bool QmitkToolWorkingDataSelectionBox::m_DisplayOnlyDerivedNodes
protected

Definition at line 135 of file QmitkToolWorkingDataSelectionBox.h.

◆ m_LastSelectedReferenceData

mitk::DataNode* QmitkToolWorkingDataSelectionBox::m_LastSelectedReferenceData
protected

◆ m_Node

ItemNodeMapType QmitkToolWorkingDataSelectionBox::m_Node
protected

◆ m_SelfCall

bool QmitkToolWorkingDataSelectionBox::m_SelfCall
protected

◆ m_ToolGroupsForFiltering

std::string QmitkToolWorkingDataSelectionBox::m_ToolGroupsForFiltering
protected

Definition at line 133 of file QmitkToolWorkingDataSelectionBox.h.

Referenced by GetAllNodes().

◆ m_ToolManager


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