]> Creatis software - clitk.git/commitdiff
fusion legend is now an option
authorRomulo Pinho <romulo.pinho@lyon.unicancer.fr>
Thu, 19 Apr 2012 14:19:21 +0000 (16:19 +0200)
committerRomulo Pinho <romulo.pinho@lyon.unicancer.fr>
Thu, 19 Apr 2012 14:19:21 +0000 (16:19 +0200)
vv/qt_ui/vvOverlayPanel.ui
vv/vvMainWindow.cxx
vv/vvMainWindow.h
vv/vvOverlayPanel.cxx
vv/vvOverlayPanel.h
vv/vvSlicer.cxx
vv/vvSlicer.h
vv/vvSlicerManager.cxx
vv/vvSlicerManager.h

index dfe6ede89e8a66b638fae1e95f53976492ab43fa..dd7c83ded7af10ed2fa143eb76697e3d00c8f7d1 100644 (file)
@@ -535,46 +535,14 @@ p, li { white-space: pre-wrap; }
         </property>
        </widget>
       </item>
-      <item row="3" column="2" colspan="2">
-       <widget class="QComboBox" name="fusionColorMapComboBox">
-        <property name="currentIndex">
-         <number>0</number>
-        </property>
-        <item>
-         <property name="text">
-          <string>B&amp;W</string>
-         </property>
-        </item>
-        <item>
-         <property name="text">
-          <string>Heat</string>
-         </property>
-        </item>
-        <item>
-         <property name="text">
-          <string>Cold</string>
-         </property>
-        </item>
-        <item>
-         <property name="text">
-          <string>Dosimetry</string>
-         </property>
-        </item>
-        <item>
-         <property name="text">
-          <string>Full Color Range</string>
-         </property>
-        </item>
-       </widget>
-      </item>
-      <item row="4" column="0">
+      <item row="7" column="0">
        <widget class="QLabel" name="label_7">
         <property name="text">
          <string>Window :</string>
         </property>
        </widget>
       </item>
-      <item row="4" column="1" colspan="2">
+      <item row="7" column="1" colspan="2">
        <widget class="QDoubleSpinBox" name="fusionWindowSpinBox">
         <property name="decimals">
          <number>4</number>
@@ -593,14 +561,14 @@ p, li { white-space: pre-wrap; }
         </property>
        </widget>
       </item>
-      <item row="4" column="3">
+      <item row="7" column="3">
        <widget class="QLabel" name="label_8">
         <property name="text">
          <string>Level :</string>
         </property>
        </widget>
       </item>
-      <item row="4" column="4" colspan="2">
+      <item row="7" column="4" colspan="2">
        <widget class="QDoubleSpinBox" name="fusionLevelSpinBox">
         <property name="decimals">
          <number>4</number>
@@ -619,7 +587,7 @@ p, li { white-space: pre-wrap; }
         </property>
        </widget>
       </item>
-      <item row="5" column="0" colspan="4">
+      <item row="8" column="0" colspan="4">
        <widget class="QLabel" name="valueFusionnedLabel">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@@ -632,6 +600,45 @@ p, li { white-space: pre-wrap; }
         </property>
        </widget>
       </item>
+      <item row="3" column="2">
+       <widget class="QComboBox" name="fusionColorMapComboBox">
+        <property name="currentIndex">
+         <number>0</number>
+        </property>
+        <item>
+         <property name="text">
+          <string>B&amp;W</string>
+         </property>
+        </item>
+        <item>
+         <property name="text">
+          <string>Heat</string>
+         </property>
+        </item>
+        <item>
+         <property name="text">
+          <string>Cold</string>
+         </property>
+        </item>
+        <item>
+         <property name="text">
+          <string>Dosimetry</string>
+         </property>
+        </item>
+        <item>
+         <property name="text">
+          <string>Full Color Range</string>
+         </property>
+        </item>
+       </widget>
+      </item>
+      <item row="3" column="3" colspan="3">
+       <widget class="QCheckBox" name="fusionShowLegendCheckBox">
+        <property name="text">
+         <string>Show legend</string>
+        </property>
+       </widget>
+      </item>
      </layout>
     </widget>
    </item>
index 303ab3a8b60e1ddb8dcfadfe9ecb6e5fc00b299d..c08462cd0ad6efc05236fdc9d9eefadd37d5eda0 100644 (file)
@@ -316,8 +316,8 @@ vvMainWindow::vvMainWindow():vvMainWindowBase()
   connect(overlayPanel,SIGNAL(VFPropertyUpdated(int,int,int,int,double,double,double)),this,SLOT(SetVFProperty(int,int,int,int,double,double,double)));
   connect(overlayPanel,SIGNAL(OverlayPropertyUpdated(int,int,double,double)),
           this,SLOT(SetOverlayProperty(int,int,double,double)));
-  connect(overlayPanel,SIGNAL(FusionPropertyUpdated(int,int,int,double,double)),
-          this,SLOT(SetFusionProperty(int,int,int,double,double)));
+  connect(overlayPanel,SIGNAL(FusionPropertyUpdated(int,int,int,double,double, bool)),
+          this,SLOT(SetFusionProperty(int,int,int,double,double, bool)));
   connect(landmarksPanel,SIGNAL(UpdateRenderWindows()),this,SLOT(UpdateRenderWindows()));
 
   playMode = 0;//pause
@@ -2221,7 +2221,7 @@ void vvMainWindow::SetOverlayProperty(int color, int linked, double window, doub
 //------------------------------------------------------------------------------
 
 //------------------------------------------------------------------------------
-void vvMainWindow::SetFusionProperty(int opacity, int thresOpacity, int colormap,double window, double level)
+void vvMainWindow::SetFusionProperty(int opacity, int thresOpacity, int colormap,double window, double level, bool showLegend)
 {
   int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
   if (mSlicerManagers[index]->GetSlicer(0)->GetFusion()) {
@@ -2230,6 +2230,7 @@ void vvMainWindow::SetFusionProperty(int opacity, int thresOpacity, int colormap
     mSlicerManagers[index]->SetFusionThresholdOpacity(thresOpacity);
     mSlicerManagers[index]->SetFusionWindow(window);
     mSlicerManagers[index]->SetFusionLevel(level);
+    mSlicerManagers[index]->SetFusionShowLegend(showLegend);
     mSlicerManagers[index]->SetColorMap(0);
     mSlicerManagers[index]->Render();
   }
index 1650571b26032c0766dfb7d1f7bbbb2db4aaa90a..bbdfe263719e83dd037b7c3d4b070834b3624262 100644 (file)
@@ -154,7 +154,7 @@ public slots:
 
   void SetVFProperty(int subsampling,int scale,int lut, int width, double r, double g, double b);
   void SetOverlayProperty(int color, int linked, double window, double level);
-  void SetFusionProperty(int opacity, int tresOpacity, int colormap,double window,double level);
+  void SetFusionProperty(int opacity, int tresOpacity, int colormap,double window,double level, bool showLegend);
 
   void GoToCursor();
   void PlayPause();
index 28d893991556a77eed1277aa8e4738989040428b..bbd2443a641274868b81007fc149f984d9df754c 100644 (file)
@@ -38,6 +38,8 @@ vvOverlayPanel::vvOverlayPanel(QWidget * parent):QWidget(parent)
   scaleSpinBox->setEnabled(0);
   lutCheckBox->hide();
   lutCheckBox->setEnabled(0);
+  fusionShowLegendCheckBox->setChecked(true);
+  
   connect(subSamplingSpinBox,SIGNAL(editingFinished()),this,SLOT(setVFProperty()));
   connect(scaleSpinBox,SIGNAL(editingFinished()),this,SLOT(setVFProperty()));
   connect(lutCheckBox,SIGNAL(clicked()),this,SLOT(setVFProperty()));
@@ -51,6 +53,7 @@ vvOverlayPanel::vvOverlayPanel(QWidget * parent):QWidget(parent)
   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(fusionShowLegendCheckBox,SIGNAL(stateChanged(int)),this,SLOT(setFusionProperty()));
   connect(overlayWindowSpinBox,SIGNAL(valueChanged(double)),this,SLOT(setOverlayProperty()));
   connect(overlayLevelSpinBox,SIGNAL(valueChanged(double)),this,SLOT(setOverlayProperty()));
   connect(overlayLinkCheckBox,SIGNAL(stateChanged(int)),this,SLOT(setOverlayProperty()));
@@ -227,7 +230,7 @@ void vvOverlayPanel::setFusionProperty()
   fusionThresSpin->setValue(thresOpacityHorizontalSlider->value());
 
   emit FusionPropertyUpdated(opacityHorizontalSlider->value(), thresOpacityHorizontalSlider->value(), fusionColorMapComboBox->currentIndex(),
-                             fusionWindowSpinBox->value(), fusionLevelSpinBox->value());
+                             fusionWindowSpinBox->value(), fusionLevelSpinBox->value(), fusionShowLegendCheckBox->isChecked());
 }
 
 void vvOverlayPanel::setFusionSpinProperty()
@@ -255,5 +258,7 @@ void vvOverlayPanel::VFColorChangeRequest()
   this->setVFProperty();
 }
 
+
+
 #endif /* end #define _vvOverlayPanel_CXX */
 
index 4a89a1f8f6f0f2587474ffdb1ad891aa13140649..bd9e9722771ed599d358fc70f2898fab73151ec2 100644 (file)
@@ -47,6 +47,8 @@ public:
     void getCurrentVectorInfo(int visibility, double x, double y, double z, double value);
     void getCurrentOverlayInfo(int visibility,double valueOver, double valueRef);
     void getCurrentFusionInfo(int visibility,double value);
+    
+    bool getShowLegend();
 
 public slots:
     void setVFProperty();
@@ -58,7 +60,7 @@ public slots:
 signals:
     void VFPropertyUpdated(int subsampling, int scale, int log, int width, double r, double g, double b);
     void OverlayPropertyUpdated(int color, int linked, double window, double level);
-    void FusionPropertyUpdated(int opacity, int thresOpacity, int colormap, double window, double level);
+    void FusionPropertyUpdated(int opacity, int thresOpacity, int colormap, double window, double level, bool showLegend);
 
     
 private:
index 714d3d97568743c8bd7e8313bb31249fafe24f54..cba898cc431f06e80b10fab19d2f6191130ca890 100644 (file)
@@ -130,6 +130,7 @@ vvSlicer::vvSlicer()
   legend->SetVisibility(0);
   legend->SetLabelFormat("%.1f");
   this->GetRenderer()->AddActor(legend);
+  showFusionLegend = true;
 
   this->WindowLevel->Delete();
   this->WindowLevel = vvImageMapToWLColors::New();
@@ -1241,7 +1242,7 @@ double vvSlicer::GetScalarComponentAsDouble(vtkImageData *image, double X, doubl
 //----------------------------------------------------------------------------
 void vvSlicer::Render()
 {
-  if (this->mFusion) {
+  if (this->mFusion && showFusionLegend) {
     legend->SetLookupTable(this->GetFusionMapper()->GetLookupTable());
     legend->UseOpacityOn();
     legend->SetVisibility(1);
index a5156f28bc92e4f3c08e49db2c30b74c46d44ff9..b9cc334047acbd6d74e82da91d9714ef7cbbb6cc 100644 (file)
@@ -80,6 +80,7 @@ public:
   vvImage::Pointer GetFusion() {
     return mFusion;
   }
+  void ShowFusionLegend(bool show) { showFusionLegend = show; }
 
   /**Get/Set an actor's visibility ("overlay, fusion, vf, contour...")
      Overlay index is the index of the overlay by type, eg. if there are
@@ -244,6 +245,7 @@ protected:
   int * mReducedExtent;
   int * mInitialExtent;
   bool mLinkOverlayWindowLevel;
+  bool showFusionLegend;
 
 private:
   void UpdateOrientation();
index 2373abab970f69a17df88871a0051470ebe371a9..7cce9dd77f3b0cc5a9c2529d77a94a5f1a386d75 100644 (file)
@@ -62,7 +62,8 @@ vvSlicerManager::vvSlicerManager(int numberOfSlicers)
   mFusionColorMap = 3;
   mFusionWindow = 1000;
   mFusionLevel = 1000;
-
+  mFusionShowLegend = true;
+  
   mLandmarks = NULL;
   mLinkedId.resize(0);
 
@@ -1279,6 +1280,7 @@ void vvSlicerManager::SetColorMap(int colormap)
     }
     
     if (mSlicers[i]->GetFusion()) {
+      mSlicers[i]->ShowFusionLegend(mFusionShowLegend);
       mSlicers[i]->GetFusionMapper()->SetLookupTable(fusLUT);
       mSlicers[i]->GetFusionActor()->SetOpacity(double(mFusionOpacity)/100);
     }
index aff339a42b0f846e388265369cc724fecf31ac9e..9858d69fdb23f0615c8666e8ee24e1d68e200148 100644 (file)
@@ -136,6 +136,9 @@ class vvSlicerManager : public QObject {
   void SetFusionLevel(double level) {
     mFusionLevel = level;
   }
+  void SetFusionShowLegend(int show) {
+    mFusionShowLegend = show;
+  }
 
   double GetColorWindow();
   double GetColorLevel();
@@ -245,6 +248,7 @@ protected:
   int mFusionColorMap;
   double mFusionWindow;
   double mFusionLevel;
+  bool mFusionShowLegend;
 
   int mPreset;
   vvImageReader::LoadedImageType mType;