** 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
}
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();
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