From 980bef9b95bef1ab728634181a5672088fd47066 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Mon, 31 Jul 2000 14:48:35 +0000 Subject: [PATCH] r166: *** empty log message *** --- ChangeLog | 1 + configure | 2 +- configure.in | 2 +- include/phantom.h | 3 ++- include/scanner.h | 4 ++-- libctgraphics/pol.cpp | 49 ++----------------------------------------- libctgraphics/sgp.cpp | 4 ++-- libctsim/filter.cpp | 9 ++++++-- libctsim/phantom.cpp | 33 +++++++++++++++++------------ libctsim/scanner.cpp | 6 +++++- src/views.cpp | 4 ++-- tools/phm2pj.cpp | 4 ++-- 12 files changed, 47 insertions(+), 74 deletions(-) diff --git a/ChangeLog b/ChangeLog index 73c2e1a..f80f630 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 2.0.0-b8 - 8/1/00 Added line color support to SGP + Fixed lineAbs bug 2.0.0-b7 - 7/25/00 Finished support for dmallocxx library diff --git a/configure b/configure index 7954212..018913d 100755 --- a/configure +++ b/configure @@ -712,7 +712,7 @@ fi PACKAGE=ctsim -VERSION=2.0.0-b8 +VERSION=2.0.0b8 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } diff --git a/configure.in b/configure.in index 153bd94..6af88a0 100644 --- a/configure.in +++ b/configure.in @@ -4,7 +4,7 @@ dnl Must reset CDPATH so that bash's cd does not print to stdout dnl CDPATH= AC_INIT(src/ctsim.cpp) -AM_INIT_AUTOMAKE(ctsim,2.0.0-b8) +AM_INIT_AUTOMAKE(ctsim,2.0.0b8) AM_CONFIG_HEADER(config.h) dnl Checks for programs. diff --git a/include/phantom.h b/include/phantom.h index ae6a235..a4f29f2 100644 --- a/include/phantom.h +++ b/include/phantom.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: phantom.h,v 1.11 2000/07/28 08:28:08 kevin Exp $ +** $Id: phantom.h,v 1.12 2000/07/31 14:48:35 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 @@ -171,6 +171,7 @@ class Phantom #if HAVE_SGP void show () const; + void show (SGP& sgp) const; void draw (SGP& sgp) const; #endif diff --git a/include/scanner.h b/include/scanner.h index 0ab132c..887c06e 100644 --- a/include/scanner.h +++ b/include/scanner.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: scanner.h,v 1.9 2000/07/28 08:28:08 kevin Exp $ +** $Id: scanner.h,v 1.10 2000/07/31 14:48:35 kevin Exp $ ** ** ** This program is free software; you can redistribute it and/or modify @@ -120,7 +120,7 @@ class Scanner static const char* s_aszGeometryName[]; static const char* s_aszGeometryTitle[]; static const int s_iGeometryCount; - static const int N_EXTRA_DETECTORS=4; /* Number of extra detectors widths when calculating detlen */ + static const int N_EXTRA_DETECTORS=0; // Number of extra detectors widths when calculating detlen void projectSingleView (const Phantom& phm, DetectorArray& darray, const double xd1, const double yd1, const double xd2, const double yd2, const double xs1, const double ys1, const double xs2, const double ys2, SGP* pSGP); diff --git a/libctgraphics/pol.cpp b/libctgraphics/pol.cpp index 9db01ce..dbc8b64 100644 --- a/libctgraphics/pol.cpp +++ b/libctgraphics/pol.cpp @@ -6,7 +6,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: pol.cpp,v 1.1 2000/07/30 15:58:18 kevin Exp $ +** $Id: pol.cpp,v 1.2 2000/07/31 14:48:35 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 @@ -125,13 +125,8 @@ static void freetable(SYMBOL *table[]); static int hash(char *s); static SYMBOL *lookup(SYMBOL *table[], char *s); static SYMBOL *install(SYMBOL *table[], char *s, int def); -static void outch(int c); -static void inc_line(void); -static int getlinect(void); -static void setlinect(int n); static void synerr(char *msg); static int pol_getch(FILE *fp); -static void ungets(char *s); void pol_init (void) @@ -171,7 +166,7 @@ void pol_skpword (char *w) { if (install (skiptable, w, 0) == NULL) - synerr ("Too many skip words defined"); + sys_error (ERR_SEVERE, "Too many skip words defined"); } /* pol_skpchar (s) @@ -979,42 +974,14 @@ install (SYMBOL *table[], char *name, int def) static int currentf = -1; /* pointer to current fp */ static FILE *filep[MAXFILE]; /* == NULL for string input */ static char *fname[MAXFILE]; /* pointer to filename */ -static int linect[MAXFILE]; /* line count in file */ static char inputline[MAXLINE]; /* current input line */ static int lineptr; /* current position in inputline */ -static void -outch (int c) -{ - putchar (c); -} - - -static void inc_line(void) -{ - if (currentf >= 0) - ++linect[currentf]; -} - -static int getlinect(void) -{ - return (linect[currentf]); -} - -static void -setlinect (int n) -{ - if (currentf >= 0) - linect[currentf] = n; -} - static void synerr (char *msg) { fputs (fname[currentf], stderr); - fprintf(stderr, "%d", linect[currentf]); - fputc (COLON, stderr); fputs (msg, stderr); fputc (NEWLINE, stderr); } @@ -1051,7 +1018,6 @@ pol_usefile (int source, char *fn) if (source == P_USE_STR) { filep[currentf] = NULL; - linect[currentf] = 1; } else if (source == P_USE_FILE) { if (fn == NULL || strlen(fn) == 0) { fp = stdin; @@ -1061,7 +1027,6 @@ pol_usefile (int source, char *fn) return; } filep[currentf] = fp; - linect[currentf] = 1; fname[currentf] = strdup (fn); } } @@ -1140,16 +1105,6 @@ pol_ungetch (int c) } -/* push back string onto input */ -static void -ungets (char *s) -{ - int i; - - for (i = strlen(s) - 1; i >= 0; i--) - pol_ungetch (s[i]); -} - int get_inputline (FILE *fp) { diff --git a/libctgraphics/sgp.cpp b/libctgraphics/sgp.cpp index bc789cf..1062901 100644 --- a/libctgraphics/sgp.cpp +++ b/libctgraphics/sgp.cpp @@ -7,7 +7,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: sgp.cpp,v 1.7 2000/07/29 19:50:08 kevin Exp $ +** $Id: sgp.cpp,v 1.8 2000/07/31 14:48:35 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 @@ -261,7 +261,7 @@ SGP::lineAbs (double x, double y) double x2 = x; double y2 = y; - mc_to_ndc.transformPoint (&x1, &y2); + mc_to_ndc.transformPoint (&x2, &y2); if (clip_rect (x1, y1, x2, y2, viewNDC) == true) { // clip to viewport stylusNDC (x1, y1, 0); // move to first point diff --git a/libctsim/filter.cpp b/libctsim/filter.cpp index 544afec..84d2e7b 100644 --- a/libctsim/filter.cpp +++ b/libctsim/filter.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: filter.cpp,v 1.22 2000/07/23 01:49:03 kevin Exp $ +** $Id: filter.cpp,v 1.23 2000/07/31 14:48:35 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 @@ -317,11 +317,16 @@ SignalFilter::init (const int filterID, const int filterMethodID, double bw, dou } else if (m_idDomain == DOMAIN_SPATIAL) { double x; int i; - for (x = m_filterMin, i = 0; i < m_nFilterPoints; x += m_filterInc, i++) + for (x = m_filterMin, i = 0; i < m_nFilterPoints; x += m_filterInc, i++) { if (haveAnalyticSpatial(m_idFilter)) m_vecFilter[i] = spatialResponseAnalytic (x, m_filterParam); else m_vecFilter[i] = spatialResponseCalc (x, m_filterParam); +#if LIMIT_BANDWIDTH_TRIAL + if (i < m_nFilterPoints / 4 || i > (m_nFilterPoints * 3) / 4) + m_vecFilter[i] = 0; +#endif + } } else { m_failMessage = "Illegal domain name "; m_failMessage += m_idDomain; diff --git a/libctsim/phantom.cpp b/libctsim/phantom.cpp index ac0fa4a..ccf728a 100644 --- a/libctsim/phantom.cpp +++ b/libctsim/phantom.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: phantom.cpp,v 1.13 2000/07/29 19:50:08 kevin Exp $ +** $Id: phantom.cpp,v 1.14 2000/07/31 14:48:35 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 @@ -308,24 +308,15 @@ Phantom::show () const { SGPDriver driverSGP ("Phantom Show"); SGP sgp (driverSGP); - draw (sgp); + + show (sgp); cout << "Press return to continue"; cio_kb_getc(); } -#endif - -/* NAME - * draw Draw vector outline of Phantom - * - * SYNOPSIS - * draw () - */ - -#ifdef HAVE_SGP void -Phantom::draw (SGP& sgp) const +Phantom::show (SGP& sgp) const { double wsize = m_xmax - m_xmin; if ((m_ymax - m_ymin) > wsize) @@ -338,6 +329,22 @@ Phantom::draw (SGP& sgp) const sgp.setWindow (xcent - halfWindow, ycent - halfWindow, xcent + halfWindow, ycent + halfWindow); + draw (sgp); +} +#endif + + +/* NAME + * draw Draw vector outline of Phantom + * + * SYNOPSIS + * draw () + */ + +#ifdef HAVE_SGP +void +Phantom::draw (SGP& sgp) const +{ for (PElemIterator i = m_listPElem.begin(); i != m_listPElem.end(); i++) sgp.polylineAbs ((*i)->xOutline(), (*i)->yOutline(), (*i)->nOutlinePoints()); } diff --git a/libctsim/scanner.cpp b/libctsim/scanner.cpp index e39fca5..75da0ae 100644 --- a/libctsim/scanner.cpp +++ b/libctsim/scanner.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: scanner.cpp,v 1.7 2000/07/29 19:50:08 kevin Exp $ +** $Id: scanner.cpp,v 1.8 2000/07/31 14:48:35 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 @@ -260,6 +260,7 @@ Scanner::collectProjections (Projections& proj, const Phantom& phm, const int st #ifdef HAVE_SGP if (pSGP && m_trace >= TRACE_PHM) { + pSGP->setColor (C_RED); pSGP->moveAbs (xd1, yd1); pSGP->lineAbs (xd2, yd2); pSGP->moveAbs (xs1, ys1); @@ -275,6 +276,7 @@ Scanner::collectProjections (Projections& proj, const Phantom& phm, const int st #ifdef HAVE_SGP if (pSGP && m_trace >= TRACE_PHM) { // rs_plot (detArray, xd1, yd1, xcent, ycent, theta); + pSGP->setColor (C_RED); pSGP->moveAbs (xd1, yd1); pSGP->lineAbs (xd2, yd2); pSGP->moveAbs (xs1, ys1); @@ -348,6 +350,7 @@ Scanner::projectSingleView (const Phantom& phm, DetectorArray& detArray, const d for (unsigned int i = 0; i < m_nSample; i++) { #ifdef HAVE_SGP if (pSGP && m_trace >= TRACE_RAYS) { + pSGP->setColor (C_LTBLUE); pSGP->moveAbs (xs, ys); pSGP->lineAbs (xd, yd); } @@ -359,6 +362,7 @@ Scanner::projectSingleView (const Phantom& phm, DetectorArray& detArray, const d #ifdef HAVE_SGP if (pSGP && m_trace >= TRACE_RAYS) { + pSGP->setColor (C_LTBLUE); pSGP->moveAbs (xs, ys); pSGP->lineAbs (xd, yd); } diff --git a/src/views.cpp b/src/views.cpp index 87e9e93..077b9db 100644 --- a/src/views.cpp +++ b/src/views.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: views.cpp,v 1.10 2000/07/29 19:50:08 kevin Exp $ +** $Id: views.cpp,v 1.11 2000/07/31 14:48:35 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 @@ -563,7 +563,7 @@ PhantomView::OnDraw (wxDC* dc) SGP sgp (driver); const Phantom& rPhantom = GetDocument()->getPhantom(); sgp.setColor (C_RED); - rPhantom.draw (sgp); + rPhantom.show (sgp); } // ProjectionCanvas diff --git a/tools/phm2pj.cpp b/tools/phm2pj.cpp index 4c12ecf..a2b3021 100644 --- a/tools/phm2pj.cpp +++ b/tools/phm2pj.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: phm2pj.cpp,v 1.5 2000/07/28 08:28:08 kevin Exp $ +** $Id: phm2pj.cpp,v 1.6 2000/07/31 14:48:35 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 @@ -290,7 +290,7 @@ phm2pj_main (int argc, char* argv[]) SGP* pSGP = NULL; if (opt_trace >= TRACE_PHM) { - pSGPDriver = new SGPDriver ("phm2pj"); + pSGPDriver = new SGPDriver ("phm2pj", 600, 600); pSGP = new SGP (*pSGPDriver); } -- 2.34.1