From 1067d8bb60a85eab30e875d6a325938b01ec6aaa Mon Sep 17 00:00:00 2001 From: tbaudier Date: Tue, 5 Jan 2016 16:53:54 +0100 Subject: [PATCH] Debug display bug with ROI & 4D images I just untoggled/toggled the ROI's visibility to avoid the problem But the proble is still there without this tip --- vv/vvToolROIManager.cxx | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/vv/vvToolROIManager.cxx b/vv/vvToolROIManager.cxx index d5d66ef..c092976 100644 --- a/vv/vvToolROIManager.cxx +++ b/vv/vvToolROIManager.cxx @@ -226,13 +226,6 @@ void vvToolROIManager::InputIsSelected(vvSlicerManager *m) mCurrentSlicerManager = m; mCurrentImage = mCurrentSlicerManager->GetImage(); - // Refuse if non 3D image - if (mCurrentImage->GetNumberOfDimensions() != 3) { - QMessageBox::information(this,tr("Warning"), tr("Warning 3D ROI on a 4D image will results in some display bugs")); - //close(); - //return; - } - // Change gui mLabelInputInfo->setText(QString("%1").arg(m->GetFileName().c_str())); @@ -487,6 +480,25 @@ void vvToolROIManager::AddImage(vvImage * binaryImage, // Update UpdateAllROIStatus(); + + if (mCurrentImage->GetNumberOfDimensions() != 3) { + + //Modifications to avoid display bug with a 4D image + QSharedPointer CurrentROIActorTemp; + CurrentROIActorTemp = mCurrentROIActor; + mCurrentROIActor = actor; + + int VisibleInWindow(0); + mCurrentSlicerManager->GetSlicer(VisibleInWindow)->SetCurrentPosition(-VTK_DOUBLE_MAX,-VTK_DOUBLE_MAX,-VTK_DOUBLE_MAX,mCurrentSlicerManager->GetSlicer(VisibleInWindow)->GetMaxCurrentTSlice()); + mCurrentSlicerManager->GetSlicer(VisibleInWindow)->Render(); + + VisibleROIToggled(false); + VisibleROIToggled(true); + + mCurrentROIActor = CurrentROIActorTemp; + + } + } //------------------------------------------------------------------------------ -- 2.47.1