]> Creatis software - clitk.git/commitdiff
ROI & Contour Debug Try
authortbaudier <thomas.baudier@etu.unistra.fr>
Thu, 19 Nov 2015 14:35:02 +0000 (15:35 +0100)
committertbaudier <thomas.baudier@etu.unistra.fr>
Thu, 19 Nov 2015 14:35:02 +0000 (15:35 +0100)
vv/vvBinaryImageOverlayActor.cxx
vv/vvImageContour.cxx
vv/vvROIActor.cxx
vv/vvToolBinarize.cxx

index dc953201cfba5755ed51378705455aed66cde0d7..aa5cecc7609b374925a5d7274f41aa031307ec22 100644 (file)
@@ -34,7 +34,7 @@
 
 //------------------------------------------------------------------------------
 vvBinaryImageOverlayActor::vvBinaryImageOverlayActor()
-{
+{ cout << __func__ << endl;
   mTSlice = -1;
   mSlice = 0;
   mColor.resize(3);
@@ -52,7 +52,7 @@ vvBinaryImageOverlayActor::vvBinaryImageOverlayActor()
 
 //------------------------------------------------------------------------------
 vvBinaryImageOverlayActor::~vvBinaryImageOverlayActor()
-{
+{ cout << __func__ << endl;
   mImageActorList.clear();
 }
 //------------------------------------------------------------------------------
@@ -60,7 +60,7 @@ vvBinaryImageOverlayActor::~vvBinaryImageOverlayActor()
 
 //------------------------------------------------------------------------------
 void vvBinaryImageOverlayActor::RemoveActors()
-{
+{ cout << __func__ << endl;
   for (unsigned int i = 0; i < mImageActorList.size(); i++) {
     if (mSlicer != 0) {
       if (mSlicer != NULL) {
@@ -78,7 +78,7 @@ void vvBinaryImageOverlayActor::RemoveActors()
 
 //------------------------------------------------------------------------------
 void vvBinaryImageOverlayActor::SetColor(double r, double g, double b)
-{
+{ cout << __func__ << endl;
   mColor[0] = r;
   mColor[1] = g;
   mColor[2] = b;
@@ -88,7 +88,7 @@ void vvBinaryImageOverlayActor::SetColor(double r, double g, double b)
 
 //------------------------------------------------------------------------------
 void vvBinaryImageOverlayActor::SetSlicer(vvSlicer * slicer)
-{
+{ cout << __func__ << endl;
   mSlicer = slicer;
 }
 //------------------------------------------------------------------------------
@@ -96,7 +96,7 @@ void vvBinaryImageOverlayActor::SetSlicer(vvSlicer * slicer)
 
 //------------------------------------------------------------------------------
 void vvBinaryImageOverlayActor::Initialize(bool IsVisible)
-{
+{ cout << __func__ << endl;
   if (!mSlicer) {
     std::cerr << "ERROR. Please use setSlicer before setSlicer in vvBinaryImageOverlayActor." << std::endl;
     exit(0);
@@ -163,7 +163,7 @@ void vvBinaryImageOverlayActor::Initialize(bool IsVisible)
 
 //------------------------------------------------------------------------------
 void vvBinaryImageOverlayActor::SetOpacity(double d)
-{
+{ cout << __func__ << endl;
   mAlpha = d;
 }
 //------------------------------------------------------------------------------
@@ -205,7 +205,7 @@ void vvBinaryImageOverlayActor::SetOpacity(double d)
 
 //------------------------------------------------------------------------------
 void vvBinaryImageOverlayActor::SetImage(vvImage::Pointer image, double bg, bool modeBG)
-{
+{ cout << __func__ << endl;
   mImage = image;
   if (modeBG) {
     mBackgroundValue = bg;
@@ -221,7 +221,7 @@ void vvBinaryImageOverlayActor::SetImage(vvImage::Pointer image, double bg, bool
 
 //------------------------------------------------------------------------------
 void vvBinaryImageOverlayActor::HideActors()
-{
+{ cout << __func__ << endl;
   if (!mSlicer) return;
   mSlice = mSlicer->GetSlice();
   for(unsigned int i=0; i<mImageActorList.size(); i++) {
@@ -235,7 +235,7 @@ void vvBinaryImageOverlayActor::HideActors()
 
 //------------------------------------------------------------------------------
 void vvBinaryImageOverlayActor::ShowActors()
-{
+{ cout << __func__ << endl;
   if (!mSlicer) return;
   mSlice = mSlicer->GetSlice();
   mTSlice = mSlicer->GetTSlice();
@@ -251,7 +251,7 @@ void vvBinaryImageOverlayActor::ShowActors()
 
 //------------------------------------------------------------------------------
 void vvBinaryImageOverlayActor::UpdateColor()
-{
+{ cout << __func__ << endl;
   mColorLUT->SetTableValue(1, mColor[0], mColor[1], mColor[2], mAlpha); // FG
   for (unsigned int numImage = 0; numImage < mSlicer->GetImage()->GetVTKImages().size(); numImage++) {
     // how many intensity ?
@@ -270,7 +270,7 @@ void vvBinaryImageOverlayActor::UpdateColor()
 
 //------------------------------------------------------------------------------
 void vvBinaryImageOverlayActor::UpdateSlice(int slicer, int slice, bool force)
-{
+{ cout << __func__ << endl;
   if (!mSlicer) return;
 
   if (!force) {
@@ -296,6 +296,7 @@ void vvBinaryImageOverlayActor::UpdateSlice(int slicer, int slice, bool force)
 #else
   mSlicer->ClipDisplayedExtent(maskExtent, mMapperList[mTSlice]->GetInput()->GetInformation()->Get(vtkDataObject::DATA_EXTENT()));
 #endif
+mSlicer->Print(cout);
   SetDisplayExtentAndCameraPosition(orientation, mSlice, maskExtent, mImageActorList[mTSlice], mDepth);
 
   // set previous slice
@@ -310,7 +311,7 @@ void vvBinaryImageOverlayActor::ComputeExtent(int orientation,
                                              int slice,
                                              int * inExtent,
                                              int * outExtent)
-{
+{ cout << __func__ << endl;
   switch (orientation) {
   case vtkImageViewer2::SLICE_ORIENTATION_XY:
     for(int i=0; i<4; i++) outExtent[i] = inExtent[i];
@@ -332,7 +333,7 @@ void vvBinaryImageOverlayActor::ComputeExtent(int orientation,
 
 //----------------------------------------------------------------------------
 void vvBinaryImageOverlayActor::ComputeExtent(int * inExtent, int * outExtent, vtkImageData * image, vtkImageData * overlay)
-{
+{ cout << __func__ << endl;
   for(int i=0; i<3; i++) {
     double a = (image->GetOrigin()[i] + inExtent[i*2]*image->GetSpacing()[i] - 
                 overlay->GetOrigin()[i]) / overlay->GetSpacing()[i];
@@ -360,7 +361,7 @@ void vvBinaryImageOverlayActor::SetDisplayExtentAndCameraPosition(int orientatio
                                                                  int * extent,
                                                                  vtkImageActor * actor,
                                                                  double position)
-{
+{ cout << __func__ << endl;
   /* FIXME
      Error according to camera orientation
    */
index 8fb22ae4d000428bd0fb50317b2843fa22372c80..e4ecfdf364f5db6354f3fc86c250707f03699d17 100644 (file)
@@ -30,7 +30,7 @@
 
 //------------------------------------------------------------------------------
 vvImageContour::vvImageContour()
-{
+{ //out << __func__ << endl;
   mTSlice = -1;
   mSlice = 0;
   mHiddenImageIsUsed = false;
@@ -45,7 +45,7 @@ vvImageContour::vvImageContour()
 
 //------------------------------------------------------------------------------
 vvImageContour::~vvImageContour()
-{
+{ //out << __func__ << endl;
   mSquaresActorList.clear();
 }
 //------------------------------------------------------------------------------
@@ -53,7 +53,7 @@ vvImageContour::~vvImageContour()
 
 //------------------------------------------------------------------------------
 void vvImageContour::RemoveActors()
-{
+{ //out << __func__ << endl;
   for (unsigned int i = 0; i < mSquaresActorList.size(); i++) {
     if (mSlicer != 0) {
       if (mSlicer!= NULL) {
@@ -70,7 +70,8 @@ void vvImageContour::RemoveActors()
 
 
 //------------------------------------------------------------------------------
-void vvImageContour::SetSlicer(vvSlicer * slicer) {
+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++) {
@@ -81,7 +82,8 @@ void vvImageContour::SetSlicer(vvSlicer * slicer) {
 
 
 //------------------------------------------------------------------------------
-void vvImageContour::SetImage(vvImage::Pointer image) {
+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]);
@@ -96,7 +98,8 @@ void vvImageContour::SetImage(vvImage::Pointer image) {
 
 
 //------------------------------------------------------------------------------
-void vvImageContour::SetPreserveMemoryModeEnabled(bool b) {
+void vvImageContour::SetPreserveMemoryModeEnabled(bool b) 
+{ //out << __func__ << endl;
   // FastCache mode work only if threshold is always the same
   if (mDisplayModeIsPreserveMemory == b) return;
   mDisplayModeIsPreserveMemory = b;
@@ -116,7 +119,8 @@ void vvImageContour::SetPreserveMemoryModeEnabled(bool b) {
 
 
 //------------------------------------------------------------------------------
-void vvImageContour::SetColor(double r, double g, double b) {
+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);
   }
@@ -126,7 +130,7 @@ void vvImageContour::SetColor(double r, double g, double b) {
 
 //------------------------------------------------------------------------------
 void vvImageContour::SetLineWidth(double w)
-{
+{ //out << __func__ << endl;
   for(unsigned int i=0; i<mSquaresActorList.size(); i++) {
     mSquaresActorList[i]->GetProperty()->SetLineWidth(w);
   }
@@ -135,7 +139,8 @@ void vvImageContour::SetLineWidth(double w)
 
 
 //------------------------------------------------------------------------------
-void vvImageContour::HideActors() {
+void vvImageContour::HideActors() 
+{ //out << __func__ << endl;
   if (!mSlicer) return;
   mSlice = mSlicer->GetSlice();
   for(unsigned int i=0; i<mSquaresActorList.size(); i++) {
@@ -146,7 +151,8 @@ void vvImageContour::HideActors() {
 
 
 //------------------------------------------------------------------------------
-void vvImageContour::ShowActors() {
+void vvImageContour::ShowActors() 
+{ //out << __func__ << endl;
   if (!mSlicer) return;
   mSlice = mSlicer->GetSlice();
   mTSlice = mSlicer->GetTSlice();
@@ -158,7 +164,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};
@@ -171,7 +177,8 @@ void vvImageContour::SetDepth(double d)
 //------------------------------------------------------------------------------
 
 //------------------------------------------------------------------------------
-void vvImageContour::Update(double value) {
+void vvImageContour::Update(double value) 
+{ //out << __func__ << endl;
   if (!mSlicer) return;
   if (mPreviousValue == value) {
     if (mPreviousSlice == mSlicer->GetSlice()) {
@@ -207,7 +214,8 @@ void vvImageContour::Update(double value) {
 
 
 //------------------------------------------------------------------------------
-void vvImageContour::UpdateWithPreserveMemoryMode() {
+void vvImageContour::UpdateWithPreserveMemoryMode() 
+{ //out << __func__ << endl;
   // Only change actor visibility if tslice change
   mPreviousTslice = mTSlice;
   mTSlice = mSlicer->GetTSlice();
@@ -218,7 +226,7 @@ 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();
@@ -230,7 +238,8 @@ void vvImageContour::UpdateWithPreserveMemoryMode() {
 
 
 //------------------------------------------------------------------------------
-void vvImageContour::InitializeCacheMode() {
+void vvImageContour::InitializeCacheMode() 
+{ //out << __func__ << endl;
 clitkExceptionMacro("TODO : not implemented yet");
   mPreviousSlice = mPreviousOrientation = 0;
   int dim = mSlicer->GetImage()->GetNumberOfDimensions();
@@ -248,7 +257,8 @@ clitkExceptionMacro("TODO : not implemented yet");
 
 
 //------------------------------------------------------------------------------
-int vvImageContour::ComputeCurrentOrientation() {
+int vvImageContour::ComputeCurrentOrientation() 
+{ //out << __func__ << endl;
   // Get extent of image in the slicer
   int* extent = mSlicer->GetImageActor()->GetDisplayExtent();
 
@@ -266,7 +276,8 @@ int vvImageContour::ComputeCurrentOrientation() {
 
 
 //------------------------------------------------------------------------------
-void vvImageContour::UpdateWithFastCacheMode() {
+void vvImageContour::UpdateWithFastCacheMode() 
+{ //out << __func__ << endl;
 clitkExceptionMacro("TODO : not implemented yet");
 
   // Compute orientation
@@ -294,7 +305,8 @@ clitkExceptionMacro("TODO : not implemented yet");
 
 
 //------------------------------------------------------------------------------
-void vvImageContour::CreateNewActor(int numImage) {
+void vvImageContour::CreateNewActor(int numImage) 
+{ //out << __func__ << endl;
   vtkSmartPointer<vtkActor> squaresActor = vtkSmartPointer<vtkActor>::New();
   vtkSmartPointer<vtkImageClip> clipper = vtkSmartPointer<vtkImageClip>::New();
   vtkSmartPointer<vtkMarchingSquares> squares = vtkSmartPointer<vtkMarchingSquares>::New();
@@ -313,7 +325,7 @@ 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());
@@ -321,6 +333,8 @@ void vvImageContour::CreateNewActor(int numImage) {
   squares->SetInputData(clipper->GetOutput());
   squaresMapper->SetInputData(squares->GetOutput());
 #endif
+squares->Update();
+squaresMapper->Update();
   squaresMapper->ScalarVisibilityOff();
   squaresActor->SetMapper(squaresMapper);
   squaresActor->GetProperty()->SetColor(1.0,0,0);
@@ -341,10 +355,11 @@ void vvImageContour::UpdateActor(vtkActor * actor,
                                  vtkPolyDataMapper * mapper, 
                                  vtkMarchingSquares * squares, 
                                  vtkImageClip * clipper, 
-                                 double threshold, int orientation, int slice) {
+                                 double threshold, int orientation, int slice) 
+{ //out << __func__ << endl;
   // Set parameter for the MarchigSquare
   squares->SetValue(0, threshold);
-
+  
   // Get image extent
   int* extent = mSlicer->GetImageActor()->GetDisplayExtent();
 
@@ -381,9 +396,11 @@ void vvImageContour::UpdateActor(vtkActor * actor,
     extent2 = extent;
     actor->VisibilityOn();
   }
+  
   clipper->SetOutputWholeExtent(extent2[0],extent2[1],extent2[2],
                                 extent2[3],extent2[4],extent2[5]);
+                                clipper->Update();
+                                clipper->Print(cout);
 
   if (mHiddenImageIsUsed) delete extent2;
 
index 74d588328865cdfa27ca192a0d44daf5cdcb7a3d..26f13f479df91a6a09fc478019b84d8a409fc71e 100644 (file)
@@ -32,7 +32,7 @@
 
 //------------------------------------------------------------------------------
 vvROIActor::vvROIActor()
-{
+{ //out << __func__ << endl;
   mIsVisible = true;
   mIsContourVisible = false;
   mOpacity = 0.5;
@@ -52,14 +52,14 @@ vvROIActor::vvROIActor()
 
 //------------------------------------------------------------------------------
 vvROIActor::~vvROIActor()
-{
+{ //out << __func__ << endl;
 }
 //------------------------------------------------------------------------------
 
 
 //------------------------------------------------------------------------------
 void vvROIActor::RemoveActors()
-{
+{ //out << __func__ << endl;
   for(unsigned int i= 0; i<mOverlayActors.size(); i++) {
     mOverlayActors[i]->RemoveActors();
   }
@@ -77,21 +77,23 @@ void vvROIActor::RemoveActors()
 
 //------------------------------------------------------------------------------
 void vvROIActor::SetROI(clitk::DicomRT_ROI * s)
-{
+{ //out << __func__ << endl;
   mROI = s;
 }
 //------------------------------------------------------------------------------
 
 
 //------------------------------------------------------------------------------
-void vvROIActor::SetContourWidth(int n) {
+void vvROIActor::SetContourWidth(int n) 
+{ //out << __func__ << endl;
   mContourWidth = n;
 }
 //------------------------------------------------------------------------------
 
 
 //------------------------------------------------------------------------------
-void vvROIActor::SetSlicerManager(vvSlicerManager * s) {
+void vvROIActor::SetSlicerManager(vvSlicerManager * s) 
+{ //out << __func__ << endl;
   mSlicerManager = s;
 }
 //------------------------------------------------------------------------------
@@ -99,7 +101,7 @@ void vvROIActor::SetSlicerManager(vvSlicerManager * s) {
 
 //------------------------------------------------------------------------------
 void vvROIActor::UpdateImage()
-{
+{ //out << __func__ << endl;
   mOverlayActors.clear();
   mImageContour.clear();
   Initialize(mDepth, mIsVisible);
@@ -110,7 +112,7 @@ void vvROIActor::UpdateImage()
 
 //------------------------------------------------------------------------------
 void vvROIActor::SetVisible(bool b)
-{
+{ //out << __func__ << endl;
   mIsVisible = b;
   if (!b) { // remove actor
     for(unsigned int i= 0; i<mOverlayActors.size(); i++)
@@ -125,7 +127,8 @@ void vvROIActor::SetVisible(bool b)
 
 
 //------------------------------------------------------------------------------
-void vvROIActor::SetContourVisible(bool b) {
+void vvROIActor::SetContourVisible(bool b) 
+{ //out << __func__ << endl;
   mIsContourVisible = b;
   if (!b) { // remove actor
     for(unsigned int i= 0; i<mImageContour.size(); i++) {
@@ -143,21 +146,24 @@ void vvROIActor::SetContourVisible(bool b) {
 
 
 //------------------------------------------------------------------------------
-bool vvROIActor::IsVisible() {
+bool vvROIActor::IsVisible() 
+{ //out << __func__ << endl;
   return mIsVisible;
 }
 //------------------------------------------------------------------------------
 
 
 //------------------------------------------------------------------------------
-bool vvROIActor::IsContourVisible() {
+bool vvROIActor::IsContourVisible() 
+{ //out << __func__ << endl;
   return mIsContourVisible;
 }
 //------------------------------------------------------------------------------
 
 
 //------------------------------------------------------------------------------
-void vvROIActor::Initialize(double depth, bool IsVisible) {
+void vvROIActor::Initialize(double depth, bool IsVisible) 
+{ //out << __func__ << endl;
   if (mROI->GetImage()) {
     mImageContour.clear();
     mOverlayActors.clear();
@@ -174,7 +180,7 @@ void vvROIActor::Initialize(double depth, bool IsVisible) {
       mImageContour[i]->SetLineWidth(mContourWidth);
       mImageContour[i]->SetPreserveMemoryModeEnabled(true);
       mImageContour[i]->SetDepth(mDepth+0.5);
-      mImageContour[i]->HideActors();
+      mImageContour[i]->ShowActors();
       
       mOverlayActors.push_back(vvBinaryImageOverlayActor::New());
 
@@ -195,7 +201,6 @@ void vvROIActor::Initialize(double depth, bool IsVisible) {
       mOverlayActors[i]->Initialize(IsVisible);      
       mOverlayActors[i]->SetDepth(mDepth);
     }
-
     connect(mSlicerManager,SIGNAL(UpdateSlice(int,int)),this,SLOT(UpdateSlice(int, int)));
     //connect(mSlicerManager,SIGNAL(UpdateTSlice(int,int)),this,SLOT(UpdateSlice(int, int)));
     connect(mSlicerManager, SIGNAL(AVerticalSliderHasChanged(int, int)), SLOT(UpdateSlice(int, int)));
@@ -206,7 +211,7 @@ void vvROIActor::Initialize(double depth, bool IsVisible) {
 
 //------------------------------------------------------------------------------
 void vvROIActor::SetDepth(double d)
-{
+{ //out << __func__ << endl;
   mDepth = d;
   if (!mSlicerManager) return;
   for(int i=0; i<mSlicerManager->GetNumberOfSlicers(); i++) {  
@@ -220,7 +225,7 @@ void vvROIActor::SetDepth(double d)
 
 //------------------------------------------------------------------------------
 void vvROIActor::Update(bool force)
-{
+{ //out << __func__ << endl;
   if (!mSlicerManager) return;
   for(int i=0; i<mSlicerManager->GetNumberOfSlicers(); i++) {
     UpdateSlice(i, mSlicerManager->GetSlicer(i)->GetSlice(), force);
@@ -231,7 +236,7 @@ void vvROIActor::Update(bool force)
 
 //------------------------------------------------------------------------------
 void vvROIActor::UpdateSlice(int slicer, int slices, bool force)
-{
+{ //out << __func__ << endl;
   if (!mROI->GetImage())  return;
   if ((!mIsVisible) && (!mIsContourVisible)) return; 
   if (!mSlicerManager) {
@@ -251,14 +256,15 @@ void vvROIActor::UpdateSlice(int slicer, int slices, bool force)
 
 //------------------------------------------------------------------------------
 void vvROIActor::SetOpacity(double d)
-{
+{ //out << __func__ << endl;
   mOpacity = d;
 }
 //------------------------------------------------------------------------------
 
 
 //------------------------------------------------------------------------------
-void vvROIActor::SetContourColor(double r, double v, double b) {
+void vvROIActor::SetContourColor(double r, double v, double b) 
+{ //out << __func__ << endl;
   mContourColor[0] = r;
   mContourColor[1] = v;
   mContourColor[2] = b;  
@@ -267,7 +273,8 @@ void vvROIActor::SetContourColor(double r, double v, double b) {
 
 
 //------------------------------------------------------------------------------
-void vvROIActor::SetOverlayColor(double r, double v, double b) {
+void vvROIActor::SetOverlayColor(double r, double v, double b) 
+{ //out << __func__ << endl;
   if (mROI)
     mROI->SetDisplayColor(r,v,b);
 }
@@ -275,21 +282,24 @@ void vvROIActor::SetOverlayColor(double r, double v, double b) {
 
 
 //------------------------------------------------------------------------------
-std::vector<double> & vvROIActor::GetContourColor() { 
+std::vector<double> & vvROIActor::GetContourColor() 
+{ //out << __func__ << endl;
   return mContourColor; 
 }
 //------------------------------------------------------------------------------
 
 
 //------------------------------------------------------------------------------
-std::vector<double> & vvROIActor::GetOverlayColor() { 
+std::vector<double> & vvROIActor::GetOverlayColor() 
+{ //out << __func__ << endl;
   return mROI->GetDisplayColor();
 }
 //------------------------------------------------------------------------------
 
 
 //------------------------------------------------------------------------------
-void vvROIActor::UpdateColor() {
+void vvROIActor::UpdateColor() 
+{ //out << __func__ << endl;
   for(unsigned int i=0; i<mOverlayActors.size(); i++) {
     mOverlayActors[i]->SetOpacity(mOpacity);
     mOverlayActors[i]->SetColor(mROI->GetDisplayColor()[0],
@@ -309,7 +319,7 @@ void vvROIActor::UpdateColor() {
 
 //------------------------------------------------------------------------------
 double vvROIActor::GetOpacity()
-{
+{ //out << __func__ << endl;
   return mOpacity;
 }
 //------------------------------------------------------------------------------
@@ -317,7 +327,7 @@ double vvROIActor::GetOpacity()
 
 //------------------------------------------------------------------------------
 void vvROIActor::SetSelected(bool b)
-{
+{ //out << __func__ << endl;
   mIsSelected = b;
   if (b) {
     for(int i=0; i<mSlicerManager->GetNumberOfSlicers(); i++) {
@@ -335,7 +345,7 @@ void vvROIActor::SetSelected(bool b)
 
 //------------------------------------------------------------------------------
 void vvROIActor::CopyParameters(QSharedPointer<vvROIActor> roi)
-{
+{ //out << __func__ << endl;
   // Overlay
   SetVisible(roi->IsVisible());
   SetOpacity(roi->GetOpacity());
index 9859d01adcc101812cd644e4e15b966fbc657f9c..6cb75184c5c1f01cd622b983a1c78e6dde3caad8 100644 (file)
@@ -40,7 +40,7 @@ ADD_TOOL(vvToolBinarize);
 
 //------------------------------------------------------------------------------
 void vvToolBinarize::Initialize()
-{
+{ cout << __func__ << endl;
   SetToolName("Binarize");
   SetToolMenuName("Binarize");
   SetToolIconFilename(":/common/icons/binarize.png");
@@ -54,7 +54,7 @@ vvToolBinarize::vvToolBinarize(vvMainWindowBase * parent, Qt::WindowFlags f)
   :vvToolWidgetBase(parent,f),
    vvToolBase<vvToolBinarize>(parent),
    Ui::vvToolBinarize()
-{
+{ cout << __func__ << endl;
   // GUI Initialization
   Ui_vvToolBinarize::setupUi(mToolWidget);
   mInteractiveDisplayIsEnabled = mCheckBoxInteractiveDisplay->isChecked();
@@ -82,20 +82,21 @@ vvToolBinarize::vvToolBinarize(vvMainWindowBase * parent, Qt::WindowFlags f)
 
 //------------------------------------------------------------------------------
 vvToolBinarize::~vvToolBinarize()
-{
+{ cout << __func__ << endl;
 }
 //------------------------------------------------------------------------------
 
 
 //------------------------------------------------------------------------------
 void vvToolBinarize::InteractiveDisplayToggled(bool b)
-{
+{ cout << __func__ << endl;
   mInteractiveDisplayIsEnabled = b;
   if (!mInteractiveDisplayIsEnabled) {
     RemoveVTKObjects();
   } else {
     for(unsigned int i=0; i<mImageContour.size(); i++) {
       mImageContour[i]->ShowActors();
+      mImageContour[i]->Print(cout);
       if (mRadioButtonLowerThan->isChecked())
         mImageContourLower[i]->ShowActors();
     }
@@ -108,7 +109,7 @@ void vvToolBinarize::InteractiveDisplayToggled(bool b)
 
 //------------------------------------------------------------------------------
 void vvToolBinarize::RemoveVTKObjects()
-{
+{ cout << __func__ << endl;
   for(unsigned int i=0; i<mImageContour.size(); i++) {
     mImageContour[i]->HideActors();
     mImageContourLower[i]->HideActors();    
@@ -121,7 +122,7 @@ void vvToolBinarize::RemoveVTKObjects()
 
 //------------------------------------------------------------------------------
 bool vvToolBinarize::close()
-{
+{ cout << __func__ << endl;
   // RemoveVTKObjects();
   return vvToolWidgetBase::close();
 }
@@ -129,7 +130,8 @@ bool vvToolBinarize::close()
 
 
 //------------------------------------------------------------------------------
-void vvToolBinarize::closeEvent(QCloseEvent *event) {
+void vvToolBinarize::closeEvent(QCloseEvent *event)
+{ cout << __func__ << endl;
   RemoveVTKObjects();
   event->accept();
 }
@@ -138,7 +140,7 @@ void vvToolBinarize::closeEvent(QCloseEvent *event) {
 
 //------------------------------------------------------------------------------
 void vvToolBinarize::reject()
-{
+{ cout << __func__ << endl;
   // DD("vvToolBinarize::reject");
   RemoveVTKObjects();
   return vvToolWidgetBase::reject();
@@ -148,7 +150,7 @@ void vvToolBinarize::reject()
 
 //------------------------------------------------------------------------------
 void vvToolBinarize::enableLowerThan(bool b)
-{
+{ cout << __func__ << endl;
   if (!b) {
     mThresholdSlider1->resetMaximum();
     for(unsigned int i=0; i<mImageContour.size(); i++) {
@@ -169,7 +171,7 @@ void vvToolBinarize::enableLowerThan(bool b)
 
 //------------------------------------------------------------------------------
 void vvToolBinarize::useFGBGtoggled(bool)
-{
+{ cout << __func__ << endl;
   if (!mCheckBoxUseBG->isChecked() && !mCheckBoxUseFG->isChecked())
     mCheckBoxUseBG->toggle();
 }
@@ -182,7 +184,7 @@ void vvToolBinarize::useFGBGtoggled(bool)
 //   DD(m.size());
 // }
 void vvToolBinarize::InputIsSelected(vvSlicerManager * m)
-{
+{ cout << __func__ << endl;
   mCurrentSlicerManager = m;
 
   // Specific for this gui
@@ -219,6 +221,7 @@ void vvToolBinarize::InputIsSelected(vvSlicerManager * m)
     mImageContourLower[i]->SetSlicer(mCurrentSlicerManager->GetSlicer(i));
     mImageContourLower[i]->SetColor(0.0, 0.0, 1.0);
     mImageContourLower[i]->SetDepth(100); // to be in front of (whe used with ROI tool)
+    mImageContour[i]->Print(cout);
   }
   valueChangedT1(mThresholdSlider1->GetValue());
 
@@ -231,7 +234,7 @@ void vvToolBinarize::InputIsSelected(vvSlicerManager * m)
   connect(mCurrentSlicerManager,SIGNAL(UpdateOrientation(int,int)),this,SLOT(UpdateOrientation(int, int)));
 
   //  connect(mCurrentSlicerManager, SIGNAL(LeftButtonReleaseSignal(int)), SLOT(LeftButtonReleaseEvent(int)));
-  
+  cout << mInteractiveDisplayIsEnabled << endl;
   InteractiveDisplayToggled(mInteractiveDisplayIsEnabled);
 }
 //------------------------------------------------------------------------------
@@ -250,21 +253,21 @@ void vvToolBinarize::InputIsSelected(vvSlicerManager * m)
 
 //------------------------------------------------------------------------------
 void vvToolBinarize::UpdateOrientation(int slicer,int orientation)
-{
+{ cout << __func__ << endl;
   Update(slicer);
 }
 //------------------------------------------------------------------------------
 
 //------------------------------------------------------------------------------
 void vvToolBinarize::UpdateSlice(int slicer,int slices)
-{
+{ cout << __func__ << endl;
   Update(slicer);
 }
 //------------------------------------------------------------------------------
 
 //------------------------------------------------------------------------------
 void vvToolBinarize::Update(int slicer)
-{
+{ cout << __func__ << endl;
   if (!mInteractiveDisplayIsEnabled) return;
   if (!mCurrentSlicerManager) close();
   mImageContour[slicer]->Update(mThresholdSlider1->GetValue());
@@ -275,7 +278,7 @@ void vvToolBinarize::Update(int slicer)
 
 //------------------------------------------------------------------------------
 void vvToolBinarize::GetArgsInfoFromGUI()
-{
+{ cout << __func__ << endl;
 
   /* //KEEP THIS FOR READING GGO FROM FILE
      int argc=1;
@@ -330,7 +333,7 @@ void vvToolBinarize::GetArgsInfoFromGUI()
 
 //------------------------------------------------------------------------------
 void vvToolBinarize::apply()
-{
+{ cout << __func__ << endl;
   if (!mCurrentSlicerManager) close();
   QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
   GetArgsInfoFromGUI();
@@ -355,7 +358,7 @@ void vvToolBinarize::apply()
 
 //------------------------------------------------------------------------------
 void vvToolBinarize::valueChangedT2(double v)
-{
+{ cout << __func__ << endl;
   //  DD("valueChangedT2");
   if (mRadioButtonLowerThan->isChecked()) {
     mThresholdSlider1->SetMaximum(v);
@@ -371,7 +374,7 @@ void vvToolBinarize::valueChangedT2(double v)
 
 //------------------------------------------------------------------------------
 void vvToolBinarize::valueChangedT1(double v)
-{
+{ cout << __func__ << endl;
   //  DD("valueChangedT1");
   if (!mCurrentSlicerManager) close();
   mThresholdSlider2->SetMinimum(v);