X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvToolStructureSetManager.cxx;h=a755369a3a0208479bebf97b13ffa98db5dcac2f;hb=e6df1e1e6d29bacf5878463ef4db7589088ed381;hp=257f57e42578bae7471f79831c9dc791023cf2e7;hpb=f66c3f22b18229b8a3540c4437886fac388ec8a3;p=clitk.git diff --git a/vv/vvToolStructureSetManager.cxx b/vv/vvToolStructureSetManager.cxx index 257f57e..a755369 100644 --- a/vv/vvToolStructureSetManager.cxx +++ b/vv/vvToolStructureSetManager.cxx @@ -109,7 +109,7 @@ vvToolStructureSetManager::~vvToolStructureSetManager() void vvToolStructureSetManager::Initialize() { SetToolName("ROIManager"); SetToolMenuName("Display ROI"); - SetToolIconFilename(":/common/icons/lung-overlay.png"); + SetToolIconFilename(":/common/icons/tool-roi.png"); SetToolTip("Display ROI from label image."); SetToolExperimental(true); } @@ -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; } //------------------------------------------------------------------------------