diff --git a/Modules/SegmentationUI/Qmitk/QmitkToolReferenceDataSelectionBox.cpp b/Modules/SegmentationUI/Qmitk/QmitkToolReferenceDataSelectionBox.cpp index b7096e4ae9..8b6767c953 100644 --- a/Modules/SegmentationUI/Qmitk/QmitkToolReferenceDataSelectionBox.cpp +++ b/Modules/SegmentationUI/Qmitk/QmitkToolReferenceDataSelectionBox.cpp @@ -1,234 +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) :QWidget(parent), m_SelfCall(false), m_DisplayMode(ListDataIfAnyToolMatches ), m_ToolGroupsForFiltering("default") { - m_ToolManager = mitk::ToolManager::New( storage ); + 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/QmitkToolRoiDataSelectionBox.cpp b/Modules/SegmentationUI/Qmitk/QmitkToolRoiDataSelectionBox.cpp index b4c0dfe20f..e823b022d9 100644 --- a/Modules/SegmentationUI/Qmitk/QmitkToolRoiDataSelectionBox.cpp +++ b/Modules/SegmentationUI/Qmitk/QmitkToolRoiDataSelectionBox.cpp @@ -1,197 +1,198 @@ /*=================================================================== 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 "QmitkToolRoiDataSelectionBox.h" #include #include #include +#include "mitkToolManagerProvider.h" QmitkToolRoiDataSelectionBox::QmitkToolRoiDataSelectionBox(QWidget* parent, mitk::DataStorage* storage) :QWidget(parent), m_SelfCall(false), m_lastSelection(mitk::DataNode::New()), m_lastSelectedName(tr("none")) { QBoxLayout* mainLayout = new QVBoxLayout(this); m_segmentationComboBox = new QComboBox(this); QLabel* label = new QLabel("region of interest:", this); m_boundingObjectWidget = new QmitkBoundingObjectWidget(); mainLayout->addWidget(label); mainLayout->addWidget(m_segmentationComboBox); mainLayout->addWidget(m_boundingObjectWidget); //connect signals connect(m_segmentationComboBox, SIGNAL(activated(const QString&)), this, SLOT(OnRoiDataSelectionChanged(const QString&)) ); connect(m_boundingObjectWidget, SIGNAL(BoundingObjectsChanged()), this, SLOT(OnRoiDataSelectionChanged())); //create ToolManager - m_ToolManager = mitk::ToolManager::New(storage); + m_ToolManager = mitk::ToolManagerProvider::GetInstance()->GetToolManager(); //setup message delegates m_ToolManager->RoiDataChanged += mitk::MessageDelegate (this, &QmitkToolRoiDataSelectionBox::OnToolManagerRoiDataModified); mainLayout->deleteLater(); label->deleteLater(); } QmitkToolRoiDataSelectionBox::~QmitkToolRoiDataSelectionBox() { delete m_segmentationComboBox; delete m_boundingObjectWidget; m_ToolManager->GetDataStorage()->RemoveNodeEvent.RemoveListener( mitk::MessageDelegate1( this, &QmitkToolRoiDataSelectionBox::DataStorageChanged ) ); } void QmitkToolRoiDataSelectionBox::SetDataStorage(mitk::DataStorage &storage) { m_ToolManager->SetDataStorage(storage); m_boundingObjectWidget->SetDataStorage(&storage); UpdateComboBoxData(); storage.RemoveNodeEvent.AddListener( mitk::MessageDelegate1( this, &QmitkToolRoiDataSelectionBox::DataStorageChanged ) ); } mitk::DataStorage* QmitkToolRoiDataSelectionBox::GetDataStorage() { return m_ToolManager->GetDataStorage(); } void QmitkToolRoiDataSelectionBox::SetToolManager(mitk::ToolManager& manager) { //remove old messagedelegates m_ToolManager->RoiDataChanged -= mitk::MessageDelegate (this, &QmitkToolRoiDataSelectionBox::OnToolManagerRoiDataModified); //set new toolmanager m_ToolManager = &manager; //add new message delegates m_ToolManager->RoiDataChanged += mitk::MessageDelegate (this, &QmitkToolRoiDataSelectionBox::OnToolManagerRoiDataModified); } mitk::ToolManager* QmitkToolRoiDataSelectionBox::GetToolManager() { return m_ToolManager; } void QmitkToolRoiDataSelectionBox::OnToolManagerRoiDataModified() { if (m_SelfCall) return; UpdateComboBoxData(); } void QmitkToolRoiDataSelectionBox::DataStorageChanged(const mitk::DataNode* node ) { if (m_SelfCall) return; if ( this->GetDataStorage()->GetAll()->size() == 1 ) { m_boundingObjectWidget->RemoveAllItems(); } } void QmitkToolRoiDataSelectionBox::OnRoiDataSelectionChanged() { this->OnRoiDataSelectionChanged(tr("bounding objects")); } void QmitkToolRoiDataSelectionBox::OnRoiDataSelectionChanged(const QString& name) { if (name.compare(tr("")) == 0) return; m_lastSelectedName = name; m_boundingObjectWidget->setEnabled(false); mitk::DataNode::Pointer selection = NULL; if ( name.compare(tr("none"))==0) m_segmentationComboBox->setCurrentIndex(0); else if (name.compare(tr("bounding objects"))==0) { m_boundingObjectWidget->setEnabled(true); selection = m_boundingObjectWidget->GetAllBoundingObjects(); } else { selection = m_ToolManager->GetDataStorage()->GetNamedNode(name.toLocal8Bit().data()); if (m_lastSelection.IsNotNull()) m_lastSelection->SetProperty("outline binary", mitk::BoolProperty::New(false)); } if (selection == m_lastSelection) return; m_lastSelection = selection; if (m_lastSelection.IsNotNull()) { m_lastSelection->SetProperty("outline binary", mitk::BoolProperty::New(true)); m_lastSelection->SetProperty("outline width", mitk::FloatProperty::New(2.0)); } m_SelfCall = true; m_ToolManager->SetRoiData(selection); m_SelfCall = false; } void QmitkToolRoiDataSelectionBox::UpdateComboBoxData() { m_segmentationComboBox->clear(); m_segmentationComboBox->addItem(tr("none")); m_segmentationComboBox->insertSeparator(1); //predicates for combobox mitk::NodePredicateProperty::Pointer isBinary= mitk::NodePredicateProperty::New("binary", mitk::BoolProperty::New(true)); mitk::NodePredicateDataType::Pointer isImage= mitk::NodePredicateDataType::New("Image"); mitk::NodePredicateProperty::Pointer isHelperObject= mitk::NodePredicateProperty::New("helper object", mitk::BoolProperty::New(true)); mitk::NodePredicateNot::Pointer isNotHelperObject = mitk::NodePredicateNot::New(isHelperObject); mitk::NodePredicateAnd::Pointer segmentationPredicate = mitk::NodePredicateAnd::New(isImage, isBinary, isNotHelperObject); mitk::DataStorage::SetOfObjects::ConstPointer allSegmentations = m_ToolManager->GetDataStorage()->GetSubset(segmentationPredicate); QStringList names; for (mitk::DataStorage::SetOfObjects::const_iterator it = allSegmentations->begin(); it != allSegmentations->end(); ++it) { mitk::DataNode::Pointer node = *it; QString name = QString::fromLocal8Bit(node->GetName().c_str()); names.append(name); } if (names.length() > 0) { m_segmentationComboBox->addItems(names); m_segmentationComboBox->insertSeparator(names.length()+2); } m_segmentationComboBox->addItem(tr("bounding objects")); int id = m_segmentationComboBox->findText(m_lastSelectedName); if (id < 0) this->OnRoiDataSelectionChanged(tr("none")); else m_segmentationComboBox->setCurrentIndex(id); } void QmitkToolRoiDataSelectionBox::setEnabled(bool flag) { if (!flag) this->OnRoiDataSelectionChanged(tr("none")); m_segmentationComboBox->setEnabled(flag); } diff --git a/Modules/SegmentationUI/Qmitk/QmitkToolWorkingDataSelectionBox.cpp b/Modules/SegmentationUI/Qmitk/QmitkToolWorkingDataSelectionBox.cpp index 0ffbd62b7b..141456760f 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) :QListWidget(parent), m_SelfCall(false), m_LastSelectedReferenceData(NULL), m_ToolGroupsForFiltering("default"), m_DisplayOnlyDerivedNodes(true) { - m_ToolManager = mitk::ToolManager::New( storage ); // this widget should be placeable from designer so it can't take other than the defaul parameters + 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; }