** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: array2dfile.h,v 1.10 2000/12/16 02:44:26 kevin Exp $
+** $Id: array2dfile.h,v 1.11 2000/12/16 03:29:02 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
const string& getFilename (void) const
{ return m_filename; }
- void printLabels (ostream& os) const;
+ void printLabels (std::ostream& os) const;
typedef vector<Array2dFileLabel*>::iterator labelIterator;
typedef vector<Array2dFileLabel*>::const_iterator constLabelIterator;
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: ctsupport.h,v 1.11 2000/12/16 02:44:26 kevin Exp $
+** $Id: ctsupport.h,v 1.12 2000/12/16 03:29:02 kevin Exp $
**
**
** This program is free software; you can redistribute it and/or modify
#define TRUE 1
#define FALSE 0
#define OK TRUE
-#define ERROR FALSE
-#define YES TRUE
-#define NO FALSE
/*----------------------------------------------------------------------*/
/*----------------------------------------------------------------------*/
-struct time_st {
- int hour, minute, second, ms;
-};
-
-struct date_st {
- int year, month, date, dow;
-};
-
-struct timedate_st {
- struct time_st t;
- struct date_st d;
-};
-
-typedef struct time_st TIME;
-typedef struct date_st DATE;
-typedef struct timedate_st TIMEDATE;
-
-/*----------------------------------------------------------------------*/
-
#define ERR_WARNING 0
#define ERR_SEVERE 1
#define ERR_FATAL 2
void sys_verror(int severity, const char *msg, va_list arg);
void sys_error_level(int severity);
-/* timedate.cpp */
-DATE *td_get_date(DATE *d);
-TIME *td_get_time(TIME *t);
-double td_current_sec(void);
-double td_time_to_sec(TIME *t);
-TIME *td_time_sub(const TIME *t1, const TIME *t2, TIME *tdiff);
-TIME *td_time_add(const TIME *t1, const TIME *t2, TIME *tsum);
-TIME *td_time_copy(TIME *to, const TIME *from);
-TIME *td_time_norm(TIME *t);
-void td_get_tmdt(TIMEDATE *td);
-const char *td_str_tmdt(const TIMEDATE *td);
-const char *td_str_time(const TIME *t);
-const char *td_str_stime(const TIME *t);
-const char *td_str_date(const DATE *d);
-char *td_str_cdate(DATE *d);
-char *td_month_name(int n);
-char *td_day_name(int n);
-
-
// Math Section
#include <cmath>
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: imagefile.h,v 1.20 2000/12/04 05:36:57 kevin Exp $
+** $Id: imagefile.h,v 1.21 2000/12/16 03:29:02 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 getMinMax (double& min, double& max) const;
- void printStatistics (ostream& os) const;
+ void printStatistics (std::ostream& os) const;
bool comparativeStatistics (const ImageFile& imComp, double& d, double& r, double& e) const;
- bool printComparativeStatistics (const ImageFile& imComp, ostream& os) const;
+ bool printComparativeStatistics (const ImageFile& imComp, std::ostream& os) const;
int display (void) const;
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: projections.h,v 1.16 2000/12/16 02:31:00 kevin Exp $
+** $Id: projections.h,v 1.17 2000/12/16 03:29:02 kevin Exp $
**
**
** This program is free software; you can redistribute it and/or modify
const DetectorArray& getDetectorArray (const int iview) const
{ return (*m_projData[iview]); }
- static bool copyHeader (const char* const filename, ostream& os);
- static bool copyHeader (const string& filename, ostream& os);
+ static bool copyHeader (const char* const filename, std::ostream& os);
+ static bool copyHeader (const string& filename, std::ostream& os);
- static bool copyViewData (const char* const filename, ostream& os, int startView, int endView);
- static bool copyViewData (const string& filename, ostream& os, int startView, int endView);
+ static bool copyViewData (const char* const filename, std::ostream& os, int startView, int endView);
+ static bool copyViewData (const string& filename, std::ostream& os, int startView, int endView);
private:
int m_headerSize; // Size of disk file header
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: scanner.h,v 1.15 2000/09/02 05:10:39 kevin Exp $
+** $Id: scanner.h,v 1.16 2000/12/16 03:29:02 kevin Exp $
**
**
** This program is free software; you can redistribute it and/or modify
void setNView (int nView);
bool fail() const {return m_fail;}
- const string& failMessage() const {return m_failMessage;}
+ const std::string& failMessage() const {return m_failMessage;}
unsigned int nDet() const {return m_nDet;}
unsigned int nView() const {return m_nView;}
double phmLen() const {return m_phmLen;}
private:
bool m_fail;
- string m_failMessage;
+ std::string m_failMessage;
int m_idGeometry;
unsigned int m_nDet; /* Number of detectors in array */
unsigned int m_nView; /* Number of rotated views */
virtual void timerReport (const char* const msg) const
{
- cout << msg << ": " << m_timeElapsed << " seconds" << endl;
+ std::cout << msg << ": " << m_timeElapsed << " seconds" << std::endl;
}
virtual double timerEndAndReport (const char* const msg)
virtual void timerReport (const char* const msg)
{
if (m_comm.Get_rank() == 0)
- cout << msg << ": " << m_timeElapsed << " seconds" << endl;
+ std::cout << msg << ": " << m_timeElapsed << " seconds" << std::endl;
}
virtual double timerEndAndReport (const char* const msg)
virtual void timerReport (const char* const msg)
{
if (m_comm.Get_rank() == 0)
- cout << msg << " " << "Minimum=" << m_timeMin << ", Maximum=" << m_timeMax << " seconds" << endl;
+ std::cout << msg << " " << "Minimum=" << m_timeMin << ", Maximum=" << m_timeMax << " seconds" << std::endl;
}
virtual void timerReportAllProcesses (const char* const msg)
{
- cout << msg << ": " << "Minimum=" << m_timeMin << ", Maximum=" << m_timeMax << " seconds (Rank " << m_comm.Get_rank() << ")" << endl;
+ std::cout << msg << ": " << "Minimum=" << m_timeMin << ", Maximum=" << m_timeMax << " seconds (Rank " << m_comm.Get_rank() << ")" << std::endl;
}
private:
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: ctsim.cpp,v 1.13 2000/09/07 14:29:05 kevin Exp $
+** $Id: ctsim.cpp,v 1.14 2000/12/16 03:29:02 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 "config.h"
#endif
#if defined(HAVE_GETOPT_H) || defined(HAVE_GETOPT_LONG)
-#include <getopt.h>
+#include "getopt.h"
#endif
-static const char* rcsindent = "$Id: ctsim.cpp,v 1.13 2000/09/07 14:29:05 kevin Exp $";
+static const char* rcsindent = "$Id: ctsim.cpp,v 1.14 2000/12/16 03:29:02 kevin Exp $";
class CTSimApp* theApp = NULL;
switch (c) {
case O_VERSION:
- cout << rcsindent << endl;
+ std::cout << rcsindent << std::endl;
exit(0);
case O_HELP:
case '?':
void
CTSimApp::usage(const char* program)
{
- cout << "usage: " << fileBasename(program) << " [files-to-open...] [OPTIONS]\n";
- cout << "Computed Tomography Simulator (Graphical Shell)\n";
- cout << "\n";
- cout << " --version Display version\n";
- cout << " --help Display this help message\n";
+ std::cout << "usage: " << fileBasename(program) << " [files-to-open...] [OPTIONS]\n";
+ std::cout << "Computed Tomography Simulator (Graphical Shell)\n";
+ std::cout << "\n";
+ std::cout << " --version Display version\n";
+ std::cout << " --help Display this help message\n";
}
int
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: ctsim.h,v 1.6 2000/09/07 01:28:33 kevin Exp $
+** $Id: ctsim.h,v 1.7 2000/12/16 03:29:02 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
wxTextCtrl* m_pLog;
wxMenu* m_pWindowMenu;
- static const int MAX_WINDOW_MENUITEMS = 20;
+ enum { MAX_WINDOW_MENUITEMS = 20 };
wxMenuItem* m_apWindowMenuItems[MAX_WINDOW_MENUITEMS];
wxDocument* m_apWindowMenuData[MAX_WINDOW_MENUITEMS];
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: dialogs.cpp,v 1.13 2000/09/04 09:06:46 kevin Exp $
+** $Id: dialogs.cpp,v 1.14 2000/12/16 03:29:02 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
StringValueAndTitleListBox::StringValueAndTitleListBox (wxDialog* pParent, int nChoices, const char* aszTitle[], const char* aszValue[])
: wxListBox ()
{
- wxString asTitle[nChoices];
+ wxString* psTitle = new wxString [nChoices];
for (int i = 0; i < nChoices; i++)
- asTitle[i] = aszTitle[i];
+ psTitle[i] = aszTitle[i];
- Create (pParent, -1, wxDefaultPosition, wxSize(200,-1), nChoices, asTitle, wxLB_SINGLE | wxLB_NEEDED_SB);
+ Create (pParent, -1, wxDefaultPosition, wxSize(200,-1), nChoices, psTitle, wxLB_SINGLE | wxLB_NEEDED_SB);
- m_ppszValues = aszValue;
+ m_ppszValues = aszValue;\r
+ delete [] psTitle;
};
const char*
-DialogGetPhantom::DialogGetPhantom (wxFrame* pParent, int iDefaultPhantom = Phantom::PHM_HERMAN)
+DialogGetPhantom::DialogGetPhantom (wxFrame* pParent, int iDefaultPhantom)
: wxDialog (pParent, -1, "Select Phantom", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
{
wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
}
-DialogGetImageMinMax::DialogGetImageMinMax (wxFrame* pParent, const ImageFile& rImagefile, double dDefaultMin = 0., double dDefaultMax = 0.)
+DialogGetImageMinMax::DialogGetImageMinMax (wxFrame* pParent, const ImageFile& rImagefile, double dDefaultMin, double dDefaultMax)
: wxDialog (pParent, -1, "Set Image Display Minimum & Maximum", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
{
wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
// DialogGetRasterParameters
/////////////////////////////////////////////////////////////////////
-DialogGetRasterParameters::DialogGetRasterParameters (wxFrame* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0, int iDefaultNSamples = 1)
+DialogGetRasterParameters::DialogGetRasterParameters (wxFrame* pParent, int iDefaultXSize, int iDefaultYSize, int iDefaultNSamples)
: wxDialog (pParent, -1, "Set Rasterization Parameters", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
{
wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: dlgprojections.cpp,v 1.6 2000/09/07 14:29:05 kevin Exp $
+** $Id: dlgprojections.cpp,v 1.7 2000/12/16 03:29:02 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
if (m_iTrace >= Trace::TRACE_PLOT) {
const DetectorArray& detArray = m_rProjections.getDetectorArray (iViewNumber);
const DetectorValue* detValues = detArray.detValues();
- double detPos [detArray.nDet()];
+ double* detPos = new double [detArray.nDet()];
for (int i = 0; i < detArray.nDet(); i++)
detPos[i] = i;
EZPlot ezplot (*m_pSGP);
ezplot.ezset("grid");
ezplot.ezset("box");
ezplot.addCurve (detValues, detPos, detArray.nDet());
- ezplot.plot();
+ ezplot.plot();\r
+ delete detPos;
}
}
}
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: dlgprojections.h,v 1.3 2000/09/02 16:40:36 kevin Exp $
+** $Id: dlgprojections.h,v 1.4 2000/12/16 03:29:02 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
Finished // finished, waiting to be removed from screen
} m_state;
- const static int ID_BTN_PAUSE = 19996;
- const static int ID_BTN_STEP = 19997;
+ enum { ID_BTN_PAUSE = 19996, ID_BTN_STEP = 19997 };
void showView (int iViewNumber);
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: dlgreconstruct.cpp,v 1.5 2000/09/07 14:29:05 kevin Exp $
+** $Id: dlgreconstruct.cpp,v 1.6 2000/12/16 03:29:02 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
static const int LAYOUT_X_MARGIN = 4;
static const int LAYOUT_Y_MARGIN = 4;
+\r
+\r
+const int ReconstructDialog::ID_BTN_PAUSE = 19998;\r
+const int ReconstructDialog::ID_BTN_STEP = 19999;\r
+const int ReconstructDialog::MAX_IMAGE_X = 400;\r
+const int ReconstructDialog::MAX_IMAGE_Y = 400;\r
+\r
BEGIN_EVENT_TABLE(ReconstructDialog, wxDialog)
EVT_BUTTON(wxID_CANCEL, ReconstructDialog::OnCancel)
}
unsigned char* imageData = new unsigned char [m_nxImage * m_nyImage * 3];
double dScale = 255 / (maxValue - minValue);
- for (int ix = 0; ix < m_nxImage; ix++) {
+ for (int ix2 = 0; ix2 < m_nxImage; ix2++) {
for (int iy = 0; iy < m_nyImage; iy++) {
- double dPixel = v[ix][iy];
+ double dPixel = v[ix2][iy];
dPixel = (dPixel - minValue) * dScale;
int intensity = nearest<int>(dPixel);
intensity = clamp (intensity, 0, 255);
- int baseAddr = ((m_nyImage - 1 - iy) * m_nxImage + ix) * 3;
+ int baseAddr = ((m_nyImage - 1 - iy) * m_nxImage + ix2) * 3;
imageData[baseAddr] = imageData[baseAddr+1] = imageData[baseAddr+2] = intensity;
}
}
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: dlgreconstruct.h,v 1.2 2000/09/04 09:06:46 kevin Exp $
+** $Id: dlgreconstruct.h,v 1.3 2000/12/16 03:29:02 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
Finished // finished, waiting to be removed from screen
} m_state;
- const static int ID_BTN_PAUSE = 19998;
- const static int ID_BTN_STEP = 19999;
- const static int MAX_IMAGE_X = 400;
- const static int MAX_IMAGE_Y = 400;
+ const static int ID_BTN_PAUSE;
+ const static int ID_BTN_STEP;
+ const static int MAX_IMAGE_X;
+ const static int MAX_IMAGE_Y;
void showView (int iViewNumber);
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: views.cpp,v 1.23 2000/10/11 08:16:08 kevin Exp $
+** $Id: views.cpp,v 1.24 2000/12/16 03:29:02 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
int nx = rIF.nx();
int ny = rIF.ny();
- if (pt.x >= 0 && pt.x < nx && pt.y >= 0 & pt.y < ny) {
+ if (pt.x >= 0 && pt.x < nx && pt.y >= 0 && pt.y < ny) {
ostringstream os;
os << "Image value (" << pt.x << "," << pt.y << ") = " << v[pt.x][ny - 1 - pt.y] << "\n";
*theApp->getLog() << os.str().c_str();
unsigned char* imageData = new unsigned char [nDet * nView * 3];
double scale = (max - min) / 255;
- for (int iy = 0; iy < nView; iy++) {
- const DetectorArray& detarray = rProj.getDetectorArray(iy);
+ for (int iy2 = 0; iy2 < nView; iy2++) {
+ const DetectorArray& detarray = rProj.getDetectorArray (iy2);
const DetectorValue* detval = detarray.detValues();
for (int ix = 0; ix < nDet; ix++) {
int intensity = static_cast<int>(((detval[ix] - min) / scale) + 0.5);
intensity = clamp(intensity, 0, 255);
- int baseAddr = (iy * nDet + ix) * 3;
+ int baseAddr = (iy2 * nDet + ix) * 3;
imageData[baseAddr] = imageData[baseAddr+1] = imageData[baseAddr+2] = intensity;
}
}