X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvOverlayPanel.cxx;h=bc3a7d0180ffa93dcc024c5e14766fe5f3a7daa2;hb=6f9b6f5da142c3c2e7c8a2ff8d0a517b90b240d3;hp=f19e13b0cc167325b3b9b87826a91ac3a098ead9;hpb=8e55faf6d71d39430ea3c9e93a54d2f0399371d9;p=clitk.git diff --git a/vv/vvOverlayPanel.cxx b/vv/vvOverlayPanel.cxx index f19e13b..bc3a7d0 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(windowSpinBox,SIGNAL(valueChanged(double)),this,SLOT(setFusionProperty())); connect(levelSpinBox,SIGNAL(valueChanged(double)),this,SLOT(setFusionProperty())); + + disableFusionSignals = false; } void vvOverlayPanel::getCurrentImageName(QString name) @@ -167,18 +169,24 @@ void vvOverlayPanel::getFusionName(QString name) void vvOverlayPanel::getFusionProperty(int opacity, int thresOpacity, int colormap, double window, double level) { if (opacity > -1) { + //first disable signals generated by each setValue() call + disableFusionSignals = true; fusionFrame->show(); fusionFrame->setEnabled(1); + fusionColorMapComboBox->setEnabled(1); + fusionColorMapComboBox->setCurrentIndex(colormap); opacityHorizontalSlider->setEnabled(1); opacityHorizontalSlider->setValue(opacity); thresOpacityHorizontalSlider->setEnabled(1); thresOpacityHorizontalSlider->setValue(thresOpacity); - fusionColorMapComboBox->setEnabled(1); - fusionColorMapComboBox->setCurrentIndex(colormap); windowSpinBox->setEnabled(1); levelSpinBox->setEnabled(1); windowSpinBox->setValue(window); levelSpinBox->setValue(level); + + // re-enable signals and trigger slot function + disableFusionSignals = false; + setFusionProperty(); } else { fusionFrame->hide(); fusionFrame->setEnabled(0); @@ -195,6 +203,9 @@ void vvOverlayPanel::getFusionProperty(int opacity, int thresOpacity, int colorm void vvOverlayPanel::setFusionProperty() { + if (disableFusionSignals) + return; + emit FusionPropertyUpdated(opacityHorizontalSlider->value(), thresOpacityHorizontalSlider->value(), fusionColorMapComboBox->currentIndex(), windowSpinBox->value(), levelSpinBox->value()); }