]> Creatis software - clitk.git/commitdiff
Real-time Display Debug
authortbaudier <thomas.baudier@etu.unistra.fr>
Fri, 27 Nov 2015 12:48:47 +0000 (13:48 +0100)
committertbaudier <thomas.baudier@etu.unistra.fr>
Fri, 27 Nov 2015 12:48:47 +0000 (13:48 +0100)
Add SetOpacity(0.995)

vv/CMakeLists.txt
vv/vvImageContour.cxx
vv/vvSlicer.cxx
vv/vvToolBinarize.cxx

index 11c3b1f805cb1824426604dba1d941fc0900e771..5b849910908a215da9e0057fd69f645f3138e21a 100644 (file)
@@ -22,6 +22,7 @@ set(vv_TOOLS
   vvToolROIManager
   vvToolSegmentation
   ## these ones are for tests (not working)
+  # vvToolTest
   # vvToolFoo
   # vvToolFooWithWidgetBase
   # vvToolPlastimatch
index a4b2a0545c273554def55ddc3b1aebeb25335994..c4c8c565379558161328e9e4a75530ce8f0ac8bb 100644 (file)
@@ -124,6 +124,7 @@ void vvImageContour::SetColor(double r, double g, double b)
 { //out << __func__ << endl;
   for(unsigned int i=0; i<mSquaresActorList.size(); i++) {
     mSquaresActorList[i]->GetProperty()->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();
 }
 //------------------------------------------------------------------------------
index cfaaf5aaeaa0b0df933028de6874e10d3027e771..e070e5aac97d6136e84cae5dba86c92b2cbbcd3c 100644 (file)
@@ -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();
 }
 //----------------------------------------------------------------------------
 
index 9644b023fec4e0ad4242e3caea982248d93165c3..2e693d14c03e8c761e18c74c807bf5c5d1d8e232 100644 (file)
@@ -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<vvToolBinarize>(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; i<mImageContour.size(); i++) {
     mImageContour[i]->HideActors();
     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; i<mImageContour.size(); i++) {
@@ -171,7 +171,7 @@ void vvToolBinarize::enableLowerThan(bool b)
 
 //------------------------------------------------------------------------------
 void vvToolBinarize::useFGBGtoggled(bool)
-{ cout << __func__ << endl;
+{ //out << __func__ << endl;
   if (!mCheckBoxUseBG->isChecked() && !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);