From: maxime Pech Date: Wed, 25 May 2011 13:07:54 +0000 (+0200) Subject: Fix error when cropping. X-Git-Tag: v1.3.0~345^2 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=9f631d3f415fad2752f18a3fef0584c55dcc0523;p=clitk.git 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! --- 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