]> Creatis software - clitk.git/commitdiff
New functionality: button apply windowing to all images
authorsrit <srit>
Mon, 28 Feb 2011 18:24:52 +0000 (18:24 +0000)
committersrit <srit>
Mon, 28 Feb 2011 18:24:52 +0000 (18:24 +0000)
vv/qt_ui/vvMainWindow.ui
vv/vvMainWindow.cxx
vv/vvMainWindow.h

index 089d0b1e055c85988534386bc99f606e1ec51581..c5005ddc68aec8050e654d893e10445d11d1ca93 100644 (file)
@@ -67,7 +67,7 @@
        <property name="spacing">
         <number>2</number>
        </property>
-       <item row="0" column="16">
+       <item row="0" column="17">
         <spacer>
          <property name="orientation">
           <enum>Qt::Horizontal</enum>
          </item>
         </widget>
        </item>
-       <item row="0" column="18">
+       <item row="0" column="19">
         <widget class="QPushButton" name="viewButton">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
          </property>
         </widget>
        </item>
-       <item row="0" column="17">
+       <item row="0" column="18">
         <widget class="Line" name="line_3">
          <property name="orientation">
           <enum>Qt::Vertical</enum>
          </property>
         </widget>
        </item>
+       <item row="0" column="16">
+        <widget class="QPushButton" name="applyWindowLevelToAllButton">
+         <property name="enabled">
+          <bool>true</bool>
+         </property>
+         <property name="maximumSize">
+          <size>
+           <width>24</width>
+           <height>16777215</height>
+          </size>
+         </property>
+         <property name="toolTip">
+          <string>Apply windowing to all images</string>
+         </property>
+         <property name="text">
+          <string>All</string>
+         </property>
+        </widget>
+       </item>
       </layout>
      </widget>
     </item>
index f62198883969d56e456f1d22e0a0a54d85b69d11..456e9bda79a93f4687ad29f0958d5e7a61466c4e 100644 (file)
@@ -268,6 +268,7 @@ vvMainWindow::vvMainWindow():vvMainWindowBase()
   connect(colorMapComboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(UpdateColorMap()));
   connect(presetComboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(UpdateWindowLevel()));
   connect(inverseButton,SIGNAL(clicked()),this,SLOT(SwitchWindowLevel()));
+  connect(applyWindowLevelToAllButton,SIGNAL(clicked()),this,SLOT(ApplyWindowLevelToAllImages()));
 
 
   connect(this,SIGNAL(customContextMenuRequested(QPoint)),this,SLOT(ShowContextMenu(QPoint)));
@@ -1616,6 +1617,20 @@ void vvMainWindow::SwitchWindowLevel()
 }
 //------------------------------------------------------------------------------
 
+//------------------------------------------------------------------------------
+void vvMainWindow::ApplyWindowLevelToAllImages()
+{
+  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]->SetPreset(6);
+    mSlicerManagers[i]->Render();
+  }
+}
+//------------------------------------------------------------------------------
+
 //------------------------------------------------------------------------------
 void vvMainWindow::UpdateLinkManager(std::string id, int slicer, double x, double y, double z, int temps)
 {
index c21939754107158077001f72023ccea754fc53a8..87765a96a659fb665adcd1d7eaf396438db5fc5e 100644 (file)
@@ -104,6 +104,7 @@ public slots:
   void UpdateColorMap();
   void UpdateWindowLevel();
   void SwitchWindowLevel();
+  void ApplyWindowLevelToAllImages();
   void UpdateLinkManager(std::string id, int slicer, double x, double y, double z, int temps);
   void UpdateLinkedNavigation(std::string id, vvSlicerManager *sm);
   void AddLink(QString image1,QString image2);