From: Simon Rit Date: Fri, 1 Feb 2013 08:11:06 +0000 (+0100) Subject: Merge branch 'master' of git.creatis.insa-lyon.fr:clitk X-Git-Tag: v1.4.0~248^2~1 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=30089d49dc2ca5e5ed9f074ef3206c3b2b8a62ad;hp=a9f653bdbc1189f5ea64ded70c32b011186338a3;p=clitk.git Merge branch 'master' of git.creatis.insa-lyon.fr:clitk Conflicts: vv/vvSlicer.cxx --- diff --git a/vv/vvSlicer.cxx b/vv/vvSlicer.cxx index 7513160..30a8f10 100644 --- a/vv/vvSlicer.cxx +++ b/vv/vvSlicer.cxx @@ -901,8 +901,13 @@ void vvSlicer::AdjustResliceToSliceOrientation(vtkImageReslice *reslice) // Step 1: from world coordinates to image coordinates origin[this->SliceOrientation] -= mImageReslice->GetOutput()->GetOrigin()[this->SliceOrientation]; origin[this->SliceOrientation] /= mImageReslice->GetOutput()->GetSpacing()[this->SliceOrientation]; - // Step 2: round to superior grid positionInc. - origin[this->SliceOrientation] = itk::Math::Ceil(origin[this->SliceOrientation]); + + // Step 2: round to nearest grid positionInc. This has been validated as the only + // way to have something consistent with the thickness of a 2D slice visible on the + // other slices. The thickness is accounted for so if the 2D slice is to thin and + // between two slices, one will never be able to see this 2D slice (bug #1883). + origin[this->SliceOrientation] = itk::Math::Round(origin[this->SliceOrientation]); + // Step 3: back to world coordinates origin[this->SliceOrientation] *= mImageReslice->GetOutput()->GetSpacing()[this->SliceOrientation]; origin[this->SliceOrientation] += mImageReslice->GetOutput()->GetOrigin()[this->SliceOrientation];