]> Creatis software - clitk.git/commitdiff
Corrected bug with button All: W/L was read from spin box which
authorSimon Rit <simon.rit@creatis.insa-lyon.fr>
Thu, 17 Nov 2011 12:06:59 +0000 (13:06 +0100)
committerSimon Rit <simon.rit@creatis.insa-lyon.fr>
Thu, 17 Nov 2011 12:06:59 +0000 (13:06 +0100)
resolution is limited by text

vv/vvMainWindow.cxx

index 6bd2d79731ca7b34b13b27dddc19738397d98aea..a7c61a997efa1a9b0527a56e3c73ed4b874855f4 100644 (file)
@@ -1720,11 +1720,16 @@ void vvMainWindow::SwitchWindowLevel()
 //------------------------------------------------------------------------------
 void vvMainWindow::ApplyWindowLevelToAllImages()
 {
+  int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
+  if(index==-1) return;
+  double window = mSlicerManagers[index]->GetColorWindow();
+  double level = mSlicerManagers[index]->GetColorLevel();
+
   for (unsigned int i = 0; i < mSlicerManagers.size(); i++) {
     if (mSlicerManagers[i] == NULL)
       continue;
-    mSlicerManagers[i]->SetColorWindow(windowSpinBox->value());
-    mSlicerManagers[i]->SetColorLevel(levelSpinBox->value());
+    mSlicerManagers[i]->SetColorWindow(window);
+    mSlicerManagers[i]->SetColorLevel(level);
     mSlicerManagers[i]->SetPreset(6);
     mSlicerManagers[i]->Render();
   }