From: schaerer Date: Wed, 5 May 2010 09:44:23 +0000 (+0000) Subject: allow the user to change the width of VF arrows X-Git-Tag: v1.2.0~668 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=a2d7d0fe5356215b7de062e5bb6f40753e0bfbc6;p=clitk.git allow the user to change the width of VF arrows --- diff --git a/vv/qt_ui/vvOverlayPanel.ui b/vv/qt_ui/vvOverlayPanel.ui index b26dc0c..3f48f9a 100644 --- a/vv/qt_ui/vvOverlayPanel.ui +++ b/vv/qt_ui/vvOverlayPanel.ui @@ -53,90 +53,132 @@ p, li { white-space: pre-wrap; } QFrame::Raised - - + + 2 - + 2 - - - - - 24 - 24 - - - - - - - :/common/icons/cursor-uparrow.png - - - true - - - - - - - - 0 - 0 - - - - Deformation field : - - - - - - - Subsampling : - - - - - - - 1 - - - 5 - - + + + + + + + 24 + 24 + + + + + + + :/common/icons/cursor-uparrow.png + + + true + + + + + + + + 0 + 0 + + + + Deformation field : + + + + - - - - Scale : - - + + + + + + <b>Subsampling : </b> + + + + + + + 1 + + + 5 + + + + + + + <b> Scale : </b> + + + + + + + 1 + + + + - - - - 1 - - + + + + + + + 0 + 0 + + + + <b>Displacement :</b> + + + + + + + <b>Width : </b> + + + + + + + 1 + + + 10 + + + 1 + + + 1 + + + + - - - - - 0 - 0 - - + + - Displacement : + Use Logarithm LUT - + @@ -149,13 +191,6 @@ p, li { white-space: pre-wrap; } - - - - Use Logarithm LUT - - - @@ -467,6 +502,7 @@ p, li { white-space: pre-wrap; } + diff --git a/vv/vvMainWindow.cxx b/vv/vvMainWindow.cxx index 9d6ef03..ef064fa 100644 --- a/vv/vvMainWindow.cxx +++ b/vv/vvMainWindow.cxx @@ -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 diff --git a/vv/vvMainWindow.h b/vv/vvMainWindow.h index dbd8dd1..6426dfd 100644 --- a/vv/vvMainWindow.h +++ b/vv/vvMainWindow.h @@ -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); diff --git a/vv/vvOverlayPanel.cxx b/vv/vvOverlayPanel.cxx index a1c06ac..ab8a917 100644 --- a/vv/vvOverlayPanel.cxx +++ b/vv/vvOverlayPanel.cxx @@ -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) diff --git a/vv/vvOverlayPanel.h b/vv/vvOverlayPanel.h index 34d908a..2d6b6b5 100644 --- a/vv/vvOverlayPanel.h +++ b/vv/vvOverlayPanel.h @@ -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); diff --git a/vv/vvSlicer.cxx b/vv/vvSlicer.cxx index b0cc721..331c236 100644 --- a/vv/vvSlicer.cxx +++ b/vv/vvSlicer.cxx @@ -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) diff --git a/vv/vvSlicer.h b/vv/vvSlicer.h index 3a05a16..ff0d269 100644 --- a/vv/vvSlicer.h +++ b/vv/vvSlicer.h @@ -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;