]> Creatis software - clitk.git/blobdiff - vv/vvSlicer.cxx
Fix error when cropping.
[clitk.git] / vv / vvSlicer.cxx
index 9809b06ddc771b574d4de2923c2a750ad11e1f67..47c2afdd591f03273e23e2a3cffc7079a511fbd6 100644 (file)
@@ -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