]> Creatis software - clitk.git/blobdiff - vv/vvImageContour.cxx
ROI Debug
[clitk.git] / vv / vvImageContour.cxx
index e4ecfdf364f5db6354f3fc86c250707f03699d17..e391bbba61a1e6ba85da0d5186270da65e022b9e 100644 (file)
@@ -27,6 +27,7 @@
 #include <vtkImageData.h>
 #include <vtkPolyDataMapper.h>
 #include <vtkProperty.h>
+#include <vtkInformation.h>
 
 //------------------------------------------------------------------------------
 vvImageContour::vvImageContour()
@@ -123,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);
   }
 }
 //------------------------------------------------------------------------------
@@ -226,12 +228,12 @@ void vvImageContour::UpdateWithPreserveMemoryMode()
   vtkActor * mSquaresActor = mSquaresActorList[mTSlice];
   int orientation = ComputeCurrentOrientation();
 
-  //UpdateActor(mSquaresActor, mapper, mSquares, mClipper, mValue, orientation, mSlice);
+  UpdateActor(mSquaresActor, mapper, mSquares, mClipper, mValue, orientation, mSlice);
 
   if (mPreviousTslice != mTSlice) {
     if (mPreviousTslice != -1) mSquaresActorList[mPreviousTslice]->VisibilityOff();
   }
-  
+
   mSlicer->Render();
 }
 //------------------------------------------------------------------------------
@@ -325,19 +327,17 @@ void vvImageContour::CreateNewActor(int numImage)
     clipper->SetInputData(mSlicer->GetImage()->GetVTKImages()[numImage]);
 #endif
   }
-clipper->Update();
 #if VTK_MAJOR_VERSION <= 5
   squares->SetInput(clipper->GetOutput());
   squaresMapper->SetInput(squares->GetOutput());
 #else
-  squares->SetInputData(clipper->GetOutput());
-  squaresMapper->SetInputData(squares->GetOutput());
+  squares->SetInputConnection(clipper->GetOutputPort(0));
+  squaresMapper->SetInputConnection(squares->GetOutputPort(0));
 #endif
-squares->Update();
-squaresMapper->Update();
   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);
@@ -359,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();
 
@@ -399,9 +399,7 @@ void vvImageContour::UpdateActor(vtkActor * actor,
   
   clipper->SetOutputWholeExtent(extent2[0],extent2[1],extent2[2],
                                 extent2[3],extent2[4],extent2[5]);
-                                clipper->Update();
-                                clipper->Print(cout);
-
+                                
   if (mHiddenImageIsUsed) delete extent2;
 
   // Move the actor to be visible
@@ -410,7 +408,6 @@ void vvImageContour::UpdateActor(vtkActor * actor,
   // DD(mDepth);
   // position[orientation] = -mDepth;
   // actor->SetPosition(position);
-  
   mapper->Update();
 }
 //------------------------------------------------------------------------------