//------------------------------------------------------------------------------
vvROIActor::vvROIActor()
-{ //out << __func__ << endl;
+{
mIsVisible = true;
mIsContourVisible = false;
mOpacity = 0.5;
//------------------------------------------------------------------------------
vvROIActor::~vvROIActor()
-{ //out << __func__ << endl;
+{
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvROIActor::RemoveActors()
-{ //out << __func__ << endl;
+{
for(unsigned int i= 0; i<mOverlayActors.size(); i++) {
mOverlayActors[i]->RemoveActors();
}
}
Update(true);
- mImageContour.clear();
- mOverlayActors.clear();
+ //mImageContour.clear();
+ //mOverlayActors.clear();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvROIActor::SetROI(clitk::DicomRT_ROI * s)
-{ //out << __func__ << endl;
+{
mROI = s;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvROIActor::SetContourWidth(int n)
-{ //out << __func__ << endl;
+{
mContourWidth = n;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvROIActor::SetSlicerManager(vvSlicerManager * s)
-{ //out << __func__ << endl;
+{
mSlicerManager = s;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvROIActor::UpdateImage()
-{ //out << __func__ << endl;
+{
mOverlayActors.clear();
mImageContour.clear();
Initialize(mDepth, mIsVisible);
//------------------------------------------------------------------------------
void vvROIActor::SetVisible(bool b)
-{ //out << __func__ << endl;
+{
mIsVisible = b;
if (!b) { // remove actor
for(unsigned int i= 0; i<mOverlayActors.size(); i++)
for(unsigned int i= 0; i<mOverlayActors.size(); i++)
mOverlayActors[i]->ShowActors();
}
- Update(); // No Render
+ //Update(); // No Render
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvROIActor::SetContourVisible(bool b)
-{ //out << __func__ << endl;
+{
mIsContourVisible = b;
if (!b) { // remove actor
for(unsigned int i= 0; i<mImageContour.size(); i++) {
mImageContour[i]->ShowActors();
}
}
- Update(); // No Render
+ //Update(); // No Render
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
bool vvROIActor::IsVisible()
-{ //out << __func__ << endl;
+{
return mIsVisible;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
bool vvROIActor::IsContourVisible()
-{ //out << __func__ << endl;
+{
return mIsContourVisible;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvROIActor::Initialize(double depth, bool IsVisible)
-{ //out << __func__ << endl;
+{
if (mROI->GetImage()) {
mImageContour.clear();
mOverlayActors.clear();
mOverlayActors.push_back(vvBinaryImageOverlayActor::New());
// BG or FG
- if (m_modeBG) {
- mOverlayActors[i]->SetImage(mROI->GetImage(), mROI->GetBackgroundValueLabelImage());
- }
- else {
- mOverlayActors[i]->SetImage(mROI->GetImage(), mROI->GetForegroundValueLabelImage(), false);
- }
+ 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],
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(UpdateTSlice(int,int,int)),this,SLOT(UpdateSlice(int, int, int)));
connect(mSlicerManager, SIGNAL(AVerticalSliderHasChanged(int, int)), SLOT(UpdateSlice(int, int)));
}
}
//------------------------------------------------------------------------------
void vvROIActor::SetDepth(double d)
-{ //out << __func__ << endl;
+{
mDepth = d;
if (!mSlicerManager) return;
for(int i=0; i<mSlicerManager->GetNumberOfSlicers(); i++) {
//------------------------------------------------------------------------------
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);
//------------------------------------------------------------------------------
-void vvROIActor::UpdateSlice(int slicer, int slices, bool force)
-{ //out << __func__ << endl;
+void vvROIActor::UpdateSlice(int slicer, int slices, int force)
+{
if (!mROI->GetImage()) return;
if ((!mIsVisible) && (!mIsContourVisible)) return;
if (!mSlicerManager) {
}
// Refresh overlays
- mOverlayActors[slicer]->UpdateSlice(slicer, slices, force);
+ if (mIsVisible) {
+ mOverlayActors[slicer]->UpdateSlice(slicer, slices, force);
+ }
+ //mSlicerManager->GetSlicer(slicer)->Render();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvROIActor::SetOpacity(double d)
-{ //out << __func__ << endl;
+{
mOpacity = d;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvROIActor::SetContourColor(double r, double v, double b)
-{ //out << __func__ << endl;
+{
mContourColor[0] = r;
mContourColor[1] = v;
mContourColor[2] = b;
//------------------------------------------------------------------------------
void vvROIActor::SetOverlayColor(double r, double v, double b)
-{ //out << __func__ << endl;
+{
if (mROI)
mROI->SetDisplayColor(r,v,b);
}
//------------------------------------------------------------------------------
std::vector<double> & vvROIActor::GetContourColor()
-{ //out << __func__ << endl;
+{
return mContourColor;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
std::vector<double> & vvROIActor::GetOverlayColor()
-{ //out << __func__ << endl;
+{
return mROI->GetDisplayColor();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
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],
//------------------------------------------------------------------------------
double vvROIActor::GetOpacity()
-{ //out << __func__ << endl;
+{
return mOpacity;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvROIActor::SetSelected(bool b)
-{ //out << __func__ << endl;
+{
mIsSelected = b;
if (b) {
for(int i=0; i<mSlicerManager->GetNumberOfSlicers(); i++) {
//------------------------------------------------------------------------------
void vvROIActor::CopyParameters(QSharedPointer<vvROIActor> roi)
-{ //out << __func__ << endl;
+{
// Overlay
SetVisible(roi->IsVisible());
SetOpacity(roi->GetOpacity());