From 44c2ad927935149b19d2355f428252e05637d304 Mon Sep 17 00:00:00 2001 From: tbaudier Date: Fri, 27 Nov 2015 13:48:47 +0100 Subject: [PATCH] Real-time Display Debug Add SetOpacity(0.995) --- vv/CMakeLists.txt | 1 + vv/vvImageContour.cxx | 6 ++++-- vv/vvSlicer.cxx | 4 +++- vv/vvToolBinarize.cxx | 38 +++++++++++++++++++------------------- 4 files changed, 27 insertions(+), 22 deletions(-) diff --git a/vv/CMakeLists.txt b/vv/CMakeLists.txt index 11c3b1f..5b84991 100644 --- a/vv/CMakeLists.txt +++ b/vv/CMakeLists.txt @@ -22,6 +22,7 @@ set(vv_TOOLS vvToolROIManager vvToolSegmentation ## these ones are for tests (not working) + # vvToolTest # vvToolFoo # vvToolFooWithWidgetBase # vvToolPlastimatch diff --git a/vv/vvImageContour.cxx b/vv/vvImageContour.cxx index a4b2a05..c4c8c56 100644 --- a/vv/vvImageContour.cxx +++ b/vv/vvImageContour.cxx @@ -124,6 +124,7 @@ void vvImageContour::SetColor(double r, double g, double b) { //out << __func__ << endl; for(unsigned int i=0; iGetProperty()->SetColor(r,g,b); + mSquaresActorList[i]->GetProperty()->SetOpacity(0.995); } } //------------------------------------------------------------------------------ @@ -336,6 +337,7 @@ void vvImageContour::CreateNewActor(int numImage) squaresMapper->ScalarVisibilityOff(); squaresActor->SetMapper(squaresMapper); squaresActor->GetProperty()->SetColor(1.0,0,0); + squaresActor->GetProperty()->SetOpacity(0.995); squaresActor->SetPickable(0); squaresActor->VisibilityOff(); mSlicer->GetRenderer()->AddActor(squaresActor); @@ -357,7 +359,7 @@ void vvImageContour::UpdateActor(vtkActor * actor, { //out << __func__ << endl; // Set parameter for the MarchigSquare squares->SetValue(0, threshold); - + squares->Update(); // Get image extent int* extent = mSlicer->GetImageActor()->GetDisplayExtent(); @@ -406,7 +408,7 @@ void vvImageContour::UpdateActor(vtkActor * actor, // DD(mDepth); // position[orientation] = -mDepth; // actor->SetPosition(position); - + squares->Update(); mapper->Update(); } //------------------------------------------------------------------------------ diff --git a/vv/vvSlicer.cxx b/vv/vvSlicer.cxx index cfaaf5a..e070e5a 100644 --- a/vv/vvSlicer.cxx +++ b/vv/vvSlicer.cxx @@ -1593,6 +1593,7 @@ double vvSlicer::GetScalarComponentAsDouble(vtkImageData *image, double X, doubl //---------------------------------------------------------------------------- void vvSlicer::Render() { //out << __func__ << endl; + if (this->mFusion && mFusionActor->GetVisibility() && showFusionLegend) { legend->SetLookupTable(this->GetFusionMapper()->GetLookupTable()); legend->UseOpacityOn(); @@ -1748,7 +1749,8 @@ void vvSlicer::Render() } if (mLandMapper) UpdateLandmarks(); - this->GetRenderWindow()->Render(); + + this->GetRenderWindow()->Render(); } //---------------------------------------------------------------------------- diff --git a/vv/vvToolBinarize.cxx b/vv/vvToolBinarize.cxx index 9644b02..2e693d1 100644 --- a/vv/vvToolBinarize.cxx +++ b/vv/vvToolBinarize.cxx @@ -41,7 +41,7 @@ ADD_TOOL(vvToolBinarize); //------------------------------------------------------------------------------ void vvToolBinarize::Initialize() -{ cout << __func__ << endl; +{ //out << __func__ << endl; SetToolName("Binarize"); SetToolMenuName("Binarize"); SetToolIconFilename(":/common/icons/binarize.png"); @@ -55,7 +55,7 @@ vvToolBinarize::vvToolBinarize(vvMainWindowBase * parent, Qt::WindowFlags f) :vvToolWidgetBase(parent,f), vvToolBase(parent), Ui::vvToolBinarize() -{ cout << __func__ << endl; +{ //out << __func__ << endl; // GUI Initialization Ui_vvToolBinarize::setupUi(mToolWidget); mInteractiveDisplayIsEnabled = mCheckBoxInteractiveDisplay->isChecked(); @@ -83,14 +83,14 @@ vvToolBinarize::vvToolBinarize(vvMainWindowBase * parent, Qt::WindowFlags f) //------------------------------------------------------------------------------ vvToolBinarize::~vvToolBinarize() -{ cout << __func__ << endl; +{ //out << __func__ << endl; } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ void vvToolBinarize::InteractiveDisplayToggled(bool b) -{ cout << __func__ << endl; +{ //out << __func__ << endl; mInteractiveDisplayIsEnabled = b; if (!mInteractiveDisplayIsEnabled) { RemoveVTKObjects(); @@ -109,7 +109,7 @@ void vvToolBinarize::InteractiveDisplayToggled(bool b) //------------------------------------------------------------------------------ void vvToolBinarize::RemoveVTKObjects() -{ cout << __func__ << endl; +{ //out << __func__ << endl; for(unsigned int i=0; iHideActors(); mImageContourLower[i]->HideActors(); @@ -122,7 +122,7 @@ void vvToolBinarize::RemoveVTKObjects() //------------------------------------------------------------------------------ bool vvToolBinarize::close() -{ cout << __func__ << endl; +{ //out << __func__ << endl; // RemoveVTKObjects(); return vvToolWidgetBase::close(); } @@ -131,7 +131,7 @@ bool vvToolBinarize::close() //------------------------------------------------------------------------------ void vvToolBinarize::closeEvent(QCloseEvent *event) -{ cout << __func__ << endl; +{ //out << __func__ << endl; RemoveVTKObjects(); event->accept(); } @@ -140,7 +140,7 @@ void vvToolBinarize::closeEvent(QCloseEvent *event) //------------------------------------------------------------------------------ void vvToolBinarize::reject() -{ cout << __func__ << endl; +{ //out << __func__ << endl; // DD("vvToolBinarize::reject"); RemoveVTKObjects(); return vvToolWidgetBase::reject(); @@ -150,7 +150,7 @@ void vvToolBinarize::reject() //------------------------------------------------------------------------------ void vvToolBinarize::enableLowerThan(bool b) -{ cout << __func__ << endl; +{ //out << __func__ << endl; if (!b) { mThresholdSlider1->resetMaximum(); for(unsigned int i=0; iisChecked() && !mCheckBoxUseFG->isChecked()) mCheckBoxUseBG->toggle(); } @@ -184,7 +184,7 @@ void vvToolBinarize::useFGBGtoggled(bool) // DD(m.size()); // } void vvToolBinarize::InputIsSelected(vvSlicerManager * m) -{ cout << __func__ << endl; +{ //out << __func__ << endl; mCurrentSlicerManager = m; // Specific for this gui @@ -216,7 +216,7 @@ void vvToolBinarize::InputIsSelected(vvSlicerManager * m) mImageContour.push_back(vvImageContour::New()); mImageContour[i]->SetSlicer(mCurrentSlicerManager->GetSlicer(i)); mImageContour[i]->SetColor(1.0, 0.0, 0.0); - mImageContour[i]->SetDepth(100); // to be in front of (whe used with ROI tool) + mImageContour[i]->SetDepth(0); // to be in front of (whe used with ROI tool) mImageContourLower.push_back(vvImageContour::New()); mImageContourLower[i]->SetSlicer(mCurrentSlicerManager->GetSlicer(i)); mImageContourLower[i]->SetColor(0.0, 0.0, 1.0); @@ -251,21 +251,21 @@ void vvToolBinarize::InputIsSelected(vvSlicerManager * m) //------------------------------------------------------------------------------ void vvToolBinarize::UpdateOrientation(int slicer,int orientation) -{ cout << __func__ << endl; +{ //out << __func__ << endl; Update(slicer); } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ void vvToolBinarize::UpdateSlice(int slicer,int slices) -{ cout << __func__ << endl; +{ //out << __func__ << endl; Update(slicer); } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ void vvToolBinarize::Update(int slicer) -{ cout << __func__ << endl; +{ //out << __func__ << endl; if (!mInteractiveDisplayIsEnabled) return; if (!mCurrentSlicerManager) close(); mImageContour[slicer]->Update(mThresholdSlider1->GetValue()); @@ -276,7 +276,7 @@ void vvToolBinarize::Update(int slicer) //------------------------------------------------------------------------------ void vvToolBinarize::GetArgsInfoFromGUI() -{ cout << __func__ << endl; +{ //out << __func__ << endl; /* //KEEP THIS FOR READING GGO FROM FILE int argc=1; @@ -331,7 +331,7 @@ void vvToolBinarize::GetArgsInfoFromGUI() //------------------------------------------------------------------------------ void vvToolBinarize::apply() -{ cout << __func__ << endl; +{ //out << __func__ << endl; if (!mCurrentSlicerManager) close(); QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); GetArgsInfoFromGUI(); @@ -357,7 +357,7 @@ void vvToolBinarize::apply() //------------------------------------------------------------------------------ void vvToolBinarize::valueChangedT2(double v) -{ cout << __func__ << endl; +{ //out << __func__ << endl; // DD("valueChangedT2"); if (mRadioButtonLowerThan->isChecked()) { mThresholdSlider1->SetMaximum(v); @@ -373,7 +373,7 @@ void vvToolBinarize::valueChangedT2(double v) //------------------------------------------------------------------------------ void vvToolBinarize::valueChangedT1(double v) -{ cout << __func__ << endl; +{ //out << __func__ << endl; // DD("valueChangedT1"); if (!mCurrentSlicerManager) close(); mThresholdSlider2->SetMinimum(v); -- 2.47.1