Medical Imaging Interaction Toolkit  2016.11.0
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=0)
 
virtual ~QmitkToolWorkingDataSelectionBox ()
 
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

There is a separate page describing the general design of QmitkInteractiveSegmentation: QmitkInteractiveSegmentationTechnicalPage

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 46 of file QmitkToolWorkingDataSelectionBox.h.

Member Typedef Documentation

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

Definition at line 130 of file QmitkToolWorkingDataSelectionBox.h.

Member Enumeration Documentation

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 61 of file QmitkToolWorkingDataSelectionBox.h.

Constructor & Destructor Documentation

QmitkToolWorkingDataSelectionBox::~QmitkToolWorkingDataSelectionBox ( )
virtual

Definition at line 42 of file QmitkToolWorkingDataSelectionBox.cpp.

Member Function Documentation

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 211 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, mitk::NodePredicateOr::New(), and mitk::New().

Referenced by UpdateDataDisplay().

mitk::DataStorage * QmitkToolWorkingDataSelectionBox::GetDataStorage ( )

Definition at line 46 of file QmitkToolWorkingDataSelectionBox.cpp.

References m_ToolManager.

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 196 of file QmitkToolWorkingDataSelectionBox.cpp.

References m_Node.

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 167 of file QmitkToolWorkingDataSelectionBox.cpp.

References m_Node.

Referenced by OnWorkingDataSelectionChanged().

mitk::ToolManager * QmitkToolWorkingDataSelectionBox::GetToolManager ( )

Returns the associated mitk::ToolManager.

Definition at line 56 of file QmitkToolWorkingDataSelectionBox.cpp.

References m_ToolManager.

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 113 of file QmitkToolWorkingDataSelectionBox.cpp.

References m_LastSelectedReferenceData, m_ToolManager, and UpdateDataDisplay().

Referenced by QmitkToolWorkingDataSelectionBox(), and SetToolManager().

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 102 of file QmitkToolWorkingDataSelectionBox.cpp.

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

Referenced by QmitkToolWorkingDataSelectionBox(), and SetToolManager().

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

Definition at line 51 of file QmitkToolWorkingDataSelectionBox.cpp.

References m_ToolManager.

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

Tell this object to listen to another ToolManager.

Definition at line 61 of file QmitkToolWorkingDataSelectionBox.cpp.

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

void QmitkToolWorkingDataSelectionBox::UpdateDataDisplay ( )

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

Definition at line 124 of file QmitkToolWorkingDataSelectionBox.cpp.

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

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

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

Member Data Documentation

bool QmitkToolWorkingDataSelectionBox::m_DisplayOnlyDerivedNodes
protected

Definition at line 142 of file QmitkToolWorkingDataSelectionBox.h.

mitk::DataNode* QmitkToolWorkingDataSelectionBox::m_LastSelectedReferenceData
protected
ItemNodeMapType QmitkToolWorkingDataSelectionBox::m_Node
protected
bool QmitkToolWorkingDataSelectionBox::m_SelfCall
protected
std::string QmitkToolWorkingDataSelectionBox::m_ToolGroupsForFiltering
protected

Definition at line 140 of file QmitkToolWorkingDataSelectionBox.h.

Referenced by GetAllNodes().


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