Commit 41fdbbf6 authored by David Gobbi's avatar David Gobbi
Browse files

Use logical and in reslice nearest-neighbor path.

For this path, the resulting speed increase can be 30% or more.
parent 24b5ed72
......@@ -2262,9 +2262,9 @@ void vtkImageResliceExecute(vtkImageReslice *self,
int inIdY = vtkInterpolationMath::Round(inPoint[1]) - inExt[2];
int inIdZ = vtkInterpolationMath::Round(inPoint[2]) - inExt[4];
if ((inIdX >= 0) & (inIdX < inExtX) &
(inIdY >= 0) & (inIdY < inExtY) &
(inIdZ >= 0) & (inIdZ < inExtZ))
if (inIdX >= 0 && inIdX < inExtX &&
inIdY >= 0 && inIdY < inExtY &&
inIdZ >= 0 && inIdZ < inExtZ)
{
inPtrTmp = static_cast<char *>(inPtr) +
(inIdX*inInc[0] + inIdY*inInc[1] + inIdZ*inInc[2])*
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment