]> Creatis software - clitk.git/blobdiff - vv/vvMainWindow.cxx
Merge branch 'master' of /home/dsarrut/clitk3.server
[clitk.git] / vv / vvMainWindow.cxx
index c3465c19f8a7d7276c0f51894efb304d6cc5223c..d965069f7a356fc6778e65fa9d755bae6c0e55a5 100644 (file)
@@ -290,8 +290,8 @@ vvMainWindow::vvMainWindow():vvMainWindowBase()
   connect(linkPanel,SIGNAL(removeLink(QString,QString)),this,SLOT(RemoveLink(QString,QString)));
   connect(overlayPanel,SIGNAL(VFPropertyUpdated(int,int,int,int,double,double,double)),this,SLOT(SetVFProperty(int,int,int,int,double,double,double)));
   connect(overlayPanel,SIGNAL(OverlayPropertyUpdated(int)),this,SLOT(SetOverlayProperty(int)));
-  connect(overlayPanel,SIGNAL(FusionPropertyUpdated(int,int,double,double)),
-          this,SLOT(SetFusionProperty(int,int,double,double)));
+  connect(overlayPanel,SIGNAL(FusionPropertyUpdated(int,int,int,double,double)),
+          this,SLOT(SetFusionProperty(int,int,int,double,double)));
   connect(landmarksPanel,SIGNAL(UpdateRenderWindows()),this,SLOT(UpdateRenderWindows()));
 
   playMode = 0;//pause
@@ -910,8 +910,6 @@ void vvMainWindow::LoadImages(std::vector<std::string> files, vvImageReader::Loa
                 this, SLOT(OverlayChanged(int,double,double)));
         connect(mSlicerManagers.back(), SIGNAL(UpdateFusion(int, double)),
                 this, SLOT(FusionChanged(int,double)));
-        connect(mSlicerManagers.back(), SIGNAL(UpdateWindows(int, int, int)),
-                this,SLOT(WindowsChanged(int, int, int)));
         connect(mSlicerManagers.back(), SIGNAL(WindowLevelChanged(double, double,int, int)),
                 this,SLOT(WindowLevelChanged(double, double, int, int)));
         connect(mSlicerManagers.back(), SIGNAL(UpdateSlice(int,int)),
@@ -1165,15 +1163,17 @@ void vvMainWindow::ImageInfoChanged()
       overlayPanel->getOverlayName(mSlicerManagers[index]->GetOverlayName().c_str());
       overlayPanel->getOverlayProperty(-1);
     }
+    
     if (mSlicerManagers[index]->GetSlicer(0)->GetFusion()) {
       overlayPanel->getFusionName(mSlicerManagers[index]->GetFusionName().c_str());
       overlayPanel->getFusionProperty(mSlicerManagers[index]->GetFusionOpacity(),
+                                      mSlicerManagers[index]->GetFusionThresholdOpacity(),
                                       mSlicerManagers[index]->GetFusionColorMap(),
                                       mSlicerManagers[index]->GetFusionWindow(),
                                       mSlicerManagers[index]->GetFusionLevel());
     } else {
       overlayPanel->getFusionName(mSlicerManagers[index]->GetFusionName().c_str());
-      overlayPanel->getFusionProperty(-1, -1,-1,-1);
+      overlayPanel->getFusionProperty(-1, -1, -1, -1, -1);
     }
   }
 }
@@ -1381,13 +1381,9 @@ void vvMainWindow::DisplayChanged(QTreeWidgetItem *clickedItem, int column)
       mSlicerManagers[slicerManagerIndex]->UpdateSlicer(column-1, true);
       mSlicerManagers[slicerManagerIndex]->UpdateInfoOnCursorPosition(column-1);
       DisplaySliders(slicerManagerIndex, column-1);
-      if(!draw) {
-        // We were not on this branch so far => force visibility
-        vis = true;
-      }
-      else if(clickedParentItem == clickedItem) {
+      if(clickedParentItem == clickedItem) {
         // Toggle
-        vis =  !vis;
+        vis = !draw || !vis;
       }
       clickedSlicer->SetActorVisibility("image", 0, vis);
       clickedParentItem->setData(column, Qt::CheckStateRole, vis?2:0);
@@ -1627,13 +1623,6 @@ void vvMainWindow::FusionChanged(int visibility, double value)
 }
 //------------------------------------------------------------------------------
 
-//------------------------------------------------------------------------------
-void vvMainWindow::WindowsChanged(int window, int view, int slice)
-{
-  infoPanel->setViews(window, view, slice);
-}
-//------------------------------------------------------------------------------
-
 //------------------------------------------------------------------------------
 void vvMainWindow::WindowLevelChanged(double window, double level,int preset,int colormap)
 {
@@ -2144,12 +2133,13 @@ void vvMainWindow::SetOverlayProperty(int color)
 //------------------------------------------------------------------------------
 
 //------------------------------------------------------------------------------
-void vvMainWindow::SetFusionProperty(int opacity, int colormap,double window, double level)
+void vvMainWindow::SetFusionProperty(int opacity, int thresOpacity, int colormap,double window, double level)
 {
   int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
   if (mSlicerManagers[index]->GetSlicer(0)->GetFusion()) {
-    mSlicerManagers[index]->SetFusionOpacity(opacity);
     mSlicerManagers[index]->SetFusionColorMap(colormap);
+    mSlicerManagers[index]->SetFusionOpacity(opacity);
+    mSlicerManagers[index]->SetFusionThresholdOpacity(thresOpacity);
     mSlicerManagers[index]->SetFusionWindow(window);
     mSlicerManagers[index]->SetFusionLevel(level);
     mSlicerManagers[index]->SetColorMap(0);
@@ -2832,8 +2822,6 @@ vvSlicerManager* vvMainWindow::AddImage(vvImage::Pointer image,std::string filen
           this, SLOT(OverlayChanged(int,double,double)));
   connect(mSlicerManagers.back(), SIGNAL(UpdateFusion(int, double)),
           this, SLOT(FusionChanged(int,double)));
-  connect(mSlicerManagers.back(), SIGNAL(UpdateWindows(int, int, int)),
-          this,SLOT(WindowsChanged(int, int, int)));
   connect(mSlicerManagers.back(), SIGNAL(WindowLevelChanged(double, double,int, int)),
           this,SLOT(WindowLevelChanged(double, double, int, int)));
   connect(mSlicerManagers.back(), SIGNAL(UpdateSlice(int,int)),