** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: backprojectors.cpp,v 1.13 2000/08/31 08:38:58 kevin Exp $
+** $Id: backprojectors.cpp,v 1.14 2000/09/02 05:10:39 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
{
detInc = proj.detInc();
nDet = proj.nDet();
- iDetCenter = nDet / 2; // index refering to L=0 projection
+ iDetCenter = (nDet - 1) / 2; // index refering to L=0 projection
rotInc = proj.rotInc();
v = im.getArray();
BackprojectTable::BackprojectTable (const Projections& proj, ImageFile& im, int interpType, const int interpFactor)
: Backproject::Backproject (proj, im, interpType, interpFactor)
{
- arrayR.initSetSize (nx, ny);
- arrayPhi.initSetSize (nx, ny);
+ arrayR.initSetSize (im.nx(), im.ny());
+ arrayPhi.initSetSize (im.nx(), im.ny());
r = arrayR.getArray();
phi = arrayPhi.getArray();
if (iDetPos < 0 || iDetPos >= nDet - 1) {
; // errorIndexOutsideDetector (ix, iy, beta, r[ix][iy], phi[ix][iy], gamma, iDetPos);
} else
- pImCol[iy] += (((1-frac) * filteredProj[iDetPos] + frac * filteredProj[iDetPos+1])) / dL2;
+ pImCol[iy] += (filteredProj[iDetPos] + frac * (filteredProj[iDetPos+1] - filteredProj[iDetPos])) / dL2;
}
} // end for y
} // end for x
if (iDetPos < 0 || iDetPos >= nDet - 1)
; // errorIndexOutsideDetector (ix, iy, beta, r[ix][iy], phi[ix][iy], dDetPos, iDetPos);
else
- pImCol[iy] += (((1-frac) * filteredProj[iDetPos] + frac * filteredProj[iDetPos+1])) / (dU * dU);
+ pImCol[iy] += (filteredProj[iDetPos] + frac * (filteredProj[iDetPos+1] - filteredProj[iDetPos])) / (dU * dU);
}
} // end for y
} // end for x