X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=libctsim%2Fbackprojectors.cpp;h=ef0de98cfaec261d8aa6aae9a5fcadd644c67c40;hp=d05bccae2cbcaeb2fac8322d3452a03fc04de44b;hb=e289f8ecb69ba183b32e32ff20f1679f4b62194d;hpb=99dd1d6ed10db1f669a5fe6af71225a50fc0ddfb diff --git a/libctsim/backprojectors.cpp b/libctsim/backprojectors.cpp index d05bcca..ef0de98 100644 --- a/libctsim/backprojectors.cpp +++ b/libctsim/backprojectors.cpp @@ -8,7 +8,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: backprojectors.cpp,v 1.1 2000/06/19 02:59:34 kevin Exp $ +** $Id: backprojectors.cpp,v 1.2 2000/06/19 19:07:33 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -337,22 +337,18 @@ BackprojectIntDiff2::BackprojectView (const double* const filteredProj, const do { double theta = - view_angle; // add half PI to view angle to get perpendicular theta angle -#if SIZEOF_LONG == 8 - long int scale = 1 << 32; -#else - long int scale = 1 << 16; -#endif + kint32 scale = 1 << 16; double dScale = scale; - long int halfScale = scale / 2; + kint32 halfScale = scale / 2; - long int det_dx = nearest (xInc * sin (theta) / detInc * scale); - long int det_dy = nearest (yInc * cos (theta) / detInc * scale); + kint32 det_dx = nearest (xInc * sin (theta) / detInc * scale); + kint32 det_dy = nearest (yInc * cos (theta) / detInc * scale); // calculate L for first point in image (0, 0) - long int detPosColStart = nearest (start_r * cos (theta - start_phi) / detInc * scale); + kint32 detPosColStart = nearest (start_r * cos (theta - start_phi) / detInc * scale); for (int ix = 0; ix < nx; ix++, detPosColStart += det_dx) { - long int curDetPos = detPosColStart; + kint32 curDetPos = detPosColStart; ImageFileColumn pImCol = v[ix]; for (int iy = 0; iy < ny; iy++, curDetPos += det_dy) { @@ -365,8 +361,8 @@ BackprojectIntDiff2::BackprojectView (const double* const filteredProj, const do else *pImCol++ += filteredProj[iDetPos]; } else if (interpType == I_LINEAR) { - long int detPosFloor = curDetPos / scale; - long int detPosRemainder = curDetPos % scale; + kint32 detPosFloor = curDetPos / scale; + kint32 detPosRemainder = curDetPos % scale; if (detPosRemainder < 0) { detPosFloor--; detPosRemainder += scale;