1 /*****************************************************************************
4 ** Name: backprojectors.cpp Classes for backprojection
5 ** Programmer: Kevin Rosenberg
6 ** Date Started: June 2000
8 ** This is part of the CTSim program
9 ** Copyright (c) 1983-2001 Kevin Rosenberg
11 ** $Id: backprojectors.cpp,v 1.28 2001/02/23 02:06:01 kevin Exp $
13 ** This program is free software; you can redistribute it and/or modify
14 ** it under the terms of the GNU General Public License (version 2) as
15 ** published by the Free Software Foundation.
17 ** This program is distributed in the hope that it will be useful,
18 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ** GNU General Public License for more details.
22 ** You should have received a copy of the GNU General Public License
23 ** along with this program; if not, write to the Free Software
24 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 ******************************************************************************/
29 const int Backprojector::BPROJ_INVALID = -1;
30 const int Backprojector::BPROJ_TRIG = 0;
31 const int Backprojector::BPROJ_TABLE = 1;
32 const int Backprojector::BPROJ_DIFF = 2;
33 const int Backprojector::BPROJ_IDIFF = 3;
35 const char* const Backprojector::s_aszBackprojectName[] =
43 const char* const Backprojector::s_aszBackprojectTitle[] =
45 {"Direct Trigometric"},
46 {"Trigometric Table"},
47 {"Difference Iteration"},
48 {"Integer Difference Iteration"},
51 const int Backprojector::s_iBackprojectCount = sizeof(s_aszBackprojectName) / sizeof(const char*);
53 const int Backprojector::INTERP_INVALID = -1;
54 const int Backprojector::INTERP_NEAREST = 0;
55 const int Backprojector::INTERP_LINEAR = 1;
56 const int Backprojector::INTERP_CUBIC = 2;
57 const int Backprojector::INTERP_FREQ_PREINTERPOLATION = 3;
58 #if HAVE_BSPLINE_INTERP
59 const int Backprojector::INTERP_BSPLINE = 4;
60 const int Backprojector::INTERP_1BSPLINE = 5;
61 const int Backprojector::INTERP_2BSPLINE = 6;
62 const int Backprojector::INTERP_3BSPLINE = 7;
65 const char* const Backprojector::s_aszInterpName[] =
70 #if HAVE_FREQ_PREINTERP
71 {"freq_preinterpolationj"},
73 #if HAVE_BSPLINE_INTERP
81 const char* const Backprojector::s_aszInterpTitle[] =
86 #if HAVE_FREQ_PREINTERP
87 {"Frequency Preinterpolation"},
89 #if HAVE_BSPLINE_INTERP
91 {"B-Spline 1st Order"},
92 {"B-Spline 2nd Order"},
93 {"B-Spline 3rd Order"},
97 const int Backprojector::s_iInterpCount = sizeof(s_aszInterpName) / sizeof(const char*);
101 Backprojector::Backprojector (const Projections& proj, ImageFile& im, const char* const backprojName, const char* const interpName, const int interpFactor)
104 m_pBackprojectImplem = NULL;
106 initBackprojector (proj, im, backprojName, interpName, interpFactor);
110 Backprojector::BackprojectView (const double* const viewData, const double viewAngle)
112 if (m_pBackprojectImplem != NULL)
113 m_pBackprojectImplem->BackprojectView (viewData, viewAngle);
117 Backprojector::PostProcessing()
119 if (m_pBackprojectImplem != NULL)
120 m_pBackprojectImplem->PostProcessing();
123 Backprojector::~Backprojector ()
125 delete m_pBackprojectImplem;
128 // FUNCTION IDENTIFICATION
129 // Backproject* projector = selectBackprojector (...)
132 // Selects a backprojector based on BackprojType
133 // and initializes the backprojector
136 Backprojector::initBackprojector (const Projections& proj, ImageFile& im, const char* const backprojName, const char* const interpName, const int interpFactor)
138 m_nameBackproject = backprojName;
139 m_nameInterpolation = interpName;
140 m_pBackprojectImplem = NULL;
141 m_idBackproject = convertBackprojectNameToID (backprojName);
142 if (m_idBackproject == BPROJ_INVALID) {
144 m_failMessage = "Invalid backprojection name ";
145 m_failMessage += backprojName;
147 m_idInterpolation = convertInterpNameToID (interpName);
148 if (m_idInterpolation == INTERP_INVALID) {
150 m_failMessage = "Invalid interpolation name ";
151 m_failMessage += interpName;
154 if (m_fail || m_idBackproject == BPROJ_INVALID || m_idInterpolation == INTERP_INVALID) {
159 if (proj.geometry() == Scanner::GEOMETRY_EQUILINEAR)
160 m_pBackprojectImplem = static_cast<Backproject*>(new BackprojectEquilinear(proj, im, m_idInterpolation, interpFactor));
161 else if (proj.geometry() == Scanner::GEOMETRY_EQUIANGULAR)
162 m_pBackprojectImplem = static_cast<Backproject*>(new BackprojectEquiangular(proj, im, m_idInterpolation, interpFactor));
163 else if (proj.geometry() == Scanner::GEOMETRY_PARALLEL) {
164 if (m_idBackproject == BPROJ_TRIG)
165 m_pBackprojectImplem = static_cast<Backproject*>(new BackprojectTrig (proj, im, m_idInterpolation, interpFactor));
166 else if (m_idBackproject == BPROJ_TABLE)
167 m_pBackprojectImplem = static_cast<Backproject*>(new BackprojectTable (proj, im, m_idInterpolation, interpFactor));
168 else if (m_idBackproject == BPROJ_DIFF)
169 m_pBackprojectImplem = static_cast<Backproject*>(new BackprojectDiff (proj, im, m_idInterpolation, interpFactor));
170 else if (m_idBackproject == BPROJ_IDIFF)
171 m_pBackprojectImplem = static_cast<Backproject*>(new BackprojectIntDiff (proj, im, m_idInterpolation, interpFactor));
174 m_failMessage = "Unable to select a backprojection method [Backprojector::initBackprojector]";
183 Backprojector::convertBackprojectNameToID (const char* const backprojName)
185 int backprojID = BPROJ_INVALID;
187 for (int i = 0; i < s_iBackprojectCount; i++)
188 if (strcasecmp (backprojName, s_aszBackprojectName[i]) == 0) {
197 Backprojector::convertBackprojectIDToName (int bprojID)
199 static const char *bprojName = "";
201 if (bprojID >= 0 && bprojID < s_iBackprojectCount)
202 return (s_aszBackprojectName[bprojID]);
208 Backprojector::convertBackprojectIDToTitle (const int bprojID)
210 static const char *bprojTitle = "";
212 if (bprojID >= 0 && bprojID < s_iBackprojectCount)
213 return (s_aszBackprojectTitle[bprojID]);
220 Backprojector::convertInterpNameToID (const char* const interpName)
222 int interpID = INTERP_INVALID;
224 for (int i = 0; i < s_iInterpCount; i++)
225 if (strcasecmp (interpName, s_aszInterpName[i]) == 0) {
234 Backprojector::convertInterpIDToName (const int interpID)
236 static const char *interpName = "";
238 if (interpID >= 0 && interpID < s_iInterpCount)
239 return (s_aszInterpName[interpID]);
245 Backprojector::convertInterpIDToTitle (const int interpID)
247 static const char *interpTitle = "";
249 if (interpID >= 0 && interpID < s_iInterpCount)
250 return (s_aszInterpTitle[interpID]);
252 return (interpTitle);
257 // CLASS IDENTICATION
261 // Pure virtual base class for all backprojectors.
263 Backproject::Backproject (const Projections& proj, ImageFile& im, int interpType, const int interpFactor)
264 : proj(proj), im(im), interpType(interpType), m_interpFactor(interpFactor), m_bPostProcessingDone(false)
266 detInc = proj.detInc();
268 iDetCenter = (nDet - 1) / 2; // index refering to L=0 projection
269 rotScale = proj.rotInc();
271 if (proj.geometry() == Scanner::GEOMETRY_PARALLEL)
272 rotScale /= (proj.nView() * proj.rotInc() / PI); // scale by number of PI rotations
273 else if (proj.geometry() == Scanner::GEOMETRY_EQUIANGULAR || proj.geometry() == Scanner::GEOMETRY_EQUILINEAR)
274 rotScale /= (proj.nView() * proj.rotInc() / (2 * PI)); // scale by number of 2PI rotations
276 sys_error (ERR_SEVERE, "Invalid geometry type %d [Backproject::Backproject]", proj.geometry());
283 xMin = -proj.phmLen() / 2; // Retangular coords of phantom
284 xMax = xMin + proj.phmLen();
285 yMin = -proj.phmLen() / 2;
286 yMax = yMin + proj.phmLen();
288 xInc = (xMax - xMin) / nx; // size of cells
289 yInc = (yMax - yMin) / ny;
291 m_dFocalLength = proj.focalLength();
294 Backproject::~Backproject ()
298 Backproject::PostProcessing()
300 m_bPostProcessingDone = true;
304 Backproject::ScaleImageByRotIncrement ()
306 for (int ix = 0; ix < nx; ix++)
307 for (int iy = 0; iy < ny; iy++)
308 v[ix][iy] *= rotScale;
311 void Backproject::errorIndexOutsideDetector (int ix, int iy, double theta, double r, double phi, double L, int iDetPos)
313 sys_error (ERR_WARNING, "r=%f, phi=%f", r, phi);
314 errorIndexOutsideDetector (ix, iy, theta, L, iDetPos);
317 void Backproject::errorIndexOutsideDetector (int ix, int iy, double theta, double L, int iDetPos)
320 std::ostringstream os;
321 os << "ix=" << ix << ", iy=" << iy << ", theta=" << theta << ", L=" << L << ", detinc=" << detInc << "\n";
322 os << "ndet=" << nDet << ", detInc=" << detInc << ", iDetCenter=" << iDetCenter << "\n";
323 os << "xMin=" << xMin << ", xMax=" << xMax << ", xInc=" << xInc << "\n";
324 os << "yMin=" << yMin << ", yMax=" << yMax << ", yInc=" << yInc << "\n";
325 os << "iDetPos index outside bounds: " << iDetPos << " [backprojector]";;
327 sys_error (ERR_WARNING, os.str().c_str());
332 // CLASS IDENTICATION
336 // Uses trigometric functions at each point in image for backprojection.
339 BackprojectTrig::BackprojectView (const double* const filteredProj, const double view_angle)
341 double theta = view_angle;
343 CubicPolyInterpolator* pCubicInterp = NULL;
344 if (interpType == Backprojector::INTERP_CUBIC)
345 pCubicInterp = new CubicPolyInterpolator (filteredProj, nDet);
347 double x = xMin + xInc / 2; // Rectang coords of center of pixel
348 for (int ix = 0; ix < nx; x += xInc, ix++) {
349 double y = yMin + yInc / 2;
350 for (int iy = 0; iy < ny; y += yInc, iy++) {
351 double r = sqrt (x * x + y * y); // distance of cell from center
352 double phi = atan2 (y, x); // angle of cell from center
353 double L = r * cos (theta - phi); // position on detector
355 if (interpType == Backprojector::INTERP_NEAREST) {
356 int iDetPos = iDetCenter + nearest<int> (L / detInc); // calc'd index in the filter raysum array
358 if (iDetPos >= 0 && iDetPos < nDet)
359 v[ix][iy] += rotScale * filteredProj[iDetPos];
360 } else if (interpType == Backprojector::INTERP_LINEAR) {
361 double p = L / detInc; // position along detector
362 double pFloor = floor (p);
363 int iDetPos = iDetCenter + static_cast<int>(pFloor);
364 double frac = p - pFloor; // fraction distance from det
365 if (iDetPos >= 0 && iDetPos < nDet - 1)
366 v[ix][iy] += rotScale * ((1-frac) * filteredProj[iDetPos] + frac * filteredProj[iDetPos+1]);
367 } else if (interpType = Backprojector::INTERP_CUBIC) {
368 double p = iDetCenter + (L / detInc); // position along detector
369 if (p >= 0 && p < nDet)
370 v[ix][iy] += rotScale * pCubicInterp->interpolate (p);
375 if (interpType == Backprojector::INTERP_CUBIC)
380 // CLASS IDENTICATION
384 // Precalculates trigometric function value for each point in image for backprojection.
386 BackprojectTable::BackprojectTable (const Projections& proj, ImageFile& im, int interpType, const int interpFactor)
387 : Backproject (proj, im, interpType, interpFactor)
389 arrayR.initSetSize (im.nx(), im.ny());
390 arrayPhi.initSetSize (im.nx(), im.ny());
391 r = arrayR.getArray();
392 phi = arrayPhi.getArray();
394 double x, y; // Rectang coords of center of pixel
396 for (x = xMin + xInc / 2, ix = 0; ix < nx; x += xInc, ix++)
397 for (y = yMin + yInc / 2, iy = 0; iy < ny; y += yInc, iy++) {
398 r[ix][iy] = sqrt (x * x + y * y);
399 phi[ix][iy] = atan2 (y, x);
403 BackprojectTable::~BackprojectTable ()
408 BackprojectTable::PostProcessing()
410 if (! m_bPostProcessingDone) {
411 ScaleImageByRotIncrement();
412 m_bPostProcessingDone = true;
417 BackprojectTable::BackprojectView (const double* const filteredProj, const double view_angle)
419 double theta = view_angle;
421 CubicPolyInterpolator* pCubicInterp = NULL;
422 if (interpType == Backprojector::INTERP_CUBIC)
423 pCubicInterp = new CubicPolyInterpolator (filteredProj, nDet);
425 for (int ix = 0; ix < nx; ix++) {
426 ImageFileColumn pImCol = v[ix];
428 for (int iy = 0; iy < ny; iy++) {
429 double L = r[ix][iy] * cos (theta - phi[ix][iy]);
431 if (interpType == Backprojector::INTERP_NEAREST) {
432 int iDetPos = iDetCenter + nearest<int>(L / detInc); // calc index in the filtered raysum vector
434 if (iDetPos >= 0 && iDetPos < nDet)
435 pImCol[iy] += filteredProj[iDetPos];
436 } else if (interpType == Backprojector::INTERP_LINEAR) {
437 double dPos = L / detInc; // position along detector
438 double dPosFloor = floor (dPos);
439 int iDetPos = iDetCenter + static_cast<int>(dPosFloor);
440 double frac = dPos - dPosFloor; // fraction distance from det
441 if (iDetPos >= 0 && iDetPos < nDet - 1)
442 pImCol[iy] += ((1-frac) * filteredProj[iDetPos] + frac * filteredProj[iDetPos+1]);
443 } else if (interpType = Backprojector::INTERP_CUBIC) {
444 double p = iDetCenter + (L / detInc); // position along detector
445 if (p >= 0 && p < nDet)
446 pImCol[iy] += pCubicInterp->interpolate (p);
451 if (interpType == Backprojector::INTERP_CUBIC)
456 // CLASS IDENTICATION
460 // Backprojects by precalculating the change in L position for each x & y step in the image.
461 // Iterates in x & y direction by adding difference in L position
463 BackprojectDiff::BackprojectDiff (const Projections& proj, ImageFile& im, int interpType, const int interpFactor)
464 : Backproject (proj, im, interpType, interpFactor)
466 // calculate center of first pixel v[0][0]
467 double x = xMin + xInc / 2;
468 double y = yMin + yInc / 2;
469 start_r = sqrt (x * x + y * y);
470 start_phi = atan2 (y, x);
475 BackprojectDiff::~BackprojectDiff ()
480 BackprojectDiff::PostProcessing()
482 if (! m_bPostProcessingDone) {
483 ScaleImageByRotIncrement();
484 m_bPostProcessingDone = true;
489 BackprojectDiff::BackprojectView (const double* const filteredProj, const double view_angle)
491 double theta = view_angle;
493 // Distance between detectors for an angle given in units of detectors
494 double det_dx = xInc * cos (theta) / detInc;
495 double det_dy = yInc * sin (theta) / detInc;
497 // calculate detPosition for first point in image (ix=0, iy=0)
498 double detPosColStart = start_r * cos (theta - start_phi) / detInc;
500 CubicPolyInterpolator* pCubicInterp = NULL;
501 if (interpType == Backprojector::INTERP_CUBIC)
502 pCubicInterp = new CubicPolyInterpolator (filteredProj, nDet);
504 for (int ix = 0; ix < nx; ix++, detPosColStart += det_dx) {
505 double curDetPos = detPosColStart;
506 ImageFileColumn pImCol = v[ix];
508 for (int iy = 0; iy < ny; iy++, curDetPos += det_dy) {
509 if (interpType == Backprojector::INTERP_NEAREST) {
510 int iDetPos = iDetCenter + nearest<int> (curDetPos); // calc index in the filtered raysum vector
512 if (iDetPos >= 0 && iDetPos < nDet)
513 *pImCol++ += filteredProj[iDetPos];
514 } else if (interpType == Backprojector::INTERP_LINEAR) {
515 double detPosFloor = floor (curDetPos);
516 int iDetPos = iDetCenter + static_cast<int>(detPosFloor);
517 double frac = curDetPos - detPosFloor; // fraction distance from det
518 if (iDetPos > 0 && iDetPos < nDet - 1)
519 *pImCol++ += filteredProj[iDetPos] + (frac * (filteredProj[iDetPos+1] - filteredProj[iDetPos]));
520 } else if (interpType = Backprojector::INTERP_CUBIC) {
521 double p = iDetCenter + curDetPos; // position along detector
522 if (p >= 0 && p < nDet)
523 *pImCol++ += pCubicInterp->interpolate (p);
528 if (interpType == Backprojector::INTERP_CUBIC)
533 // CLASS IDENTICATION
534 // BackprojectIntDiff
537 // Highly optimized and integer version of BackprojectDiff
540 BackprojectIntDiff::BackprojectView (const double* const filteredProj, const double view_angle)
542 double theta = view_angle; // add half PI to view angle to get perpendicular theta angle
543 static const int scaleShift = 16;
544 static const kint32 scale = (1 << scaleShift);
545 static const kint32 scaleBitmask = scale - 1;
546 static const kint32 halfScale = scale / 2;
547 static const double dInvScale = 1. / scale;
549 const kint32 det_dx = nearest<kint32> (xInc * cos (theta) / detInc * scale);
550 const kint32 det_dy = nearest<kint32> (yInc * sin (theta) / detInc * scale);
552 // calculate L for first point in image (0, 0)
553 kint32 detPosColStart = nearest<kint32> ((start_r * cos (theta - start_phi) / detInc + iDetCenter) * scale);
555 double* deltaFilteredProj = NULL;
556 CubicPolyInterpolator* pCubicInterp = NULL;
557 if (interpType == Backprojector::INTERP_LINEAR) {
558 // precalculate scaled difference for linear interpolation
559 deltaFilteredProj = new double [nDet];
560 for (int i = 0; i < nDet - 1; i++)
561 deltaFilteredProj[i] = (filteredProj[i+1] - filteredProj[i]) * dInvScale;
562 deltaFilteredProj[nDet - 1] = 0; // last detector
563 } else if (interpType == Backprojector::INTERP_CUBIC) {
564 pCubicInterp = new CubicPolyInterpolator (filteredProj, nDet);
567 int iLastDet = nDet - 1;
568 for (int ix = 0; ix < nx; ix++, detPosColStart += det_dx) {
569 kint32 curDetPos = detPosColStart;
570 ImageFileColumn pImCol = v[ix];
572 if (interpType == Backprojector::INTERP_NEAREST) {
573 for (int iy = 0; iy < ny; iy++, curDetPos += det_dy) {
574 const int iDetPos = (curDetPos + halfScale) >> 16;
575 if (iDetPos >= 0 && iDetPos <= iLastDet)
576 *pImCol++ += filteredProj[iDetPos];
578 } else if (interpType == Backprojector::INTERP_FREQ_PREINTERPOLATION) {
579 for (int iy = 0; iy < ny; iy++, curDetPos += det_dy) {
580 const int iDetPos = ((curDetPos + halfScale) >> 16) * m_interpFactor;
581 if (iDetPos >= 0 && iDetPos <= iLastDet)
582 *pImCol++ += filteredProj[iDetPos];
584 } else if (interpType == Backprojector::INTERP_LINEAR) {
585 for (int iy = 0; iy < ny; iy++, curDetPos += det_dy) {
586 const kint32 iDetPos = curDetPos >> scaleShift;
587 const kint32 detRemainder = curDetPos & scaleBitmask;
588 if (iDetPos >= 0 && iDetPos <= iLastDet)
589 *pImCol++ += filteredProj[iDetPos] + (detRemainder * deltaFilteredProj[iDetPos]);
591 } else if (interpType = Backprojector::INTERP_CUBIC) {
592 for (int iy = 0; iy < ny; iy++, curDetPos += det_dy) {
593 *pImCol++ += pCubicInterp->interpolate (static_cast<double>(curDetPos) / 65536);
598 if (interpType == Backprojector::INTERP_LINEAR)
599 delete deltaFilteredProj;
600 else if (interpType == Backprojector::INTERP_CUBIC)
606 BackprojectEquiangular::BackprojectView (const double* const filteredProj, const double view_angle)
608 double beta = view_angle;
610 CubicPolyInterpolator* pCubicInterp = NULL;
611 if (interpType == Backprojector::INTERP_CUBIC)
612 pCubicInterp = new CubicPolyInterpolator (filteredProj, nDet);
614 for (int ix = 0; ix < nx; ix++) {
615 ImageFileColumn pImCol = v[ix];
617 for (int iy = 0; iy < ny; iy++) {
618 double dAngleDiff = beta - phi[ix][iy];
619 double rcos_t = r[ix][iy] * cos (dAngleDiff);
620 double rsin_t = r[ix][iy] * sin (dAngleDiff);
621 double dFLPlusSin = m_dFocalLength + rsin_t;
622 double gamma = atan (rcos_t / dFLPlusSin);
623 double dPos = gamma / detInc; // position along detector
624 double dL2 = dFLPlusSin * dFLPlusSin + (rcos_t * rcos_t);
626 if (interpType == Backprojector::INTERP_NEAREST) {
627 int iDetPos = iDetCenter + nearest<int>(dPos); // calc index in the filtered raysum vector
628 if (iDetPos >= 0 && iDetPos < nDet)
629 pImCol[iy] += filteredProj[iDetPos] / dL2;
630 } else if (interpType == Backprojector::INTERP_LINEAR) {
631 double dPosFloor = floor (dPos);
632 int iDetPos = iDetCenter + static_cast<int>(dPosFloor);
633 double frac = dPos - dPosFloor; // fraction distance from det
634 if (iDetPos >= 0 && iDetPos < nDet - 1)
635 pImCol[iy] += (filteredProj[iDetPos] + frac * (filteredProj[iDetPos+1] - filteredProj[iDetPos])) / dL2;
636 } else if (interpType == Backprojector::INTERP_CUBIC) {
637 double d = iDetCenter + dPos; // position along detector
638 if (d >= 0 && d < nDet)
639 pImCol[iy] += pCubicInterp->interpolate (d) / dL2;
644 if (interpType == Backprojector::INTERP_CUBIC)
649 BackprojectEquilinear::BackprojectView (const double* const filteredProj, const double view_angle)
651 double beta = view_angle;
653 CubicPolyInterpolator* pCubicInterp = NULL;
654 if (interpType == Backprojector::INTERP_CUBIC)
655 pCubicInterp = new CubicPolyInterpolator (filteredProj, nDet);
657 for (int ix = 0; ix < nx; ix++) {
658 ImageFileColumn pImCol = v[ix];
660 for (int iy = 0; iy < ny; iy++) {
661 double dAngleDiff = beta - phi[ix][iy];
662 double rcos_t = r[ix][iy] * cos (dAngleDiff);
663 double rsin_t = r[ix][iy] * sin (dAngleDiff);
665 double dU = (m_dFocalLength + rsin_t) / m_dFocalLength;
666 double dDetPos = rcos_t / dU;
667 // double to scale for imaginary detector that passes through origin
668 // of phantom, see Kak-Slaney Figure 3.22. This assumes that the detector is also
669 // located focal-length away from the origin.
671 double dPos = dDetPos / detInc; // position along detector array
673 if (interpType == Backprojector::INTERP_NEAREST) {
674 int iDetPos = iDetCenter + nearest<int>(dPos); // calc index in the filtered raysum vector
675 if (iDetPos >= 0 && iDetPos < nDet)
676 pImCol[iy] += (filteredProj[iDetPos] / (dU * dU));
677 } else if (interpType == Backprojector::INTERP_LINEAR) {
678 double dPosFloor = floor (dPos);
679 int iDetPos = iDetCenter + static_cast<int>(dPosFloor);
680 double frac = dPos - dPosFloor; // fraction distance from det
681 if (iDetPos >= 0 && iDetPos < nDet - 1)
682 pImCol[iy] += (filteredProj[iDetPos] + frac * (filteredProj[iDetPos+1] - filteredProj[iDetPos]))
684 } else if (interpType == Backprojector::INTERP_CUBIC) {
685 double d = iDetCenter + dPos; // position along detector
686 if (d >= 0 && d < nDet)
687 pImCol[iy] += pCubicInterp->interpolate (d) / (dU * dU);
692 if (interpType == Backprojector::INTERP_CUBIC)