From: Simon Rit Date: Fri, 1 Feb 2013 07:45:30 +0000 (+0100) Subject: Changes rounding to nearest slice with a comment to explain that the X-Git-Tag: v1.4.0~248^2~2 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;ds=sidebyside;h=ca23c1958549bf0a1b35acfc62b046c1127c0295;hp=--cc;p=clitk.git Changes rounding to nearest slice with a comment to explain that the slice might never be visible (bug #1883). --- ca23c1958549bf0a1b35acfc62b046c1127c0295 diff --git a/vv/vvSlicer.cxx b/vv/vvSlicer.cxx index 51ff1bc..0c7852a 100644 --- a/vv/vvSlicer.cxx +++ b/vv/vvSlicer.cxx @@ -901,9 +901,11 @@ 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 inferior grid positionInc. This makes sense because a border is used to interpolate - // the original image (SR). - origin[this->SliceOrientation] = itk::Math::Floor(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];