From: Simon Rit Date: Thu, 17 Nov 2011 12:06:59 +0000 (+0100) Subject: Corrected bug with button All: W/L was read from spin box which X-Git-Tag: v1.3.0~165^2 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=738107919dc9a056d679e75be0760e3eeae3dd4a;p=clitk.git Corrected bug with button All: W/L was read from spin box which resolution is limited by text --- diff --git a/vv/vvMainWindow.cxx b/vv/vvMainWindow.cxx index 6bd2d79..a7c61a9 100644 --- a/vv/vvMainWindow.cxx +++ b/vv/vvMainWindow.cxx @@ -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(); }