From 9f631d3f415fad2752f18a3fef0584c55dcc0523 Mon Sep 17 00:00:00 2001 From: maxime Pech Date: Wed, 25 May 2011 15:07:54 +0200 Subject: [PATCH] Fix error when cropping. The mean was computed with a minus operator... New problem identified : when SetImage is called after the crop, the SliceOrientation is always 2! --- vv/vvSlicer.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vv/vvSlicer.cxx b/vv/vvSlicer.cxx index 9809b06..47c2afd 100644 --- a/vv/vvSlicer.cxx +++ b/vv/vvSlicer.cxx @@ -337,7 +337,7 @@ void vvSlicer::SetImage(vvImage::Pointer image) // Prevent crash when reload -> change slice if outside extent if (Slice < extent[SliceOrientation*2] || Slice>=extent[SliceOrientation*2+1]) { - Slice = (extent[SliceOrientation*2+1]-extent[SliceOrientation*2])/2.0; + Slice = (extent[SliceOrientation*2+1]+extent[SliceOrientation*2])/2.0; } // Make sure that the required part image has been computed -- 2.45.1