r101: *** empty log message ***
[ctsim.git] / libctsim / projections.cpp
index 8d3689567550a02ea1a4e670135193410552951a..8010912f32046b54eac5617250c1999470ac1cb4 100644 (file)
@@ -8,7 +8,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: projections.cpp,v 1.1 2000/06/19 02:59:34 kevin Exp $
+**  $Id: projections.cpp,v 1.2 2000/06/19 17:58:20 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
  */
 
 Projections::Projections (const Scanner& scanner)
+  : m_projData(0)
 {
-  init (scanner.nView(), scanner.nDet());
-
-  m_phmLen = scanner.phmLen();
-  m_rotInc = scanner.rotInc();
-  m_detInc = scanner.detInc();
-  m_rotStart = 0;
-  m_detStart =  -scanner.radius() + (scanner.detInc() / 2);
-  m_phmLen = scanner.phmLen();
+  initFromScanner (scanner);
 }
 
 
 Projections::Projections (const int nView, const int nDet)
+  : m_projData(0)
 {
   init (nView, nDet);
 }
 
 Projections::Projections (void)
+  : m_projData(0)
 {
   init (0, 0);
 }
@@ -72,11 +68,29 @@ Projections::init (const int nView, const int nDet)
 {
   m_nView = nView;
   m_nDet = nDet;
-  m_projData = NULL;
   newProjData ();
-  m_fd = -1;
 }
 
+void
+Projections::initFromScanner (const Scanner& scanner)
+{
+  deleteProjData();
+  init (scanner.nView(), scanner.nDet());
+
+  m_phmLen = scanner.phmLen();
+  m_rotInc = scanner.rotInc();
+  m_detInc = scanner.detInc();
+  m_rotStart = 0;
+  m_detStart =  -scanner.radius() + (scanner.detInc() / 2);
+  m_phmLen = scanner.phmLen();
+}
+
+void
+Projections::setNView (int nView)  // used by MPI to reduce # of views
+{
+  deleteProjData();
+  init (nView, m_nDet);
+}
 
 // NAME
 // newProjData