From: tbaudier Date: Thu, 19 Nov 2015 14:35:02 +0000 (+0100) Subject: ROI & Contour Debug Try X-Git-Tag: v1.4.0~90^2~8 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=77f3ff915faf29514050e75cd3a40d5aee212da6;p=clitk.git ROI & Contour Debug Try --- diff --git a/vv/vvBinaryImageOverlayActor.cxx b/vv/vvBinaryImageOverlayActor.cxx index dc95320..aa5cecc 100644 --- a/vv/vvBinaryImageOverlayActor.cxx +++ b/vv/vvBinaryImageOverlayActor.cxx @@ -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; iGetSlice(); 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 */ diff --git a/vv/vvImageContour.cxx b/vv/vvImageContour.cxx index 8fb22ae..e4ecfdf 100644 --- a/vv/vvImageContour.cxx +++ b/vv/vvImageContour.cxx @@ -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; iGetProperty()->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; iGetProperty()->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; iGetSlice(); 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 squaresActor = vtkSmartPointer::New(); vtkSmartPointer clipper = vtkSmartPointer::New(); vtkSmartPointer squares = vtkSmartPointer::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; diff --git a/vv/vvROIActor.cxx b/vv/vvROIActor.cxx index 74d5883..26f13f4 100644 --- a/vv/vvROIActor.cxx +++ b/vv/vvROIActor.cxx @@ -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; iRemoveActors(); } @@ -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; iGetImage()) { 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; iGetNumberOfSlicers(); 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; iGetNumberOfSlicers(); 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 & vvROIActor::GetContourColor() { +std::vector & vvROIActor::GetContourColor() +{ //out << __func__ << endl; return mContourColor; } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ -std::vector & vvROIActor::GetOverlayColor() { +std::vector & vvROIActor::GetOverlayColor() +{ //out << __func__ << endl; return mROI->GetDisplayColor(); } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ -void vvROIActor::UpdateColor() { +void vvROIActor::UpdateColor() +{ //out << __func__ << endl; for(unsigned int i=0; iSetOpacity(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; iGetNumberOfSlicers(); i++) { @@ -335,7 +345,7 @@ void vvROIActor::SetSelected(bool b) //------------------------------------------------------------------------------ void vvROIActor::CopyParameters(QSharedPointer roi) -{ +{ //out << __func__ << endl; // Overlay SetVisible(roi->IsVisible()); SetOpacity(roi->GetOpacity()); diff --git a/vv/vvToolBinarize.cxx b/vv/vvToolBinarize.cxx index 9859d01..6cb7518 100644 --- a/vv/vvToolBinarize.cxx +++ b/vv/vvToolBinarize.cxx @@ -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(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; iShowActors(); + 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; iHideActors(); 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; iisChecked() && !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);