r7950: minor efficiency change
authorKevin M. Rosenberg <kevin@rosenberg.net>
Sun, 5 Oct 2003 17:23:18 +0000 (17:23 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Sun, 5 Oct 2003 17:23:18 +0000 (17:23 +0000)
libctsim/backprojectors.cpp

index 581b7ff0fccae2c4762723da08331f0f2d6d8b9a..ef1ef12e655738f3b1e1b06bd13fbba148f38b28 100644 (file)
@@ -631,10 +631,10 @@ BackprojectIntDiff::BackprojectView (const double* const filteredProj, const dou
     } else if (interpType == Backprojector::INTERP_LINEAR) {
       for (int iy = 0; iy < ny; iy++, curDetPos += det_dy) {
         const long iDetPos = curDetPos >> scaleShift;
-        const long detRemainder = curDetPos & scaleBitmask;
-        if (iDetPos >= 0 && iDetPos <= iLastDet)
-           *pImCol++ += filteredProj[iDetPos] + (detRemainder * deltaFilteredProj[iDetPos]);
-           
+        if (iDetPos >= 0 && iDetPos <= iLastDet) {
+         const long detRemainder = curDetPos & scaleBitmask;
+         *pImCol++ += filteredProj[iDetPos] + (detRemainder * deltaFilteredProj[iDetPos]);
+       }
       }        // end for iy
     } else if (interpType == Backprojector::INTERP_CUBIC) {
       for (int iy = 0; iy < ny; iy++, curDetPos += det_dy) {