X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=libctsim%2Fscanner.cpp;h=353926659dea09a0282ab5ad2e77c1b5896004c3;hb=4d5f56994972346351a48730315a7d85924103ba;hp=6dbfec8371a71f15c9953a8cbf77150ea783b66d;hpb=11ea72090da18aa290e2c3ab217f1d27736bca50;p=ctsim.git diff --git a/libctsim/scanner.cpp b/libctsim/scanner.cpp index 6dbfec8..3539266 100644 --- a/libctsim/scanner.cpp +++ b/libctsim/scanner.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: scanner.cpp,v 1.31 2001/02/20 17:44:14 kevin Exp $ +** $Id: scanner.cpp,v 1.32 2001/02/25 16:21:36 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 @@ -266,7 +266,16 @@ Scanner::collectProjections (Projections& proj, const Phantom& phm, const int tr } void -Scanner::collectProjections (Projections& proj, const Phantom& phm, const int iStartView, const int iNumViews, bool bStoreAtViewPosition, const int trace, SGP* pSGP) +Scanner::collectProjections (Projections& proj, const Phantom& phm, const int iStartView, const int iNumViews, + bool bStoreAtViewPosition, const int trace, SGP* pSGP) +{ + int iStorageOffset = (bStoreAtViewPosition ? iStartView : 0); + collectProjections (proj, phm, iStartView, iNumViews, iStorageOffset, trace, pSGP); +} + +void +Scanner::collectProjections (Projections& proj, const Phantom& phm, const int iStartView, const int iNumViews, + int iStorageOffset, const int trace, SGP* pSGP) { m_trace = trace; double start_angle = iStartView * proj.rotInc(); @@ -299,10 +308,8 @@ Scanner::collectProjections (Projections& proj, const Phantom& phm, const int iS int iView; double viewAngle; for (iView = 0, viewAngle = start_angle; iView < iNumViews; iView++, viewAngle += proj.rotInc()) { - int iStoragePosition = iView; - if (bStoreAtViewPosition) - iStoragePosition += iStartView; - + int iStoragePosition = iView + iStorageOffset; + DetectorArray& detArray = proj.getDetectorArray( iStoragePosition ); #ifdef HAVE_SGP