r187: *** empty log message ***
[ctsim.git] / libctsim / backprojectors.cpp
index 0bcd4077cd527281d11769b4084c3d29e07cce1d..8c785ac45bdfbe38b7fccb5358241c8096468723 100644 (file)
@@ -8,7 +8,7 @@
 **  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
@@ -261,7 +261,7 @@ Backproject::Backproject (const Projections& proj, ImageFile& im, const int inte
 {
   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();
@@ -360,8 +360,8 @@ BackprojectTrig::BackprojectView (const double* const filteredProj, const double
 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();
 
@@ -665,7 +665,7 @@ BackprojectEquiangular::BackprojectView (const double* const filteredProj, const
        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 
@@ -705,7 +705,7 @@ BackprojectEquilinear::BackprojectView (const double* const filteredProj, const
        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