X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=libctsim%2Fprojections.cpp;h=1aee958e6fdcd42c4addfee161471ccb38780a74;hp=95cbc89a34c211c50e4abacf2f0a8bfafa0e56cb;hb=d16eb37cbc73f67fc29a60645e0b1ac7fe32767e;hpb=663448e3173a19f054952806d8f8eca2fe59ec90 diff --git a/libctsim/projections.cpp b/libctsim/projections.cpp index 95cbc89..1aee958 100644 --- a/libctsim/projections.cpp +++ b/libctsim/projections.cpp @@ -8,7 +8,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: projections.cpp,v 1.66 2001/03/13 14:53:44 kevin Exp $ +** $Id: projections.cpp,v 1.67 2001/03/18 18:08:25 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 @@ -810,7 +810,7 @@ Projections::calcArrayPolarCoordinates (unsigned int nx, unsigned int ny, double // +1 is correct for frequency data, ndet-1 is correct for projections int iDetCenter = (iNumDetWithZeros - 1) / 2; // index refering to L=0 projection - if (iNumDetWithZeros % 2 == 0) + if (isEven (iNumDetWithZeros)) iDetCenter = (iNumDetWithZeros + 1) / 2; // Calculates polar coordinates (view#, det#) for each point on phantom grid @@ -1002,7 +1002,7 @@ Projections::interpolateToParallel () const #endif pProjNew->m_detStart = -m_dViewDiameter / 2; pProjNew->m_detInc = m_dViewDiameter / nDet; - if (nDet % 2 == 0) // even + if (isEven (nDet)) // even pProjNew->m_detInc = m_dViewDiameter / (nDet - 1); ParallelRaysums parallel (this, ParallelRaysums::THETA_RANGE_NORMALIZE_TO_TWOPI);