]> Creatis software - clitk.git/commitdiff
- update function name (with Uppercase)
authordsarrut <dsarrut>
Wed, 19 May 2010 06:08:12 +0000 (06:08 +0000)
committerdsarrut <dsarrut>
Wed, 19 May 2010 06:08:12 +0000 (06:08 +0000)
vv/vvImageContour.cxx
vv/vvImageContour.h
vv/vvROIActor.cxx
vv/vvROIActor.h
vv/vvStructureSetActor.h
vv/vvToolBinarize.cxx

index 56024c8e7942028efdfb2a3de254c5aa83f1949f..0e4e428110c4a2958e2441fee248149406ca5fb7 100644 (file)
@@ -52,15 +52,14 @@ vvImageContour::~vvImageContour()
 
 
 //------------------------------------------------------------------------------
-void vvImageContour::setSlicer(vvSlicer * slicer)
-{
-  mSlicer = slicer;
+void vvImageContour::SetSlicer(vvSlicer * slicer) {
+  mSlicer = slicer;  
   // Create an actor for each time slice
   for (unsigned int numImage = 0; numImage < mSlicer->GetImage()->GetVTKImages().size(); numImage++) {
     vtkImageClip * mClipper = vtkImageClip::New();
     vtkMarchingSquares * mSquares = vtkMarchingSquares::New();
     vtkActor * mSquaresActor = vtkActor::New();
-    createNewActor(&mSquaresActor, &mSquares, &mClipper, numImage);
+    CreateNewActor(&mSquaresActor, &mSquares, &mClipper, numImage);
     mSquaresActorList.push_back(mSquaresActor);
     mSquaresList.push_back(mSquares);
     mClipperList.push_back(mClipper);
@@ -70,8 +69,7 @@ void vvImageContour::setSlicer(vvSlicer * slicer)
 
 
 //------------------------------------------------------------------------------
-void vvImageContour::setImage(vvImage::Pointer image)
-{
+void vvImageContour::SetImage(vvImage::Pointer image) {
   for (unsigned int numImage = 0; numImage < image->GetVTKImages().size(); numImage++) {
     mClipperList[numImage]->SetInput(image->GetVTKImages()[numImage]);
   }
@@ -82,27 +80,26 @@ void vvImageContour::setImage(vvImage::Pointer image)
 
 
 //------------------------------------------------------------------------------
-void vvImageContour::setPreserveMemoryModeEnabled(bool b)
-{
+void vvImageContour::SetPreserveMemoryModeEnabled(bool b) {
   // FastCache mode work only if threshold is always the same
   if (mDisplayModeIsPreserveMemory == b) return;
   mDisplayModeIsPreserveMemory = b;
   if (!b) {
-    hideActors();
-    initializeCacheMode();
-  } else {
+    HideActors();
+    InitializeCacheMode();
+  }
+  else {
     for(unsigned int d=0; d<mListOfCachedContourActors.size(); d++)
       mListOfCachedContourActors[d].clear();
     mListOfCachedContourActors.clear();
-    showActors();
+    ShowActors();
   }
 }
 //------------------------------------------------------------------------------
 
 
 //------------------------------------------------------------------------------
-void vvImageContour::setColor(double r, double g, double b)
-{
+void vvImageContour::SetColor(double r, double g, double b) {
   for(unsigned int i=0; i<mSquaresActorList.size(); i++) {
     mSquaresActorList[i]->GetProperty()->SetColor(r,g,b);
   }
@@ -121,8 +118,7 @@ void vvImageContour::SetLineWidth(double w)
 
 
 //------------------------------------------------------------------------------
-void vvImageContour::hideActors()
-{
+void vvImageContour::HideActors() {
   if (!mSlicer) return;
   mSlice = mSlicer->GetSlice();
   for(unsigned int i=0; i<mSquaresActorList.size(); i++) {
@@ -133,22 +129,20 @@ void vvImageContour::hideActors()
 
 
 //------------------------------------------------------------------------------
-void vvImageContour::showActors()
-{
+void vvImageContour::ShowActors() {
   if (!mSlicer) return;
   mSlice = mSlicer->GetSlice();
   mTSlice = mSlicer->GetTSlice();
   //  for(unsigned int i=0; i<mSquaresActorList.size(); i++) {
   mSquaresActorList[mTSlice]->VisibilityOn();
-  update(mValue);
+  Update(mValue);
   //}
 }
 //------------------------------------------------------------------------------
 
 
 //------------------------------------------------------------------------------
-void vvImageContour::update(double value)
-{
+void vvImageContour::Update(double value) {
   //  DD(value);
   if (!mSlicer) return;
   if (mPreviousValue == value) {
@@ -167,9 +161,10 @@ void vvImageContour::update(double value)
   mSlice = mSlicer->GetSlice();
   //  DD(mDisplayModeIsPreserveMemory);
   if (mDisplayModeIsPreserveMemory) {
-    updateWithPreserveMemoryMode();
-  } else {
-    updateWithFastCacheMode();
+    UpdateWithPreserveMemoryMode();
+  }
+  else {
+    UpdateWithFastCacheMode();
   }
 
 
@@ -184,8 +179,7 @@ void vvImageContour::update(double value)
 
 
 //------------------------------------------------------------------------------
-void vvImageContour::updateWithPreserveMemoryMode()
-{
+void vvImageContour::UpdateWithPreserveMemoryMode() {
   // Only change actor visibility if tslice change
   //DD(mTSlice);
   //DD(mSlice);
@@ -201,12 +195,12 @@ void vvImageContour::updateWithPreserveMemoryMode()
   vtkMarchingSquares * mSquares = mSquaresList[mTSlice];
   vtkImageClip * mClipper = mClipperList[mTSlice];
   vtkActor * mSquaresActor = mSquaresActorList[mTSlice];
-  int orientation = computeCurrentOrientation();
+  int orientation = ComputeCurrentOrientation();
   //  DD(orientation);
   //DD(mValue);
   //DD(mSlice);
   //DD(mPreviousTslice);
-  updateActor(mSquaresActor, mSquares, mClipper, mValue, orientation, mSlice);
+  UpdateActor(mSquaresActor, mSquares, mClipper, mValue, orientation, mSlice);
   mSquaresActorList[mTSlice]->VisibilityOn();
   if (mPreviousTslice != mTSlice) {
     if (mPreviousTslice != -1) mSquaresActorList[mPreviousTslice]->VisibilityOff();
@@ -216,8 +210,7 @@ void vvImageContour::updateWithPreserveMemoryMode()
 
 
 //------------------------------------------------------------------------------
-void vvImageContour::initializeCacheMode()
-{
+void vvImageContour::InitializeCacheMode() {
   mPreviousSlice = mPreviousOrientation = 0;
   int dim = mSlicer->GetImage()->GetNumberOfDimensions();
 
@@ -235,8 +228,7 @@ void vvImageContour::initializeCacheMode()
 
 
 //------------------------------------------------------------------------------
-int vvImageContour::computeCurrentOrientation()
-{
+int vvImageContour::ComputeCurrentOrientation() {
   // Get extent of image in the slicer
   int* extent = mSlicer->GetImageActor()->GetDisplayExtent();
 
@@ -254,10 +246,9 @@ int vvImageContour::computeCurrentOrientation()
 
 
 //------------------------------------------------------------------------------
-void vvImageContour::updateWithFastCacheMode()
-{
+void vvImageContour::UpdateWithFastCacheMode() {
   // Compute orientation
-  int orientation = computeCurrentOrientation();
+  int orientation = ComputeCurrentOrientation();
 
   if ((mPreviousSlice == mSlice) && (mPreviousOrientation == orientation)) return;
 
@@ -268,8 +259,8 @@ void vvImageContour::updateWithFastCacheMode()
     vtkImageClip * mClipper;
     vtkMarchingSquares * mSquares;
     vtkActor * mSquaresActor;
-    createNewActor(&mSquaresActor, &mSquares, &mClipper, 0);
-    updateActor(mSquaresActor, mSquares, mClipper, mValue, orientation, mSlice);
+    CreateNewActor(&mSquaresActor, &mSquares, &mClipper, 0);
+    UpdateActor(mSquaresActor, mSquares, mClipper, mValue, orientation, mSlice);
     mListOfCachedContourActors[orientation][mSlice] = mSquaresActor;
     mSquaresActor->VisibilityOn();
   }
@@ -283,11 +274,10 @@ void vvImageContour::updateWithFastCacheMode()
 
 
 //------------------------------------------------------------------------------
-void vvImageContour::createNewActor(vtkActor ** actor,
-                                    vtkMarchingSquares ** squares,
-                                    vtkImageClip ** clipper,
-                                    int numImage)
-{
+void vvImageContour::CreateNewActor(vtkActor ** actor, 
+                                    vtkMarchingSquares ** squares, 
+                                    vtkImageClip ** clipper, 
+                                    int numImage) {
   vtkActor * mSquaresActor = (*actor = vtkActor::New());
   vtkImageClip * mClipper = (*clipper = vtkImageClip::New());
   vtkMarchingSquares * mSquares = (*squares = vtkMarchingSquares::New());
@@ -310,12 +300,10 @@ void vvImageContour::createNewActor(vtkActor ** actor,
 
 
 //------------------------------------------------------------------------------
-void vvImageContour::updateActor(vtkActor * actor,
-                                 vtkMarchingSquares * squares,
-                                 vtkImageClip * clipper,
-                                 double threshold, int orientation, int slice)
-{
-
+void vvImageContour::UpdateActor(vtkActor * actor, 
+                                 vtkMarchingSquares * squares, 
+                                 vtkImageClip * clipper, 
+                                 double threshold, int orientation, int slice) {
   // Set parameter for the MarchigSquare
   squares->SetValue(0, threshold);
 
@@ -351,7 +339,7 @@ void vvImageContour::updateActor(vtkActor * actor,
 
   // Move the actor to be visible
   // DD(orientation);
-//   DD(slice);
+  //   DD(slice);
 
   //TO SIMPLiFY :!!!!!!!!! == ???????
   // actor->SetPosition(-1,-1,-1);
index 747ecd89fe927f233297b86f80176a6f078cbe2c..d93a3f343b29ffbe1e0339903b935fc30984a1fd 100644 (file)
@@ -34,14 +34,14 @@ class vvImageContour
   vvImageContour();
   ~vvImageContour();
 
-  void setSlicer(vvSlicer * slicer);
-  void update(double value);
-  void hideActors();
-  void showActors();
-  void setColor(double r, double g, double b);
+  void SetSlicer(vvSlicer * slicer);
+  void Update(double value);
+  void HideActors();
+  void ShowActors();
+  void SetColor(double r, double g, double b);
   void SetLineWidth(double w);
-  void setImage(vvImage::Pointer image);
-  void setPreserveMemoryModeEnabled(bool b);
+  void SetImage(vvImage::Pointer image);
+  void SetPreserveMemoryModeEnabled(bool b);
 
  protected:
   vvSlicer * mSlicer;
@@ -65,18 +65,18 @@ class vvImageContour
   std::vector<std::vector<vtkActor*> > mListOfCachedContourActors;
 
   // Functions
-  void initializeCacheMode();
-  void updateWithPreserveMemoryMode();
-  void updateWithFastCacheMode();
-  void createNewActor(vtkActor ** actor, 
+  void InitializeCacheMode();
+  void UpdateWithPreserveMemoryMode();
+  void UpdateWithFastCacheMode();
+  void CreateNewActor(vtkActor ** actor, 
                      vtkMarchingSquares ** squares, 
                      vtkImageClip ** clipper, int numImage);
-  void updateActor(vtkActor * actor, 
+  void UpdateActor(vtkActor * actor, 
                   vtkMarchingSquares * squares,
                   vtkImageClip * clipper, 
                   double threshold, int orientation, int slice);
-  void createActor(int orientation, int slice);
-  int computeCurrentOrientation();
+  void CreateActor(int orientation, int slice);
+  int ComputeCurrentOrientation();
   
 }; // end class vvImageContour
 //------------------------------------------------------------------------------
index abf3eb6ca2e8cb4388316a5ce04bef4bc55530dc..2ffde5d62946e2e9e6de6c8bb87f4d8562a93c7b 100644 (file)
@@ -36,8 +36,11 @@ vvROIActor::vvROIActor()
   mImageContour.clear();
   mOverlayActors.clear();
   mIsVisible = true;
+  mIsContourVisible = false;
   mOpacity = 0.7;
   mIsSelected = false;
+  mContourWidth = 2;
+  mContourColor.resize(3);
 }
 //------------------------------------------------------------------------------
 
@@ -58,8 +61,14 @@ void vvROIActor::SetROI(clitk::DicomRT_ROI * s)
 
 
 //------------------------------------------------------------------------------
-void vvROIActor::SetSlicerManager(vvSlicerManager * s)
-{
+void vvROIActor::SetContourWidth(int n) {
+  mContourWidth = n;
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvROIActor::SetSlicerManager(vvSlicerManager * s) {
   mSlicerManager = s;
 }
 //------------------------------------------------------------------------------
@@ -82,30 +91,58 @@ void vvROIActor::SetVisible(bool b)
 
 
 //------------------------------------------------------------------------------
-bool vvROIActor::IsVisible()
-{
+void vvROIActor::SetContourVisible(bool b) {
+  mIsContourVisible = b;
+  if (!b) { // remove actor
+    for(unsigned int i= 0; i<mOverlayActors.size(); i++) {
+      //      mOverlayActors[i]->HideActors();
+      mImageContour[i]->HideActors();
+    }
+  }
+  else {
+    for(unsigned int i= 0; i<mOverlayActors.size(); i++) {
+      // mOverlayActors[i]->ShowActors();
+      mImageContour[i]->ShowActors();
+    }
+  }
+  Update();
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+bool vvROIActor::IsVisible() {
   return mIsVisible;
 }
 //------------------------------------------------------------------------------
 
 
 //------------------------------------------------------------------------------
-void vvROIActor::Initialize()
-{
+bool vvROIActor::IsContourVisible() {
+  return mIsContourVisible;
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvROIActor::Initialize() {
   if (mROI->GetImage()) {
     mImageContour.clear();
     mOverlayActors.clear();
     for(int i=0; i<mSlicerManager->NumberOfSlicers(); i++) {
       mImageContour.push_back(new vvImageContour);
-      mImageContour[i]->setSlicer(mSlicerManager->GetSlicer(i));
-      mImageContour[i]->setImage(mROI->GetImage());
+      mImageContour[i]->SetSlicer(mSlicerManager->GetSlicer(i));
+      mImageContour[i]->SetImage(mROI->GetImage());
       //mImageContour[i]->setColor(1.0, 0.0, 0.0);
-      mImageContour[i]->setColor(1.0-mROI->GetDisplayColor()[0],
-                                 1.0-mROI->GetDisplayColor()[1],
-                                 1.0-mROI->GetDisplayColor()[2]);
-      mImageContour[i]->setPreserveMemoryModeEnabled(true);
-      mImageContour[i]->setSlicer(mSlicerManager->GetSlicer(i));
-
+      mContourColor[0] = 1.0-mROI->GetDisplayColor()[0];
+      mContourColor[1] = 1.0-mROI->GetDisplayColor()[1];
+      mContourColor[2] = 1.0-mROI->GetDisplayColor()[2];
+      mImageContour[i]->SetColor(mContourColor[0], mContourColor[1], mContourColor[2]);
+      mImageContour[i]->SetLineWidth(mContourWidth);
+      mImageContour[i]->SetPreserveMemoryModeEnabled(true);
+      mImageContour[i]->SetSlicer(mSlicerManager->GetSlicer(i));
+      mImageContour[i]->HideActors();
+      
       mOverlayActors.push_back(new vvBinaryImageOverlayActor);
       mOverlayActors[i]->SetImage(mROI->GetImage(), mROI->GetBackgroundValueLabelImage());
       mOverlayActors[i]->SetColor(mROI->GetDisplayColor()[0],
@@ -146,13 +183,18 @@ void vvROIActor::UpdateSlice(int slicer, int slices)
     exit(0);
   }
 
-  // CONTOUR HERE
-  DD("vvROIActor::UpdateSlice");
-  DD(mROI->GetName());
-  DD(mIsSelected);
-  DD(mROI->GetBackgroundValueLabelImage());
+  // CONTOUR HERE 
+  //  DD("vvROIActor::UpdateSlice");
+  //DD(mROI->GetName());
+  //DD(mIsSelected);
+  //DD(mROI->GetBackgroundValueLabelImage());
   if (mIsSelected) {
-    mImageContour[slicer]->update(1.0);//mROI->GetBackgroundValueLabelImage());
+    mImageContour[slicer]->Update(1.0);//mROI->GetBackgroundValueLabelImage()); 
+    //    mImageContour[slicer]->showActors();
+  }
+  if (mIsContourVisible) {
+    mImageContour[slicer]->SetLineWidth(mContourWidth);
+    mImageContour[slicer]->Update(mROI->GetBackgroundValueLabelImage()+1); 
     //    mImageContour[slicer]->showActors();
   }
 
@@ -187,8 +229,23 @@ void vvROIActor::SetOpacity(double d)
 
 
 //------------------------------------------------------------------------------
-void vvROIActor::UpdateColor()
-{
+void vvROIActor::SetContourColor(double r, double v, double b) {
+  mContourColor[0] = r;
+  mContourColor[1] = v;
+  mContourColor[2] = b;  
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+std::vector<double> & vvROIActor::GetContourColor() { 
+  return mContourColor; 
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvROIActor::UpdateColor() {
   for(unsigned int i=0; i<mOverlayActors.size(); i++) {
     mOverlayActors[i]->SetOpacity(mOpacity);
     mOverlayActors[i]->SetColor(mROI->GetDisplayColor()[0],
@@ -196,6 +253,11 @@ void vvROIActor::UpdateColor()
                                 mROI->GetDisplayColor()[2]);
     mOverlayActors[i]->UpdateColor();
   }
+  for(unsigned int i=0; i<mImageContour.size(); i++) {
+    mImageContour[i]->SetLineWidth(mContourWidth);
+    mImageContour[i]->SetColor(mContourColor[0], mContourColor[1], mContourColor[2]);
+    mImageContour[i]->Update(mROI->GetBackgroundValueLabelImage()+1);
+  }
 }
 //------------------------------------------------------------------------------
 
@@ -215,11 +277,11 @@ void vvROIActor::SetSelected(bool b)
   if (b) {
     for(int i=0; i<mSlicerManager->NumberOfSlicers(); i++) {
       mImageContour[i]->SetLineWidth(3.0);
-      mImageContour[i]->showActors();
+      mImageContour[i]->ShowActors();
     }
   } else {
     for(int i=0; i<mSlicerManager->NumberOfSlicers(); i++) {
-      mImageContour[i]->hideActors();
+      mImageContour[i]->HideActors();
     }
   }
 }
index bb5c16b740c4e8f2d40e5e8b43da729593973b7d..a7cbd5c03d62d7872c8244f3e302757f73ca4895 100644 (file)
@@ -40,10 +40,16 @@ class vvROIActor: public QObject {
   void Update();
   void Initialize();
   void SetVisible(bool b);
+  void SetContourVisible(bool b);
   bool IsVisible();
+  bool IsContourVisible();
   void SetOpacity(double x);
   double GetOpacity();
   void SetSelected(bool b);
+  void SetContourWidth(int n);
+  int GetContourWidth() { return mContourWidth; }
+  void SetContourColor(double r, double v, double b);
+  std::vector<double> & GetContourColor();
 
 public slots:
   void UpdateSlice(int slicer, int slices);
@@ -56,8 +62,11 @@ public slots:
   std::vector<vvBinaryImageOverlayActor *> mOverlayActors;
   
   bool mIsVisible;
+  bool mIsContourVisible;
   double mOpacity;
   bool mIsSelected;
+  int mContourWidth;
+  std::vector<double> mContourColor;
 
 }; // end class vvROIActor
 //------------------------------------------------------------------------------
index 119169d95a7d9c4a95acfd9cf722221dc03d95af..9a6f95a082cc59e6ec03e818690adbfca4887cf6 100644 (file)
@@ -36,7 +36,9 @@ class vvStructureSetActor: public QObject {
   void SetSlicerManager(vvSlicerManager * s);
   void CreateNewROIActor(int n);
   vvROIActor* GetROIActor(int n);
-
+  int GetNumberOfROIs() { return mROIActors.size(); }
+  std::vector<vvROIActor*> & GetROIList() { return mROIActors; }
+  
  protected:
   clitk::DicomRT_StructureSet * mStructureSet;
   vvSlicerManager * mSlicerManager;
index 6821ba2b4deb88590b5ef6ed49bcdb514334e6e1..afd07b12069c6b5d01dc8a8ad985c6eaa2572d9a 100644 (file)
@@ -14,7 +14,7 @@
 
   - BSD        See included LICENSE.txt file
   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-======================================================================-====*/
+  ======================================================================-====*/
 
 #include "vvToolBinarize.h"
 #include "vvSlicerManager.h"
@@ -92,9 +92,9 @@ void vvToolBinarize::InteractiveDisplayToggled(bool b)
     RemoveVTKObjects();
   } else {
     for(unsigned int i=0; i<mImageContour.size(); i++) {
-      mImageContour[i]->showActors();
+      mImageContour[i]->ShowActors();
       if (mRadioButtonLowerThan->isChecked())
-        mImageContourLower[i]->showActors();
+        mImageContourLower[i]->ShowActors();
     }
     if (mCurrentSlicerManager)
       mCurrentSlicerManager->Render();
@@ -107,8 +107,8 @@ void vvToolBinarize::InteractiveDisplayToggled(bool b)
 void vvToolBinarize::RemoveVTKObjects()
 {
   for(unsigned int i=0; i<mImageContour.size(); i++) {
-    mImageContour[i]->hideActors();
-    mImageContourLower[i]->hideActors();
+    mImageContour[i]->HideActors();
+    mImageContourLower[i]->HideActors();    
   }
   if (mCurrentSlicerManager)
     mCurrentSlicerManager->Render();
@@ -141,14 +141,14 @@ void vvToolBinarize::enableLowerThan(bool b)
   if (!b) {
     mThresholdSlider1->resetMaximum();
     for(unsigned int i=0; i<mImageContour.size(); i++) {
-      mImageContourLower[i]->hideActors();
+      mImageContourLower[i]->HideActors();    
     }
     mCurrentSlicerManager->Render();
   } else {
     valueChangedT1(mThresholdSlider1->GetValue());
     valueChangedT2(mThresholdSlider2->GetValue());
     for(unsigned int i=0; i<mImageContour.size(); i++) {
-      mImageContourLower[i]->showActors();
+      mImageContourLower[i]->ShowActors();    
     }
     mCurrentSlicerManager->Render();
   }
@@ -182,10 +182,10 @@ void vvToolBinarize::InputIsSelected(vvSlicerManager * m)
   mFGSlider->SetImage(mCurrentImage);
   mBGSlider->SetImage(mCurrentImage);
   //  DD(mCurrentSlicerManager->GetFileName().c_str());
-//  mFGSlider->SetMaximum(mCurrentImage->GetFirstVTKImageData()->GetScalarTypeMax());
-//   mFGSlider->SetMinimum(mCurrentImage->GetFirstVTKImageData()->GetScalarTypeMin());
-//   mBGSlider->SetMaximum(mCurrentImage->GetFirstVTKImageData()->GetScalarTypeMax());
-//   mBGSlider->SetMinimum(mCurrentImage->GetFirstVTKImageData()->GetScalarTypeMin());
+  //  mFGSlider->SetMaximum(mCurrentImage->GetFirstVTKImageData()->GetScalarTypeMax());
+  //   mFGSlider->SetMinimum(mCurrentImage->GetFirstVTKImageData()->GetScalarTypeMin());
+  //   mBGSlider->SetMaximum(mCurrentImage->GetFirstVTKImageData()->GetScalarTypeMax());
+  //   mBGSlider->SetMinimum(mCurrentImage->GetFirstVTKImageData()->GetScalarTypeMin());
 
   // Output is uchar ...
   mFGSlider->SetMaximum(255);
@@ -201,11 +201,11 @@ void vvToolBinarize::InputIsSelected(vvSlicerManager * m)
   // VTK objects for interactive display
   for(int i=0; i<mCurrentSlicerManager->NumberOfSlicers(); i++) {
     mImageContour.push_back(new vvImageContour);
-    mImageContour[i]->setSlicer(mCurrentSlicerManager->GetSlicer(i));
-    mImageContour[i]->setColor(1.0, 0.0, 0.0);
+    mImageContour[i]->SetSlicer(mCurrentSlicerManager->GetSlicer(i));
+    mImageContour[i]->SetColor(1.0, 0.0, 0.0);
     mImageContourLower.push_back(new vvImageContour);
-    mImageContourLower[i]->setSlicer(mCurrentSlicerManager->GetSlicer(i));
-    mImageContourLower[i]->setColor(0.0, 0.0, 1.0);
+    mImageContourLower[i]->SetSlicer(mCurrentSlicerManager->GetSlicer(i));
+    mImageContourLower[i]->SetColor(0.0, 0.0, 1.0);
   }
   valueChangedT1(mThresholdSlider1->GetValue());
 
@@ -236,10 +236,10 @@ void vvToolBinarize::UpdateSlice(int slicer,int slices)
 {
   if (!mInteractiveDisplayIsEnabled) return;
   if (!mCurrentSlicerManager) close();
-  mImageContour[slicer]->update(mThresholdSlider1->GetValue());
-  if (mRadioButtonLowerThan->isChecked())
-    mImageContourLower[slicer]->update(mThresholdSlider2->GetValue());
-  //  mCurrentSlicerManager->GetSlicer(slicer)->Render();
+  mImageContour[slicer]->Update(mThresholdSlider1->GetValue());
+  if (mRadioButtonLowerThan->isChecked()) 
+    mImageContourLower[slicer]->Update(mThresholdSlider2->GetValue());
+  //  mCurrentSlicerManager->GetSlicer(slicer)->Render(); 
 }
 //------------------------------------------------------------------------------
 
@@ -249,14 +249,14 @@ void vvToolBinarize::GetArgsInfoFromGUI()
 {
 
   /* //KEEP THIS FOR READING GGO FROM FILE
-    int argc=1;
-    std::string a = "toto";
-    char * const* argv = new char*;
-    //a.c_str();
-    struct cmdline_parser_params p;
-    p.check_required = 0;
-    int good = cmdline_parser_ext(argc, argv, &args_info, &p);
-  DD(good);
+     int argc=1;
+     std::string a = "toto";
+     char * const* argv = new char*;
+     //a.c_str();
+     struct cmdline_parser_params p;
+     p.check_required = 0;
+     int good = cmdline_parser_ext(argc, argv, &args_info, &p);
+     DD(good);
   */
 
   mArgsInfo.imagetypes_flag = 0;
@@ -336,8 +336,8 @@ void vvToolBinarize::valueChangedT2(double v)
   if (mRadioButtonLowerThan->isChecked()) {
     mThresholdSlider1->SetMaximum(v);
     if (!mInteractiveDisplayIsEnabled) return;
-    for(int i=0; i<mCurrentSlicerManager->NumberOfSlicers(); i++) {
-      mImageContourLower[i]->update(v);
+    for(int i=0;i<mCurrentSlicerManager->NumberOfSlicers(); i++) {
+      mImageContourLower[i]->Update(v);
     }
     // mCurrentSlicerManager->Render();
   }
@@ -353,8 +353,8 @@ void vvToolBinarize::valueChangedT1(double v)
   mThresholdSlider2->SetMinimum(v);
   //  int m1 = (int)lrint(v);
   if (!mInteractiveDisplayIsEnabled) return;
-  for(int i=0; i<mCurrentSlicerManager->NumberOfSlicers(); i++) {
-    mImageContour[i]->update(v);
+  for(int i=0;i<mCurrentSlicerManager->NumberOfSlicers(); i++) {
+    mImageContour[i]->Update(v);
   }
   // mCurrentSlicerManager->Render();
 }