X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=libctsim%2Fbackprojectors.cpp;h=ecdc3fdcf753bbe9c41dbc620b170500c375bf16;hp=152e026770059dcee869e6161d6d373639b85f5a;hb=ee0105d74fec9d6bfd236e22e9e1d315e46c568e;hpb=f1831812306ad7114fcd94618cc2857bb63c8fc1 diff --git a/libctsim/backprojectors.cpp b/libctsim/backprojectors.cpp index 152e026..ecdc3fd 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.15 2000/12/03 15:16:18 kevin Exp $ +** $Id: backprojectors.cpp,v 1.17 2000/12/06 01:46:43 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 @@ -256,7 +256,7 @@ Backprojector::convertInterpIDToTitle (const int interpID) // PURPOSE // Pure virtual base class for all backprojectors. -Backproject::Backproject (const Projections& proj, ImageFile& im, const int interpType, const int interpFactor) +Backproject::Backproject (const Projections& proj, ImageFile& im, int interpType, const int interpFactor) : proj(proj), im(im), interpType(interpType), m_interpFactor(interpFactor) { detInc = proj.detInc(); @@ -359,7 +359,7 @@ BackprojectTrig::BackprojectView (const double* const filteredProj, const double // Precalculates trigometric function value for each point in image for backprojection. BackprojectTable::BackprojectTable (const Projections& proj, ImageFile& im, int interpType, const int interpFactor) - : Backproject::Backproject (proj, im, interpType, interpFactor) + : Backproject (proj, im, interpType, interpFactor) { arrayR.initSetSize (im.nx(), im.ny()); arrayPhi.initSetSize (im.nx(), im.ny()); @@ -421,7 +421,7 @@ BackprojectTable::BackprojectView (const double* const filteredProj, const doubl // Iterates in x & y direction by adding difference in L position BackprojectDiff::BackprojectDiff (const Projections& proj, ImageFile& im, int interpType, const int interpFactor) - : Backproject::Backproject (proj, im, interpType, interpFactor) + : Backproject (proj, im, interpType, interpFactor) { // calculate center of first pixel v[0][0] double x = xMin + xInc / 2; @@ -599,7 +599,7 @@ BackprojectIntDiff3::BackprojectView (const double* const filteredProj, const do kint32 detPosColStart = nearest ((start_r * cos (theta - start_phi) / detInc + iDetCenter) * scale); // precalculate scaled difference for linear interpolation - double deltaFilteredProj [nDet]; + double* deltaFilteredProj = new double [nDet]; if (interpType == Backprojector::INTERP_LINEAR) { for (int i = 0; i < nDet - 1; i++) deltaFilteredProj[i] = (filteredProj[i+1] - filteredProj[i]) * dInvScale; @@ -631,7 +631,9 @@ BackprojectIntDiff3::BackprojectView (const double* const filteredProj, const do *pImCol++ += filteredProj[iDetPos] + (detRemainder * deltaFilteredProj[iDetPos]); } // end for iy } //end linear - } // end for ix + } // end for ix + + delete deltaFilteredProj; }