]> Creatis software - clitk.git/commitdiff
VTK 5.8.0 introduced a bug with overlay and fusion: default values for
authorSimon Rit <simon.rit@creatis.insa-lyon.fr>
Fri, 2 Sep 2011 12:01:38 +0000 (14:01 +0200)
committerSimon Rit <simon.rit@creatis.insa-lyon.fr>
Fri, 2 Sep 2011 12:29:26 +0000 (14:29 +0200)
output origin and spacing of vtkImageReslice had changed and the proper
functions were not used for their initialization. Fixed.

vv/vvSlicer.cxx

index 2473c87e27c3ca8dd84b33c047d199bea685f7b3..8141ccd5729d479ce39405f4266c04c0c5f00cd6 100644 (file)
@@ -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);