diff --git a/Modules/SegmentationUI/Qmitk/QmitkToolReferenceDataSelectionBox.cpp b/Modules/SegmentationUI/Qmitk/QmitkToolReferenceDataSelectionBox.cpp index 8b6767c953..fef5292321 100644 --- a/Modules/SegmentationUI/Qmitk/QmitkToolReferenceDataSelectionBox.cpp +++ b/Modules/SegmentationUI/Qmitk/QmitkToolReferenceDataSelectionBox.cpp @@ -1,236 +1,236 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "QmitkToolReferenceDataSelectionBox.h" #include "QmitkDataStorageComboBox.h" //#include "QmitkPropertyListPopup.h" #include "mitkNodePredicateProperty.h" #include "mitkNodePredicateDataType.h" #include "mitkNodePredicateDimension.h" #include "mitkNodePredicateAnd.h" #include "mitkNodePredicateOr.h" #include "mitkNodePredicateNot.h" #include "mitkRenderingManager.h" #include "mitkToolManagerProvider.h" -QmitkToolReferenceDataSelectionBox::QmitkToolReferenceDataSelectionBox(QWidget* parent, mitk::DataStorage* storage) +QmitkToolReferenceDataSelectionBox::QmitkToolReferenceDataSelectionBox(QWidget* parent) :QWidget(parent), m_SelfCall(false), m_DisplayMode(ListDataIfAnyToolMatches ), m_ToolGroupsForFiltering("default") { m_ToolManager = mitk::ToolManagerProvider::GetInstance()->GetToolManager(); m_Layout = new QVBoxLayout( this ); this->setLayout( m_Layout ); m_ReferenceDataSelectionBox = new QmitkDataStorageComboBox( this ); m_Layout->addWidget(m_ReferenceDataSelectionBox); connect( m_ReferenceDataSelectionBox, SIGNAL(OnSelectionChanged(const mitk::DataNode*)), this, SLOT(OnReferenceDataSelected(const mitk::DataNode*)) ); m_ToolManager->ReferenceDataChanged += mitk::MessageDelegate( this, &QmitkToolReferenceDataSelectionBox::OnToolManagerReferenceDataModified ); } QmitkToolReferenceDataSelectionBox::~QmitkToolReferenceDataSelectionBox() { m_ToolManager->ReferenceDataChanged -= mitk::MessageDelegate( this, &QmitkToolReferenceDataSelectionBox::OnToolManagerReferenceDataModified ); } mitk::DataStorage* QmitkToolReferenceDataSelectionBox::GetDataStorage() { return m_ToolManager->GetDataStorage(); } void QmitkToolReferenceDataSelectionBox::SetDataStorage(mitk::DataStorage& storage) { m_ToolManager->SetDataStorage(storage); } void QmitkToolReferenceDataSelectionBox::Initialize(mitk::DataStorage* storage ) { m_ReferenceDataSelectionBox->SetDataStorage( storage ); UpdateDataDisplay(); } mitk::ToolManager* QmitkToolReferenceDataSelectionBox::GetToolManager() { return m_ToolManager; } void QmitkToolReferenceDataSelectionBox::SetToolManager(mitk::ToolManager& newManager) // no NULL pointer allowed here, a manager is required { m_ToolManager->ReferenceDataChanged -= mitk::MessageDelegate( this, &QmitkToolReferenceDataSelectionBox::OnToolManagerReferenceDataModified ); m_ToolManager = &newManager; m_ToolManager->ReferenceDataChanged += mitk::MessageDelegate( this, &QmitkToolReferenceDataSelectionBox::OnToolManagerReferenceDataModified ); UpdateDataDisplay(); } void QmitkToolReferenceDataSelectionBox::UpdateDataDisplay() { m_ReferenceDataSelectionBox->SetPredicate( GetAllPossibleReferenceImagesPredicate().GetPointer() ); EnsureOnlyReferenceImageIsVisibile(); } void QmitkToolReferenceDataSelectionBox::OnReferenceDataSelected(const mitk::DataNode* selectedNode) { emit ReferenceNodeSelected(selectedNode); m_SelfCall = true; m_ToolManager->SetReferenceData( const_cast< mitk::DataNode*>(selectedNode)); // maybe NULL m_SelfCall = false; EnsureOnlyReferenceImageIsVisibile(); } void QmitkToolReferenceDataSelectionBox::EnsureOnlyReferenceImageIsVisibile() { mitk::DataNode* selectedNode = m_ToolManager->GetReferenceData(0); mitk::DataStorage::SetOfObjects::ConstPointer allImageNodes = GetAllPossibleReferenceImages(); for ( mitk::DataStorage::SetOfObjects::const_iterator nodeIter = allImageNodes->begin(); nodeIter != allImageNodes->end(); ++nodeIter ) { mitk::DataNode* currentNode = (*nodeIter).GetPointer(); currentNode->SetVisibility( currentNode == selectedNode ); // only the selected one is visible, everything else is invisible } mitk::RenderingManager::GetInstance()->RequestUpdateAll(); } void QmitkToolReferenceDataSelectionBox::OnToolManagerReferenceDataModified() { if (m_SelfCall) return; const mitk::DataNode* node = m_ToolManager->GetReferenceData(0); emit ReferenceNodeSelected(node); UpdateDataDisplay(); } mitk::NodePredicateBase::ConstPointer QmitkToolReferenceDataSelectionBox::GetAllPossibleReferenceImagesPredicate() { /** * 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) * \sa SetDisplayMode */ std::vector< mitk::NodePredicateBase::ConstPointer > m_Predicates; m_Predicates.clear(); mitk::NodePredicateBase::ConstPointer completePredicate = NULL; const mitk::ToolManager::ToolVectorTypeConst allTools = m_ToolManager->GetTools(); for ( mitk::ToolManager::ToolVectorTypeConst::const_iterator iter = allTools.begin(); iter != allTools.end(); ++iter ) { const mitk::Tool* tool = *iter; if ( (m_ToolGroupsForFiltering.empty()) || ( m_ToolGroupsForFiltering.find( tool->GetGroup() ) != std::string::npos ) || ( m_ToolGroupsForFiltering.find( tool->GetName() ) != std::string::npos ) ) { if (completePredicate) { if ( m_DisplayMode == ListDataIfAnyToolMatches ) { m_Predicates.push_back( mitk::NodePredicateOr::New( completePredicate, tool->GetReferenceDataPreference() ).GetPointer() ); } else { m_Predicates.push_back( mitk::NodePredicateAnd::New( completePredicate, tool->GetReferenceDataPreference() ).GetPointer() ); } completePredicate = m_Predicates.back(); } else { completePredicate = tool->GetReferenceDataPreference(); } } } return completePredicate; } mitk::DataStorage::SetOfObjects::ConstPointer QmitkToolReferenceDataSelectionBox::GetAllPossibleReferenceImages() { mitk::DataStorage* dataStorage = m_ToolManager->GetDataStorage(); if (!dataStorage) { return mitk::DataStorage::SetOfObjects::New().GetPointer(); } mitk::NodePredicateBase::ConstPointer completePredicate = GetAllPossibleReferenceImagesPredicate(); mitk::DataStorage::SetOfObjects::ConstPointer allObjects; /** * display everything matching the predicate */ if (completePredicate.IsNotNull()) { allObjects = dataStorage->GetSubset( completePredicate ); } else { allObjects = dataStorage->GetAll(); } mitk::ToolManager::DataVectorType resultVector; for ( mitk::DataStorage::SetOfObjects::const_iterator objectIter = allObjects->begin(); objectIter != allObjects->end(); ++objectIter ) { mitk::DataNode* node = (*objectIter).GetPointer(); resultVector.push_back( node ); } mitk::DataStorage::SetOfObjects::ConstPointer sceneImages = dataStorage->GetSubset( completePredicate ); return sceneImages; } void QmitkToolReferenceDataSelectionBox::SetToolGroupsForFiltering(const std::string& groups) { m_ToolGroupsForFiltering = groups; UpdateDataDisplay(); } void QmitkToolReferenceDataSelectionBox::SetDisplayMode( QmitkToolReferenceDataSelectionBox::DisplayMode mode ) { if (m_DisplayMode != mode) { m_DisplayMode = mode; UpdateDataDisplay(); } } diff --git a/Modules/SegmentationUI/Qmitk/QmitkToolReferenceDataSelectionBox.h b/Modules/SegmentationUI/Qmitk/QmitkToolReferenceDataSelectionBox.h index b0abd11981..083700775e 100644 --- a/Modules/SegmentationUI/Qmitk/QmitkToolReferenceDataSelectionBox.h +++ b/Modules/SegmentationUI/Qmitk/QmitkToolReferenceDataSelectionBox.h @@ -1,128 +1,128 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkToolReferenceDataSelectionBox_h_Included #define QmitkToolReferenceDataSelectionBox_h_Included #include "mitkToolManager.h" #include #include "mitkDataStorage.h" #include #include class QmitkDataStorageComboBox; /** \brief Display the data selection of a ToolManager. \sa mitk::ToolManager \sa mitk::DataStorage \ingroup ToolManagerEtAl \ingroup Widgets There is a separate page describing the general design of QmitkInteractiveSegmentation: \ref QmitkInteractiveSegmentationTechnicalPage Shows the reference data of a ToolManager in a segmentation setting. The reference image can be selected from a combobox, where all images of the scene are listed. $Author: maleike $ */ class MitkSegmentationUI_EXPORT QmitkToolReferenceDataSelectionBox : public QWidget { Q_OBJECT public: /** * \brief 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 */ enum DisplayMode { ListDataIfAllToolsMatch, ListDataIfAnyToolMatches}; - QmitkToolReferenceDataSelectionBox(QWidget* parent = 0, mitk::DataStorage* storage = 0); + QmitkToolReferenceDataSelectionBox(QWidget* parent = 0); virtual ~QmitkToolReferenceDataSelectionBox(); mitk::DataStorage* GetDataStorage(); void SetDataStorage(mitk::DataStorage& storage); /// initialization with a data storage object void Initialize(mitk::DataStorage*); void UpdateDataDisplay(); mitk::ToolManager* GetToolManager(); void SetToolManager(mitk::ToolManager&); // no NULL pointer allowed here, a manager is required void OnToolManagerReferenceDataModified(); /** * \brief No brief description. * * Should be called to restrict the number of tools that are * evaluated to build up the list. Default is to ask all tools for their predicate, by * setting the 'groups' string this can be restricted to certain groups of tools * or single tools. */ void SetToolGroupsForFiltering(const std::string& groups); /** * \brief How the list contents is determined. * * See also documentation of DisplayMode. * * \sa DisplayMode */ void SetDisplayMode( DisplayMode mode ); signals: void ReferenceNodeSelected(const mitk::DataNode*); protected slots: void OnReferenceDataSelected(const mitk::DataNode* node); void EnsureOnlyReferenceImageIsVisibile(); protected: mitk::DataStorage::SetOfObjects::ConstPointer GetAllPossibleReferenceImages(); mitk::NodePredicateBase::ConstPointer GetAllPossibleReferenceImagesPredicate(); mitk::ToolManager::Pointer m_ToolManager; QmitkDataStorageComboBox* m_ReferenceDataSelectionBox; bool m_SelfCall; DisplayMode m_DisplayMode; std::string m_ToolGroupsForFiltering; QVBoxLayout* m_Layout; }; #endif diff --git a/Modules/SegmentationUI/Qmitk/QmitkToolWorkingDataSelectionBox.cpp b/Modules/SegmentationUI/Qmitk/QmitkToolWorkingDataSelectionBox.cpp index 141456760f..fb91ee9a14 100644 --- a/Modules/SegmentationUI/Qmitk/QmitkToolWorkingDataSelectionBox.cpp +++ b/Modules/SegmentationUI/Qmitk/QmitkToolWorkingDataSelectionBox.cpp @@ -1,298 +1,298 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "QmitkToolWorkingDataSelectionBox.h" #include "mitkToolManagerProvider.h" -QmitkToolWorkingDataSelectionBox::QmitkToolWorkingDataSelectionBox(QWidget* parent, mitk::DataStorage* storage) +QmitkToolWorkingDataSelectionBox::QmitkToolWorkingDataSelectionBox(QWidget* parent) :QListWidget(parent), m_SelfCall(false), m_LastSelectedReferenceData(NULL), m_ToolGroupsForFiltering("default"), m_DisplayOnlyDerivedNodes(true) { m_ToolManager = mitk::ToolManagerProvider::GetInstance()->GetToolManager(); // this widget should be placeable from designer so it can't take other than the defaul parameters QListWidget::setSelectionMode( QListWidget::MultiSelection ); QListWidget::setDragDropMode(QListWidget::InternalMove); connect( this, SIGNAL(itemSelectionChanged()), this, SLOT(OnWorkingDataSelectionChanged()) ); m_ToolManager->ReferenceDataChanged += mitk::MessageDelegate( this, &QmitkToolWorkingDataSelectionBox::OnToolManagerReferenceDataModified ); m_ToolManager->WorkingDataChanged += mitk::MessageDelegate( this, &QmitkToolWorkingDataSelectionBox::OnToolManagerWorkingDataModified ); } QmitkToolWorkingDataSelectionBox::~QmitkToolWorkingDataSelectionBox() { } mitk::DataStorage* QmitkToolWorkingDataSelectionBox::GetDataStorage() { return m_ToolManager->GetDataStorage(); } void QmitkToolWorkingDataSelectionBox::SetDataStorage(mitk::DataStorage& storage) { m_ToolManager->SetDataStorage(storage); } mitk::ToolManager* QmitkToolWorkingDataSelectionBox::GetToolManager() { return m_ToolManager; } void QmitkToolWorkingDataSelectionBox::SetToolManager(mitk::ToolManager& newManager) // no NULL pointer allowed here, a manager is required { m_ToolManager->ReferenceDataChanged -= mitk::MessageDelegate( this, &QmitkToolWorkingDataSelectionBox::OnToolManagerReferenceDataModified ); m_ToolManager->WorkingDataChanged -= mitk::MessageDelegate( this, &QmitkToolWorkingDataSelectionBox::OnToolManagerWorkingDataModified ); m_ToolManager = &newManager; m_ToolManager->ReferenceDataChanged += mitk::MessageDelegate( this, &QmitkToolWorkingDataSelectionBox::OnToolManagerReferenceDataModified ); m_ToolManager->WorkingDataChanged += mitk::MessageDelegate( this, &QmitkToolWorkingDataSelectionBox::OnToolManagerWorkingDataModified ); UpdateDataDisplay(); } void QmitkToolWorkingDataSelectionBox::OnWorkingDataSelectionChanged() { static mitk::ToolManager::DataVectorType previouslySelectedNodes; mitk::ToolManager::DataVectorType selection = this->GetSelectedNodes(); previouslySelectedNodes = selection; if (selection.size() >0) { const mitk::DataNode* node = selection[0]; emit WorkingNodeSelected(node); } else { emit WorkingNodeSelected(NULL); } m_SelfCall = true; m_ToolManager->SetWorkingData( selection ); // maybe empty m_SelfCall = false; } void QmitkToolWorkingDataSelectionBox::OnToolManagerWorkingDataModified() { if (m_SelfCall) return; const mitk::DataNode* node = m_ToolManager->GetWorkingData(0); emit WorkingNodeSelected(node); UpdateDataDisplay(); } void QmitkToolWorkingDataSelectionBox::OnToolManagerReferenceDataModified() { if ( m_ToolManager->GetReferenceData(0) != m_LastSelectedReferenceData ) { m_ToolManager->SetWorkingData(NULL); UpdateDataDisplay(); m_LastSelectedReferenceData = m_ToolManager->GetReferenceData(0); } } void QmitkToolWorkingDataSelectionBox::UpdateDataDisplay() { // clear all QListWidget::clear(); m_Node.clear(); // rebuild contents mitk::ToolManager::DataVectorType allObjects = GetAllNodes( false ); for ( mitk::ToolManager::DataVectorType::const_iterator objectIter = allObjects.begin(); objectIter != allObjects.end(); ++objectIter) { mitk::DataNode* node = *objectIter; if (node) // delete this check when datastorage is really used { // get name and color std::string name = node->GetName(); float rgb[3]; rgb[0] = 1.0; rgb[1] = 0.0; rgb[2] = 0.0; node->GetColor(rgb); QRgb qrgb = qRgb( (int)(rgb[0]*255.0), (int)(rgb[1]*255.0), (int)(rgb[2]*255.0) ); QPixmap pixmap(25,18); pixmap.fill(QColor(qrgb)); // create a list item QListWidgetItem* newItem = new QListWidgetItem(); QString qname = QString::fromLocal8Bit(name.c_str()); //set name and color newItem->setText(qname); newItem->setIcon(QIcon(pixmap)); this->addItem(newItem); m_Node.insert( std::make_pair( newItem, node ) ); } } } mitk::ToolManager::DataVectorType QmitkToolWorkingDataSelectionBox::GetSelectedNodes() { mitk::ToolManager::DataVectorType result; QList items; for (int j=0; jcount(); j++) { if (this->item(j)->isSelected()) items.append(this->item(j)); } for (int i=0; isecond; if (node) result.push_back(node); } } } return result; } mitk::DataNode* QmitkToolWorkingDataSelectionBox::GetSelectedNode() { QListWidgetItem* item = QListWidget::selectedItems().first(); if (item) { ItemNodeMapType::iterator iter = m_Node.find(item); if ( iter != m_Node.end() ) { return iter->second; } } return NULL; } mitk::ToolManager::DataVectorType QmitkToolWorkingDataSelectionBox::GetAllNodes( bool onlyDerivedFromOriginal ) { mitk::DataStorage* dataStorage = m_ToolManager->GetDataStorage(); if (!dataStorage) { return mitk::ToolManager::DataVectorType(); } /** * 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) * \sa SetDisplayMode */ std::vector< mitk::NodePredicateBase::ConstPointer > m_Predicates; mitk::NodePredicateBase::ConstPointer completePredicate = NULL; bool rebuildNeeded = true; if (rebuildNeeded) { m_Predicates.clear(); const mitk::ToolManager::ToolVectorTypeConst allTools = m_ToolManager->GetTools(); for ( mitk::ToolManager::ToolVectorTypeConst::const_iterator iter = allTools.begin(); iter != allTools.end(); ++iter ) { const mitk::Tool* tool = *iter; if ( (m_ToolGroupsForFiltering.empty()) || ( m_ToolGroupsForFiltering.find( tool->GetGroup() ) != std::string::npos ) || ( m_ToolGroupsForFiltering.find( tool->GetName() ) != std::string::npos ) ) { if (completePredicate.IsNotNull()) { m_Predicates.push_back( mitk::NodePredicateOr::New( completePredicate, tool->GetWorkingDataPreference()).GetPointer() ); completePredicate = m_Predicates.back(); } else { completePredicate = tool->GetWorkingDataPreference(); } } } } // TODO delete all m_Predicates mitk::DataStorage::SetOfObjects::ConstPointer allObjects; /** * Two modes here: * - display only nodes below reference data from ToolManager (onlyDerivedFromOriginal == true) * - display everything matching the predicate (else) */ if ( onlyDerivedFromOriginal ) { mitk::DataNode* sourceNode( m_ToolManager->GetReferenceData(0) ); if (sourceNode) { allObjects = dataStorage->GetDerivations( sourceNode, completePredicate, false ); } else { allObjects = mitk::DataStorage::SetOfObjects::New(); } } else { if (completePredicate) { allObjects = dataStorage->GetSubset( completePredicate ); } else { allObjects = dataStorage->GetAll(); } } m_Predicates.clear(); completePredicate = NULL; mitk::ToolManager::DataVectorType resultVector; for ( mitk::DataStorage::SetOfObjects::const_iterator objectIter = allObjects->begin(); objectIter != allObjects->end(); ++objectIter ) { mitk::DataNode* node = (*objectIter).GetPointer(); resultVector.push_back( node ); } return resultVector; } diff --git a/Modules/SegmentationUI/Qmitk/QmitkToolWorkingDataSelectionBox.h b/Modules/SegmentationUI/Qmitk/QmitkToolWorkingDataSelectionBox.h index d2ca79ef0c..51b419fd18 100644 --- a/Modules/SegmentationUI/Qmitk/QmitkToolWorkingDataSelectionBox.h +++ b/Modules/SegmentationUI/Qmitk/QmitkToolWorkingDataSelectionBox.h @@ -1,142 +1,142 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkToolWorkingDataSelectionListBox_h_Included #define QmitkToolWorkingDataSelectionListBox_h_Included // mmueller #include #include #include "mitkToolManager.h" #include "mitkProperties.h" /** \brief Display the data selection of a ToolManager. \sa mitk::ToolManager \sa mitk::DataStorage \ingroup Widgets There is a separate page describing the general design of QmitkInteractiveSegmentation: \ref 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 $ */ class MitkSegmentationUI_EXPORT QmitkToolWorkingDataSelectionBox : public QListWidget { Q_OBJECT public: /** * \brief 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 */ enum DisplayMode { ListDataIfAllToolsMatch, ListDataIfAnyToolMatches}; - QmitkToolWorkingDataSelectionBox(QWidget* parent = 0, mitk::DataStorage* storage = 0); + QmitkToolWorkingDataSelectionBox(QWidget* parent = 0); virtual ~QmitkToolWorkingDataSelectionBox(); mitk::DataStorage* GetDataStorage(); void SetDataStorage(mitk::DataStorage& storage); /** \brief Can be called to trigger an update of the list contents. */ void UpdateDataDisplay(); /** \brief Returns the associated mitk::ToolManager. */ mitk::ToolManager* GetToolManager(); /** \brief Tell this object to listen to another ToolManager. */ void SetToolManager(mitk::ToolManager&); // no NULL pointer allowed here, a manager is required /** * \brief 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. */ mitk::ToolManager::DataVectorType GetAllNodes( bool onlyDerivedFromOriginal = true ); /** * \brief 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. */ mitk::ToolManager::DataVectorType GetSelectedNodes(); /** * \brief 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). */ mitk::DataNode* GetSelectedNode(); /** * \brief Callback function, no need to call it. * This is used to observe and react to changes in the mitk::ToolManager object. */ void OnToolManagerWorkingDataModified(); /** * \brief Callback function, no need to call it. * This is used to observe and react to changes in the mitk::ToolManager object. */ void OnToolManagerReferenceDataModified(); signals: void WorkingNodeSelected(const mitk::DataNode*); protected slots: void OnWorkingDataSelectionChanged(); protected: typedef std::map< QListWidgetItem*, mitk::DataNode* > ItemNodeMapType; mitk::ToolManager::Pointer m_ToolManager; ItemNodeMapType m_Node; bool m_SelfCall; mitk::DataNode* m_LastSelectedReferenceData; std::string m_ToolGroupsForFiltering; bool m_DisplayOnlyDerivedNodes; }; #endif