From 84fa297940c807927e02fa595f5263fa9f410ca7 Mon Sep 17 00:00:00 2001 From: Simon Rit Date: Fri, 2 Sep 2011 14:01:38 +0200 Subject: [PATCH] VTK 5.8.0 introduced a bug with overlay and fusion: default values for output origin and spacing of vtkImageReslice had changed and the proper functions were not used for their initialization. Fixed. --- vv/vvSlicer.cxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/vv/vvSlicer.cxx b/vv/vvSlicer.cxx index 2473c87..8141ccd 100644 --- a/vv/vvSlicer.cxx +++ b/vv/vvSlicer.cxx @@ -755,12 +755,14 @@ void vvSlicer::SetSliceOrientation(int orientation) // of the displayed image in the slicing direction. void vvSlicer::AdjustResliceToSliceOrientation(vtkImageReslice *reslice) { - // Reset autocrop - double origin[3] = {VTK_DOUBLE_MAX, VTK_DOUBLE_MAX, VTK_DOUBLE_MAX}; - double spacing[3] = {VTK_DOUBLE_MAX, VTK_DOUBLE_MAX, VTK_DOUBLE_MAX}; - reslice->SetOutputOrigin(origin); - reslice->SetOutputSpacing(spacing); + // Reset autocrop and update output information + reslice->SetOutputOriginToDefault(); + reslice->SetOutputSpacingToDefault(); reslice->GetOutput()->UpdateInformation(); + + // Ge new origin / spacing + double origin[3]; + double spacing[3]; reslice->GetOutput()->GetOrigin(origin); reslice->GetOutput()->GetSpacing(spacing); -- 2.47.1