1.9.1 - 6/20/2000
Renamed directories, moved source files, combined source files
+ to change from 6 libraries to 3 libraries (libctsim, libctsupport,
+ and libctgraphics)
1.9.0 - 6/15/2000
Skip versions to make version 2.0 the first C++ version
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: ct.h,v 1.17 2000/06/19 15:48:23 kevin Exp $
+** $Id: ct.h,v 1.18 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
#include <string>
#include <iterator>
#include <algorithm>
+#include <exception>
+#include <stdexcept>
using namespace std;
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: projections.h,v 1.1 2000/06/17 20:12:14 kevin Exp $
+** $Id: projections.h,v 1.2 2000/06/19 17:58:20 kevin Exp $
**
**
** This program is free software; you can redistribute it and/or modify
Projections (void);
~Projections (void);
- void init (const int nView, const int nDet);
+ void initFromScanner (const Scanner& scanner);
void printProjectionData (void);
void printScanInfo (void) const;
bool detarrayRead (DetectorArray& darray, const int view_num);
bool detarrayWrite (const DetectorArray& darray, const int view_num);
+ void setNView (int nView); // used in MPI to restrict # of views
void setRotInc (double rotInc) { m_rotInc = rotInc;}
void setDetInc (double detInc) { m_detInc = detInc;}
void setPhmLen (double phmLen) { m_phmLen = phmLen;}
bool headerWrite (void);
void newProjData (void);
void deleteProjData (void);
+
+ void init (const int nView, const int nDet);
};
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: scanner.h,v 1.2 2000/06/19 15:48:23 kevin Exp $
+** $Id: scanner.h,v 1.3 2000/06/19 17:58:20 kevin Exp $
**
**
** This program is free software; you can redistribute it and/or modify
DetectorValue* m_detValues; /* Pointer to array of values recorded by detector */
int m_nDet; /* Number of detectors in array */
double m_viewAngle; /* View angle in radians */
+
+ DetectorArray& operator=(const DetectorArray& rhs);
+ DetectorArray& operator()(const DetectorArray& rhs);
};
typedef enum {
void collectProjections (Projections& proj, const Phantom& phm, const int start_view, const int trace);
+ void setNView (int nView);
const unsigned int nDet(void) const {return m_nDet;}
const unsigned int nView(void) const {return m_nView;}
const double phmLen(void) const {return m_phmLen;}
** 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);
}
{
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
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: syserror.cpp,v 1.1 2000/06/19 02:58:08 kevin Exp $
+** $Id: syserror.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
******************************************************************************/
#include <iostream>
+#include <exception>
+#include <stdexcept>
#include <stdarg.h>
#include <ctype.h>
#include "kstddef.h"
sys_error (ERR_FATAL, "illegal error code #%d [sys_error]", severity);
}
- vfprintf (stdout, msg, arg);
-
- cout << "\n";
+ char errStr[512];
+ vsnprintf (errStr, sizeof(errStr), msg, arg);
+ cout << errStr << endl;
if (severity == ERR_FATAL)
- exit(1);
+ throw runtime_error (errStr);
#if INTERACTIVE_ERROR_DISPLAY
cout << "A - Abort C - Continue W - Turn off warnings? ";
CC_LAM = $(lamdir)/bin/balky
LAM_EXTRA_SRC = mpiworld.cpp
-ctrec-lam: ctrec.cpp mpiworld.cpp ../include/ct.h
+ctrec-lam: ctrec.cpp mpiworld.cpp ../include/ct.h ../libctsim/libctsim.a ../libctsupport/libctsupport.a
$(CC_LAM) @DEFS@ $(CFLAGS) $(INCLUDES) -DHAVE_MPI ctrec.cpp -o ctrec-lam $(LDFLAGS) $(LAM_EXTRA_SRC) @ctlibs@
phm2pj-lam: phm2pj.cpp mpiworld.cpp ../include/ct.h