From: tbaudier Date: Tue, 5 Jan 2016 15:53:54 +0000 (+0100) Subject: Debug display bug with ROI & 4D images X-Git-Tag: v1.4.0~77^2~1 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=1067d8bb60a85eab30e875d6a325938b01ec6aaa;p=clitk.git 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 --- 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; + + } + } //------------------------------------------------------------------------------