X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvImageContour.cxx;h=ac43af2cc6a5467be57478aea07c69607f8b5b14;hb=7615e289788483e21028050638195e29c4e34321;hp=c4c8c565379558161328e9e4a75530ce8f0ac8bb;hpb=44c2ad927935149b19d2355f428252e05637d304;p=clitk.git diff --git a/vv/vvImageContour.cxx b/vv/vvImageContour.cxx index c4c8c56..ac43af2 100644 --- a/vv/vvImageContour.cxx +++ b/vv/vvImageContour.cxx @@ -31,7 +31,7 @@ //------------------------------------------------------------------------------ vvImageContour::vvImageContour() -{ //out << __func__ << endl; +{ mTSlice = -1; mSlice = 0; mHiddenImageIsUsed = false; @@ -46,7 +46,7 @@ vvImageContour::vvImageContour() //------------------------------------------------------------------------------ vvImageContour::~vvImageContour() -{ //out << __func__ << endl; +{ mSquaresActorList.clear(); } //------------------------------------------------------------------------------ @@ -54,7 +54,7 @@ vvImageContour::~vvImageContour() //------------------------------------------------------------------------------ void vvImageContour::RemoveActors() -{ //out << __func__ << endl; +{ for (unsigned int i = 0; i < mSquaresActorList.size(); i++) { if (mSlicer != 0) { if (mSlicer!= NULL) { @@ -72,7 +72,7 @@ void vvImageContour::RemoveActors() //------------------------------------------------------------------------------ void vvImageContour::SetSlicer(vvSlicer * slicer) -{ //out << __func__ << endl; +{ mSlicer = slicer; // Create an actor for each time slice for (unsigned int numImage = 0; numImage < mSlicer->GetImage()->GetVTKImages().size(); numImage++) { @@ -84,7 +84,7 @@ void vvImageContour::SetSlicer(vvSlicer * slicer) //------------------------------------------------------------------------------ void vvImageContour::SetImage(vvImage::Pointer image) -{ //out << __func__ << endl; +{ for (unsigned int numImage = 0; numImage < image->GetVTKImages().size(); numImage++) { #if VTK_MAJOR_VERSION <= 5 mClipperList[numImage]->SetInput(image->GetVTKImages()[numImage]); @@ -100,7 +100,7 @@ void vvImageContour::SetImage(vvImage::Pointer image) //------------------------------------------------------------------------------ void vvImageContour::SetPreserveMemoryModeEnabled(bool b) -{ //out << __func__ << endl; +{ // FastCache mode work only if threshold is always the same if (mDisplayModeIsPreserveMemory == b) return; mDisplayModeIsPreserveMemory = b; @@ -121,10 +121,10 @@ void vvImageContour::SetPreserveMemoryModeEnabled(bool b) //------------------------------------------------------------------------------ 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); + mSquaresActorList[i]->GetProperty()->SetOpacity(0.995); //in order to get VTK to turn on the alpha-blending in OpenGL } } //------------------------------------------------------------------------------ @@ -132,7 +132,7 @@ void vvImageContour::SetColor(double r, double g, double b) //------------------------------------------------------------------------------ void vvImageContour::SetLineWidth(double w) -{ //out << __func__ << endl; +{ for(unsigned int i=0; iGetProperty()->SetLineWidth(w); } @@ -142,7 +142,7 @@ void vvImageContour::SetLineWidth(double w) //------------------------------------------------------------------------------ void vvImageContour::HideActors() -{ //out << __func__ << endl; +{ if (!mSlicer) return; mSlice = mSlicer->GetSlice(); for(unsigned int i=0; iGetSlice(); mTSlice = mSlicer->GetTSlice(); @@ -166,7 +166,7 @@ void vvImageContour::ShowActors() //------------------------------------------------------------------------------ void vvImageContour::SetDepth(double d) -{ //out << __func__ << endl; +{ mDepth = d; // Move the actor to be visible double position[3] = {0, 0, 0}; @@ -180,7 +180,7 @@ void vvImageContour::SetDepth(double d) //------------------------------------------------------------------------------ void vvImageContour::Update(double value) -{ //out << __func__ << endl; +{ if (!mSlicer) return; if (mPreviousValue == value) { if (mPreviousSlice == mSlicer->GetSlice()) { @@ -217,7 +217,7 @@ void vvImageContour::Update(double value) //------------------------------------------------------------------------------ void vvImageContour::UpdateWithPreserveMemoryMode() -{ //out << __func__ << endl; +{ // Only change actor visibility if tslice change mPreviousTslice = mTSlice; mTSlice = mSlicer->GetTSlice(); @@ -234,14 +234,14 @@ void vvImageContour::UpdateWithPreserveMemoryMode() if (mPreviousTslice != -1) mSquaresActorList[mPreviousTslice]->VisibilityOff(); } - mSlicer->Render(); + //mSlicer->Render(); } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ void vvImageContour::InitializeCacheMode() -{ //out << __func__ << endl; +{ clitkExceptionMacro("TODO : not implemented yet"); mPreviousSlice = mPreviousOrientation = 0; int dim = mSlicer->GetImage()->GetNumberOfDimensions(); @@ -260,7 +260,7 @@ clitkExceptionMacro("TODO : not implemented yet"); //------------------------------------------------------------------------------ int vvImageContour::ComputeCurrentOrientation() -{ //out << __func__ << endl; +{ // Get extent of image in the slicer int* extent = mSlicer->GetImageActor()->GetDisplayExtent(); @@ -279,7 +279,7 @@ int vvImageContour::ComputeCurrentOrientation() //------------------------------------------------------------------------------ void vvImageContour::UpdateWithFastCacheMode() -{ //out << __func__ << endl; +{ clitkExceptionMacro("TODO : not implemented yet"); // Compute orientation @@ -308,7 +308,7 @@ clitkExceptionMacro("TODO : not implemented yet"); //------------------------------------------------------------------------------ void vvImageContour::CreateNewActor(int numImage) -{ //out << __func__ << endl; +{ vtkSmartPointer squaresActor = vtkSmartPointer::New(); vtkSmartPointer clipper = vtkSmartPointer::New(); vtkSmartPointer squares = vtkSmartPointer::New(); @@ -337,7 +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->GetProperty()->SetOpacity(0.995); //in order to get VTK to turn on the alpha-blending in OpenGL squaresActor->SetPickable(0); squaresActor->VisibilityOff(); mSlicer->GetRenderer()->AddActor(squaresActor); @@ -356,7 +356,7 @@ void vvImageContour::UpdateActor(vtkActor * actor, vtkMarchingSquares * squares, vtkImageClip * clipper, double threshold, int orientation, int slice) -{ //out << __func__ << endl; +{ // Set parameter for the MarchigSquare squares->SetValue(0, threshold); squares->Update(); @@ -408,7 +408,6 @@ void vvImageContour::UpdateActor(vtkActor * actor, // DD(mDepth); // position[orientation] = -mDepth; // actor->SetPosition(position); - squares->Update(); mapper->Update(); } //------------------------------------------------------------------------------