X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=libctsim%2Fprojections.cpp;h=8010912f32046b54eac5617250c1999470ac1cb4;hp=8d3689567550a02ea1a4e670135193410552951a;hb=5cf6874680f80d238bf34535d711dc223813f951;hpb=007a78a5e3a043cbc7e2777ab033b81b8acbbe71 diff --git a/libctsim/projections.cpp b/libctsim/projections.cpp index 8d36895..8010912 100644 --- a/libctsim/projections.cpp +++ b/libctsim/projections.cpp @@ -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 @@ -39,24 +39,20 @@ */ 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