]> Creatis software - clitk.git/commitdiff
allow the user to change the width of VF arrows
authorschaerer <schaerer>
Wed, 5 May 2010 09:44:23 +0000 (09:44 +0000)
committerschaerer <schaerer>
Wed, 5 May 2010 09:44:23 +0000 (09:44 +0000)
vv/qt_ui/vvOverlayPanel.ui
vv/vvMainWindow.cxx
vv/vvMainWindow.h
vv/vvOverlayPanel.cxx
vv/vvOverlayPanel.h
vv/vvSlicer.cxx
vv/vvSlicer.h

index b26dc0c8f7b536bf8f580d5b2539ac2c4da3daf2..3f48f9ad5a59bc145140c9ce7a1ea48a9cf0e256 100644 (file)
@@ -53,90 +53,132 @@ p, li { white-space: pre-wrap; }
      <property name="frameShadow">
       <enum>QFrame::Raised</enum>
      </property>
-     <layout class="QGridLayout">
-      <property name="margin">
+     <layout class="QVBoxLayout" name="verticalLayout_2">
+      <property name="spacing">
        <number>2</number>
       </property>
-      <property name="spacing">
+      <property name="margin">
        <number>2</number>
       </property>
-      <item row="0" column="0">
-       <widget class="QLabel" name="label_4">
-        <property name="maximumSize">
-         <size>
-          <width>24</width>
-          <height>24</height>
-         </size>
-        </property>
-        <property name="text">
-         <string/>
-        </property>
-        <property name="pixmap">
-         <pixmap resource="../vvIcons.qrc">:/common/icons/cursor-uparrow.png</pixmap>
-        </property>
-        <property name="scaledContents">
-         <bool>true</bool>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="1" colspan="4">
-       <widget class="QLabel" name="vectorFieldNameLabel">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-        <property name="text">
-         <string>Deformation field :</string>
-        </property>
-       </widget>
-      </item>
-      <item row="1" column="0" colspan="2">
-       <widget class="QLabel" name="label_2">
-        <property name="text">
-         <string>Subsampling : </string>
-        </property>
-       </widget>
-      </item>
-      <item row="1" column="2">
-       <widget class="QSpinBox" name="subSamplingSpinBox">
-        <property name="minimum">
-         <number>1</number>
-        </property>
-        <property name="value">
-         <number>5</number>
-        </property>
-       </widget>
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout_2">
+        <item>
+         <widget class="QLabel" name="label_4">
+          <property name="maximumSize">
+           <size>
+            <width>24</width>
+            <height>24</height>
+           </size>
+          </property>
+          <property name="text">
+           <string/>
+          </property>
+          <property name="pixmap">
+           <pixmap resource="../vvIcons.qrc">:/common/icons/cursor-uparrow.png</pixmap>
+          </property>
+          <property name="scaledContents">
+           <bool>true</bool>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLabel" name="vectorFieldNameLabel">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>Deformation field :</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
       </item>
-      <item row="1" column="3">
-       <widget class="QLabel" name="label_3">
-        <property name="text">
-         <string> Scale : </string>
-        </property>
-       </widget>
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout">
+        <item>
+         <widget class="QLabel" name="label_2">
+          <property name="text">
+           <string>&lt;b&gt;Subsampling : &lt;/b&gt;</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QSpinBox" name="subSamplingSpinBox">
+          <property name="minimum">
+           <number>1</number>
+          </property>
+          <property name="value">
+           <number>5</number>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLabel" name="label_3">
+          <property name="text">
+           <string>&lt;b&gt; Scale : &lt;/b&gt;</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QSpinBox" name="scaleSpinBox">
+          <property name="value">
+           <number>1</number>
+          </property>
+         </widget>
+        </item>
+       </layout>
       </item>
-      <item row="1" column="4">
-       <widget class="QSpinBox" name="scaleSpinBox">
-        <property name="value">
-         <number>1</number>
-        </property>
-       </widget>
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout_3">
+        <item>
+         <widget class="QLabel" name="coordinatesLabel">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>&lt;b&gt;Displacement :&lt;/b&gt;</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLabel" name="label_9">
+          <property name="text">
+           <string>&lt;b&gt;Width : &lt;/b&gt;</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QSpinBox" name="vfWidthSpinBox">
+          <property name="minimum">
+           <number>1</number>
+          </property>
+          <property name="maximum">
+           <number>10</number>
+          </property>
+          <property name="singleStep">
+           <number>1</number>
+          </property>
+          <property name="value">
+           <number>1</number>
+          </property>
+         </widget>
+        </item>
+       </layout>
       </item>
-      <item row="3" column="0" colspan="5">
-       <widget class="QLabel" name="coordinatesLabel">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
+      <item>
+       <widget class="QCheckBox" name="lutCheckBox">
         <property name="text">
-         <string>Displacement :</string>
+         <string>Use Logarithm LUT</string>
         </property>
        </widget>
       </item>
-      <item row="4" column="0" colspan="5">
+      <item>
        <widget class="QLabel" name="normLabel">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@@ -149,13 +191,6 @@ p, li { white-space: pre-wrap; }
         </property>
        </widget>
       </item>
-      <item row="2" column="0" colspan="5">
-       <widget class="QCheckBox" name="lutCheckBox">
-        <property name="text">
-         <string>Use Logarithm LUT</string>
-        </property>
-       </widget>
-      </item>
      </layout>
     </widget>
    </item>
@@ -467,6 +502,7 @@ p, li { white-space: pre-wrap; }
  <resources>
   <include location="../vvIcons.qrc"/>
   <include location="../vvIcons.qrc"/>
+  <include location="vvIcons.qrc"/>
  </resources>
  <connections/>
 </ui>
index 9d6ef03bc918f85b6a3d2d9837c4cea4cbfbef6a..ef064fad133444f39af74fe0e062a9b1538568e4 100644 (file)
@@ -285,7 +285,7 @@ vvMainWindow::vvMainWindow():vvMainWindowBase() {
 
   connect(linkPanel,SIGNAL(addLink(QString,QString)),this,SLOT(AddLink(QString,QString)));
   connect(linkPanel,SIGNAL(removeLink(QString,QString)),this,SLOT(RemoveLink(QString,QString)));
-  connect(overlayPanel,SIGNAL(VFPropertyUpdated(int,int,int)),this,SLOT(SetVFProperty(int,int,int)));
+  connect(overlayPanel,SIGNAL(VFPropertyUpdated(int,int,int,int)),this,SLOT(SetVFProperty(int,int,int,int)));
   connect(overlayPanel,SIGNAL(OverlayPropertyUpdated(int)),this,SLOT(SetOverlayProperty(int)));
   connect(overlayPanel,SIGNAL(FusionPropertyUpdated(int,int,double,double)),
           this,SLOT(SetFusionProperty(int,int,double,double)));
@@ -2210,7 +2210,7 @@ void vvMainWindow::AddField(QString file,int index)
 
 
 //------------------------------------------------------------------------------
-void vvMainWindow::SetVFProperty(int subsampling, int scale, int log) {
+void vvMainWindow::SetVFProperty(int subsampling, int scale, int log, int width) {
   int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
   if (mSlicerManagers[index]->GetSlicer(0)->GetVF())
     {
@@ -2218,6 +2218,7 @@ void vvMainWindow::SetVFProperty(int subsampling, int scale, int log) {
         {
           mSlicerManagers[index]->GetSlicer(i)->SetVFSubSampling(subsampling);
           mSlicerManagers[index]->GetSlicer(i)->SetVFScale(scale);
+          mSlicerManagers[index]->GetSlicer(i)->SetVFWidth(width);
           if (log > 0)
             mSlicerManagers[index]->GetSlicer(i)->SetVFLog(1);
           else
index dbd8dd1d5f230cbdbda9e859df00ae1ab28c3d2a..6426dfdd14c5edb2dc1aa7adc2392c70b1cb6034 100644 (file)
@@ -131,7 +131,7 @@ public slots:
   void SelectOverlayImage();
   void AddFusionImage();
 
-  void SetVFProperty(int subsampling,int scale,int lut);
+  void SetVFProperty(int subsampling,int scale,int lut, int width);
   void SetOverlayProperty(int color);
   void SetFusionProperty(int opacity,int colormap,double window,double level);
 
index a1c06acb1d45e00408ce058041e39b7b928c27f0..ab8a917de3a17cb32c2035f5248212759ca1b7d0 100644 (file)
@@ -40,6 +40,7 @@ vvOverlayPanel::vvOverlayPanel(QWidget * parent):QWidget(parent)
     connect(subSamplingSpinBox,SIGNAL(editingFinished()),this,SLOT(setVFProperty()));
     connect(scaleSpinBox,SIGNAL(editingFinished()),this,SLOT(setVFProperty()));
     connect(lutCheckBox,SIGNAL(clicked()),this,SLOT(setVFProperty()));
+    connect(vfWidthSpinBox,SIGNAL(editingFinished()),this,SLOT(setVFProperty()));
     connect(colorHorizontalSlider,SIGNAL(valueChanged(int)),this,SLOT(setOverlayProperty()));
     connect(opacityHorizontalSlider,SIGNAL(valueChanged(int)),this,SLOT(setFusionProperty()));
     connect(fusionColorMapComboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(setFusionProperty()));
@@ -94,7 +95,8 @@ void vvOverlayPanel::setVFProperty()
 {
     emit VFPropertyUpdated(subSamplingSpinBox->value(),
                            scaleSpinBox->value(),
-                           lutCheckBox->checkState());
+                           lutCheckBox->checkState(),
+                           vfWidthSpinBox->value());
 }
 
 void vvOverlayPanel::getCurrentVectorInfo(int visibility, double x,double y,double z, double value)
index 34d908ad2d934f58b66672b8e94e9abb3241d79f..2d6b6b59fc720e48a28f894bbe4b0161b3c22aea 100644 (file)
@@ -54,7 +54,7 @@ public slots:
     void setFusionProperty();
 
 signals:
-    void VFPropertyUpdated(int subsampling, int scale, int log);
+    void VFPropertyUpdated(int subsampling, int scale, int log, int width);
     void OverlayPropertyUpdated(int color);
     void FusionPropertyUpdated(int opacity, int colormap, double window, double level);
 
index b0cc72182fac99fad643da1cea6277e1e0f637a9..331c236977b12d00ad9785dd5492d6aa685d479a 100644 (file)
@@ -88,6 +88,7 @@ vvSlicer::vvSlicer()
   mSubSampling = 5;
   mScale = 1;
   mVFLog = 0;
+  mVFWidth = 1;
 
   std::string text = "F1 = sagital; F2 = coronal; F3 = axial\n";
   text += "F5 = horizontal flip; F6 = vertical flip\n\n";
@@ -443,6 +444,7 @@ void vvSlicer::SetVF(vvImage::Pointer vf)
         mVFActor = vtkActor::New();
       mVFActor->SetMapper(mVFMapper);
       mVFActor->SetPickable(0);
+      mVFActor->GetProperty()->SetLineWidth(mVFWidth);
       this->UpdateDisplayExtent();
       this->GetRenderer()->AddActor(mVFActor);
 
@@ -565,6 +567,17 @@ void vvSlicer::SetVFScale(int scale)
 }
 //------------------------------------------------------------------------------
 
+//------------------------------------------------------------------------------
+void vvSlicer::SetVFWidth(int width)
+{
+  mVFWidth = width;
+  if (mVFActor)
+    mVFActor->GetProperty()->SetLineWidth(mVFWidth);
+  UpdateDisplayExtent();
+  Render();
+}
+//------------------------------------------------------------------------------
+
 
 //------------------------------------------------------------------------------
 void vvSlicer::SetVFLog(int log)
index 3a05a16d1df13b8c6bf3ec74521cdabd0ed0e0db..ff0d2698e0d8a6700a6b8ca5b7ad0f28108580b6 100644 (file)
@@ -113,6 +113,7 @@ public:
         return mSubSampling;
     }
     void SetVFScale(int scale);
+    void SetVFWidth(int width);
     int GetVFScale() {
         return mScale;
     }
@@ -206,6 +207,7 @@ protected:
     int mSubSampling;
     int mScale;
     int mVFLog;
+    int mVFWidth;
     bool mUseReducedExtent;
     int * mReducedExtent;
     int * mInitialExtent;