r584: no message
[ctsim.git] / libctsim / scanner.cpp
index 6dbfec8371a71f15c9953a8cbf77150ea783b66d..353926659dea09a0282ab5ad2e77c1b5896004c3 100644 (file)
@@ -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