From f6af622df43e07149d56b5ffc0627e19c30874c5 Mon Sep 17 00:00:00 2001 From: dsarrut Date: Wed, 7 Jul 2010 07:04:54 +0000 Subject: [PATCH] add static "AddImage" to load ROI from other tools --- vv/vvToolStructureSetManager.cxx | 45 +++++++++----------------------- vv/vvToolStructureSetManager.h | 2 +- 2 files changed, 13 insertions(+), 34 deletions(-) diff --git a/vv/vvToolStructureSetManager.cxx b/vv/vvToolStructureSetManager.cxx index 257f57e..4684b5b 100644 --- a/vv/vvToolStructureSetManager.cxx +++ b/vv/vvToolStructureSetManager.cxx @@ -617,46 +617,25 @@ void vvToolStructureSetManager::CheckInputList(std::vector & l //------------------------------------------------------------------------------ // STATIC -vvToolStructureSetManager * vvToolStructureSetManager::AddImage(vvSlicerManager * m, vvImage::Pointer image, double BG, bool m_modeBG) +vvToolStructureSetManager * vvToolStructureSetManager::AddImage(vvSlicerManager * m, std::string name, vvImage::Pointer image, double BG, bool m_modeBG) { - // DD("static AddImage"); - //DD(mListOfInputs.size()); + DD("static AddImage"); + DD(mListOfInputs.size()); + // If the tool is open for this vvSlicerManager, use it and return if (mListOfOpenTool[m]) { - DD("found"); vvToolStructureSetManager * tool = mListOfOpenTool[m]; - tool->AddImage(image, "bidon.mhd", BG, m_modeBG); + tool->AddImage(image, name, BG, m_modeBG); tool->UpdateImage(); - // tool->show(); return tool; } - else { - DD("not found"); - } - - std::vector::iterator iter = - std::find(mListOfInputs.begin(), mListOfInputs.end(), m); - if (iter != mListOfInputs.end()) { - DD("found"); - DD("TODO"); - - } - else { - DD("not found"); - // mMainWindowBase instead of NULL, should be static ? - - vvToolStructureSetManager * tool = new vvToolStructureSetManager - (CREATOR(vvToolStructureSetManager)->GetMainWindow(), Qt::Dialog, m); - - // WARNING : load list of image and selec -> to change to force mCurrentSlicerManager - - // tool->InputIsSelected(); - tool->AddImage(image, "bidon.mhd", BG, m_modeBG); - tool->UpdateImage(); - tool->show(); - return tool; - } - return NULL; + // If the tool is not open, create it + vvToolStructureSetManager * tool = new vvToolStructureSetManager + (CREATOR(vvToolStructureSetManager)->GetMainWindow(), Qt::Dialog, m); + tool->AddImage(image, name, BG, m_modeBG); + tool->UpdateImage(); + tool->show(); + return tool; } //------------------------------------------------------------------------------ diff --git a/vv/vvToolStructureSetManager.h b/vv/vvToolStructureSetManager.h index db01935..4d4cf50 100644 --- a/vv/vvToolStructureSetManager.h +++ b/vv/vvToolStructureSetManager.h @@ -46,7 +46,7 @@ class vvToolStructureSetManager: void UpdateStructureSetInTreeWidget(int index, clitk::DicomRT_StructureSet * s); void AddRoiInTreeWidget(clitk::DicomRT_ROI * roi, QTreeWidget * w); - static vvToolStructureSetManager * AddImage(vvSlicerManager * m, vvImage::Pointer image, double BG, bool modeBG=true); + static vvToolStructureSetManager * AddImage(vvSlicerManager * m, std::string name, vvImage::Pointer image, double BG, bool modeBG=true); void AddImage(vvImage::Pointer image, std::string filename, double BG, bool modeBG=true); void UpdateImage(); -- 2.47.1