From 7904fdbc7781853224ccd1ea755beb397a82bf93 Mon Sep 17 00:00:00 2001 From: dsarrut Date: Wed, 30 Jun 2010 06:18:10 +0000 Subject: [PATCH] manage a ROI actor --- vv/vvROIActor.cxx | 12 +++++++++++- vv/vvROIActor.h | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/vv/vvROIActor.cxx b/vv/vvROIActor.cxx index 382edf9..7a07b29 100644 --- a/vv/vvROIActor.cxx +++ b/vv/vvROIActor.cxx @@ -43,6 +43,7 @@ vvROIActor::vvROIActor() mIsSelected = false; mContourWidth = 1; mContourColor.resize(3); + m_modeBG = true; } //------------------------------------------------------------------------------ @@ -160,7 +161,16 @@ void vvROIActor::Initialize() { mImageContour[i]->HideActors(); mOverlayActors.push_back(new vvBinaryImageOverlayActor); - mOverlayActors[i]->SetImage(mROI->GetImage(), mROI->GetBackgroundValueLabelImage()); + + // BG or FG + if (m_modeBG) { + mOverlayActors[i]->SetImage(mROI->GetImage(), mROI->GetBackgroundValueLabelImage()); + } + else { + mOverlayActors[i]->SetImage(mROI->GetImage(), mROI->GetForegroundValueLabelImage(), false); + } + + mOverlayActors[i]->SetColor(mROI->GetDisplayColor()[0], mROI->GetDisplayColor()[1], mROI->GetDisplayColor()[2]); diff --git a/vv/vvROIActor.h b/vv/vvROIActor.h index f6a7b2f..52142bb 100644 --- a/vv/vvROIActor.h +++ b/vv/vvROIActor.h @@ -50,6 +50,7 @@ class vvROIActor: public QObject { int GetContourWidth() { return mContourWidth; } void SetContourColor(double r, double v, double b); std::vector & GetContourColor(); + void SetBGMode(bool b) { m_modeBG = b; } public slots: void UpdateSlice(int slicer, int slices); @@ -68,6 +69,7 @@ public slots: bool mIsSelected; int mContourWidth; std::vector mContourColor; + bool m_modeBG; }; // end class vvROIActor //------------------------------------------------------------------------------ -- 2.47.1