From df1fe7da56a47ca087ca20ff5bb3c5b74abaad01 Mon Sep 17 00:00:00 2001 From: Romulo Pinho Date: Tue, 13 Sep 2011 17:36:36 +0200 Subject: [PATCH] finer control over fusion transparency - addition of a spin box to set the values --- vv/qt_ui/vvOverlayPanel.ui | 49 +++++++++++++++++++++++++++++++++----- vv/vvOverlayPanel.cxx | 11 +++++++++ vv/vvOverlayPanel.h | 1 + vv/vvSlicer.cxx | 4 ++-- vv/vvSlicerManager.cxx | 2 +- 5 files changed, 58 insertions(+), 9 deletions(-) diff --git a/vv/qt_ui/vvOverlayPanel.ui b/vv/qt_ui/vvOverlayPanel.ui index eab2f23..ef00277 100644 --- a/vv/qt_ui/vvOverlayPanel.ui +++ b/vv/qt_ui/vvOverlayPanel.ui @@ -6,7 +6,7 @@ 0 0 - 342 + 344 480 @@ -405,7 +405,7 @@ p, li { white-space: pre-wrap; } QFrame::Raised - + @@ -422,7 +422,7 @@ p, li { white-space: pre-wrap; } - + @@ -435,7 +435,7 @@ p, li { white-space: pre-wrap; } - + Global Opacity : @@ -455,6 +455,25 @@ p, li { white-space: pre-wrap; } + + + + 2 + + + 0.000000000000000 + + + 100.000000000000000 + + + 1.000000000000000 + + + 100.000000000000000 + + + @@ -484,6 +503,25 @@ p, li { white-space: pre-wrap; } + + + + 2 + + + 0.000000000000000 + + + 100.000000000000000 + + + 1.000000000000000 + + + 0.000000000000000 + + + @@ -562,7 +600,7 @@ p, li { white-space: pre-wrap; } - + 4 @@ -614,7 +652,6 @@ p, li { white-space: pre-wrap; } - diff --git a/vv/vvOverlayPanel.cxx b/vv/vvOverlayPanel.cxx index eb2eaa1..4d2bcf2 100644 --- a/vv/vvOverlayPanel.cxx +++ b/vv/vvOverlayPanel.cxx @@ -49,6 +49,8 @@ vvOverlayPanel::vvOverlayPanel(QWidget * parent):QWidget(parent) connect(fusionColorMapComboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(setFusionProperty())); connect(fusionWindowSpinBox,SIGNAL(valueChanged(double)),this,SLOT(setFusionProperty())); connect(fusionLevelSpinBox,SIGNAL(valueChanged(double)),this,SLOT(setFusionProperty())); + connect(fusionOpacitySpin,SIGNAL(valueChanged(double)),this,SLOT(setFusionSpinProperty())); + connect(fusionThresSpin,SIGNAL(valueChanged(double)),this,SLOT(setFusionSpinProperty())); connect(overlayWindowSpinBox,SIGNAL(valueChanged(double)),this,SLOT(setOverlayProperty())); connect(overlayLevelSpinBox,SIGNAL(valueChanged(double)),this,SLOT(setOverlayProperty())); connect(overlayLinkCheckBox,SIGNAL(stateChanged(int)),this,SLOT(setOverlayProperty())); @@ -217,10 +219,19 @@ void vvOverlayPanel::setFusionProperty() if (disableFusionSignals) return; + fusionOpacitySpin->setValue(opacityHorizontalSlider->value()); + fusionThresSpin->setValue(thresOpacityHorizontalSlider->value()); + emit FusionPropertyUpdated(opacityHorizontalSlider->value(), thresOpacityHorizontalSlider->value(), fusionColorMapComboBox->currentIndex(), fusionWindowSpinBox->value(), fusionLevelSpinBox->value()); } +void vvOverlayPanel::setFusionSpinProperty() +{ + opacityHorizontalSlider->setValue(fusionOpacitySpin->value()); + thresOpacityHorizontalSlider->setValue(fusionThresSpin->value()); +} + void vvOverlayPanel::getCurrentFusionInfo(int visibility,double value) { QString fusionValue = "Pixel value in image 2 : "; diff --git a/vv/vvOverlayPanel.h b/vv/vvOverlayPanel.h index 63bad7b..4a89a1f 100644 --- a/vv/vvOverlayPanel.h +++ b/vv/vvOverlayPanel.h @@ -52,6 +52,7 @@ public slots: void setVFProperty(); void setOverlayProperty(); void setFusionProperty(); + void setFusionSpinProperty(); void VFColorChangeRequest(); signals: diff --git a/vv/vvSlicer.cxx b/vv/vvSlicer.cxx index 8141ccd..92cb268 100644 --- a/vv/vvSlicer.cxx +++ b/vv/vvSlicer.cxx @@ -1108,7 +1108,7 @@ void vvSlicer::SetColorWindow(double window) vtkLookupTable* LUT = static_cast(this->GetWindowLevel()->GetLookupTable()); if ( LUT ) { double level = this->GetWindowLevel()->GetLevel(); - LUT->SetTableRange(level-fabs(window)/4,level+fabs(window)/4); + LUT->SetTableRange(level-fabs(window)/2,level+fabs(window)/2); LUT->Build(); } this->vtkImageViewer2::SetColorWindow(window); @@ -1121,7 +1121,7 @@ void vvSlicer::SetColorLevel(double level) vtkLookupTable* LUT = static_cast(this->GetWindowLevel()->GetLookupTable()); if ( LUT ) { double window = this->GetWindowLevel()->GetWindow(); - LUT->SetTableRange(level-fabs(window)/4,level+fabs(window)/4); + LUT->SetTableRange(level-fabs(window)/2,level+fabs(window)/2); LUT->Build(); } this->vtkImageViewer2::SetColorLevel(level); diff --git a/vv/vvSlicerManager.cxx b/vv/vvSlicerManager.cxx index c38496e..853d4c0 100644 --- a/vv/vvSlicerManager.cxx +++ b/vv/vvSlicerManager.cxx @@ -1198,7 +1198,7 @@ void vvSlicerManager::SetColorMap(int colormap) break; } if (LUT) { - LUT->SetTableRange(level-fabs(window)/4,level+fabs(window)/4); + LUT->SetTableRange(level-fabs(window)/2,level+fabs(window)/2); LUT->Build(); } vtkWindowLevelLookupTable* fusLUT = NULL; -- 2.47.1