X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvImageContour.cxx;h=e391bbba61a1e6ba85da0d5186270da65e022b9e;hb=c1677d6877a1649bb1fed16141bcebb48487b157;hp=e4ecfdf364f5db6354f3fc86c250707f03699d17;hpb=77f3ff915faf29514050e75cd3a40d5aee212da6;p=clitk.git diff --git a/vv/vvImageContour.cxx b/vv/vvImageContour.cxx index e4ecfdf..e391bbb 100644 --- a/vv/vvImageContour.cxx +++ b/vv/vvImageContour.cxx @@ -27,6 +27,7 @@ #include #include #include +#include //------------------------------------------------------------------------------ vvImageContour::vvImageContour() @@ -123,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); } } //------------------------------------------------------------------------------ @@ -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(); } //------------------------------------------------------------------------------