From 336d665ba18331af2b6f8005da29af73e699552c Mon Sep 17 00:00:00 2001 From: Simon Rit Date: Fri, 10 Aug 2012 17:39:14 +0200 Subject: [PATCH] Fixed slice bug when toggling between voxels and world reslicing --- vv/vvSlicerManager.cxx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/vv/vvSlicerManager.cxx b/vv/vvSlicerManager.cxx index b6f2156..3206fce 100644 --- a/vv/vvSlicerManager.cxx +++ b/vv/vvSlicerManager.cxx @@ -1099,21 +1099,24 @@ void vvSlicerManager::SetSlicingPreset(SlicingPresetType preset) mImage->GetTransform()[this->GetTSlice()]->GetInverse(imageTransformInverse); for(int i=0; i< this->GetNumberOfSlicers(); i++){ + vvSlicer *s = this->GetSlicer(i); switch(preset) { case WORLD_SLICING: - this->GetSlicer(i)->GetSlicingTransform()->Identity(); + s->GetSlicingTransform()->Identity(); break; case VOXELS_SLICING: - this->GetSlicer(i)->GetSlicingTransform()->SetMatrix(imageTransformInverse); + s->GetSlicingTransform()->SetMatrix(imageTransformInverse); break; default: imageTransformInverse->Delete(); return; } - this->GetSlicer(i)->ForceUpdateDisplayExtent(); - this->GetSlicer(i)->ResetCamera(); - this->GetSlicer(i)->Render(); + s->ForceUpdateDisplayExtent(); + s->SetSlice((s->GetInput()->GetWholeExtent()[s->GetSliceOrientation()*2+1] + +s->GetInput()->GetWholeExtent()[s->GetSliceOrientation()*2])/2.0); + s->ResetCamera(); + s->Render(); } imageTransformInverse->Delete(); -- 2.47.1