]> Creatis software - clitk.git/blobdiff - vv/vvToolStructureSetManager.cxx
*** empty log message ***
[clitk.git] / vv / vvToolStructureSetManager.cxx
index 257f57e42578bae7471f79831c9dc791023cf2e7..a755369a3a0208479bebf97b13ffa98db5dcac2f 100644 (file)
@@ -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<vvSlicerManager*> & 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<vvSlicerManager*>::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;
 }
 //------------------------------------------------------------------------------