]> Creatis software - clitk.git/commitdiff
finer control over fusion transparency
authorRomulo Pinho <pinho@lyon.fnclcc.fr>
Tue, 13 Sep 2011 15:36:36 +0000 (17:36 +0200)
committerRomulo Pinho <pinho@lyon.fnclcc.fr>
Tue, 13 Sep 2011 15:36:36 +0000 (17:36 +0200)
- addition of a spin box to set the values

vv/qt_ui/vvOverlayPanel.ui
vv/vvOverlayPanel.cxx
vv/vvOverlayPanel.h
vv/vvSlicer.cxx
vv/vvSlicerManager.cxx

index eab2f23388823d0fc8e12a961cedc9d01dd2d8f8..ef00277a607422d80eada75b340040ef3b86c5ed 100644 (file)
@@ -6,7 +6,7 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>342</width>
+    <width>344</width>
     <height>480</height>
    </rect>
   </property>
@@ -405,7 +405,7 @@ p, li { white-space: pre-wrap; }
      <property name="frameShadow">
       <enum>QFrame::Raised</enum>
      </property>
-     <layout class="QGridLayout" name="fusionGridLayout">
+     <layout class="QGridLayout" name="gridLayout">
       <item row="0" column="0">
        <widget class="QLabel" name="label_5">
         <property name="maximumSize">
@@ -422,7 +422,7 @@ p, li { white-space: pre-wrap; }
         </property>
        </widget>
       </item>
-      <item row="0" column="1" colspan="2">
+      <item row="0" column="1">
        <widget class="QLabel" name="dataFusionnedLabel">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@@ -435,7 +435,7 @@ p, li { white-space: pre-wrap; }
         </property>
        </widget>
       </item>
-      <item row="1" column="0" colspan="3">
+      <item row="1" column="0" colspan="2">
        <widget class="QLabel" name="opacityLabel">
         <property name="text">
          <string>Global Opacity :</string>
@@ -455,6 +455,25 @@ p, li { white-space: pre-wrap; }
         </property>
        </widget>
       </item>
+      <item row="1" column="6">
+       <widget class="QDoubleSpinBox" name="fusionOpacitySpin">
+        <property name="decimals">
+         <number>2</number>
+        </property>
+        <property name="minimum">
+         <double>0.000000000000000</double>
+        </property>
+        <property name="maximum">
+         <double>100.000000000000000</double>
+        </property>
+        <property name="singleStep">
+         <double>1.000000000000000</double>
+        </property>
+        <property name="value">
+         <double>100.000000000000000</double>
+        </property>
+       </widget>
+      </item>
       <item row="2" column="0" colspan="3">
        <widget class="QLabel" name="thresOpacityLabel">
         <property name="toolTip">
@@ -484,6 +503,25 @@ p, li { white-space: pre-wrap; }
         </property>
        </widget>
       </item>
+      <item row="2" column="6">
+       <widget class="QDoubleSpinBox" name="fusionThresSpin">
+        <property name="decimals">
+         <number>2</number>
+        </property>
+        <property name="minimum">
+         <double>0.000000000000000</double>
+        </property>
+        <property name="maximum">
+         <double>100.000000000000000</double>
+        </property>
+        <property name="singleStep">
+         <double>1.000000000000000</double>
+        </property>
+        <property name="value">
+         <double>0.000000000000000</double>
+        </property>
+       </widget>
+      </item>
       <item row="3" column="0" colspan="2">
        <widget class="QLabel" name="label_6">
         <property name="sizePolicy">
@@ -562,7 +600,7 @@ p, li { white-space: pre-wrap; }
         </property>
        </widget>
       </item>
-      <item row="4" column="5">
+      <item row="4" column="5" colspan="2">
        <widget class="QDoubleSpinBox" name="fusionLevelSpinBox">
         <property name="decimals">
          <number>4</number>
@@ -614,7 +652,6 @@ p, li { white-space: pre-wrap; }
  </widget>
  <resources>
   <include location="../vvIcons.qrc"/>
-  <include location="vvIcons.qrc"/>
  </resources>
  <connections/>
 </ui>
index eb2eaa1c7b2d27950d27551ea8943884fb366f8d..4d2bcf246901af90bb55d2eb413646695a87a687 100644 (file)
@@ -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 = "<b>Pixel value in image 2 : </b>";
index 63bad7bc633c3461ad19d39e1b3b5f51ab2342b5..4a89a1f8f6f0f2587474ffdb1ad891aa13140649 100644 (file)
@@ -52,6 +52,7 @@ public slots:
     void setVFProperty();
     void setOverlayProperty();
     void setFusionProperty();
+    void setFusionSpinProperty();
     void VFColorChangeRequest();
 
 signals:
index 8141ccd5729d479ce39405f4266c04c0c5f00cd6..92cb2686d25cdb543f188a7112c101220c9712d2 100644 (file)
@@ -1108,7 +1108,7 @@ void vvSlicer::SetColorWindow(double window)
   vtkLookupTable* LUT = static_cast<vtkLookupTable*>(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<vtkLookupTable*>(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);
index c38496e5ab50b2389311eb4788f8f8ee428a0178..853d4c0b711bdb9f21095e621116c5f7568af673 100644 (file)
@@ -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;