From: Simon Rit Date: Fri, 10 Aug 2012 15:39:14 +0000 (+0200) Subject: Fixed slice bug when toggling between voxels and world reslicing X-Git-Tag: v1.4.0~281^2~22 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=336d665ba18331af2b6f8005da29af73e699552c;p=clitk.git Fixed slice bug when toggling between voxels and world reslicing --- 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();