r166: *** empty log message ***
authorKevin M. Rosenberg <kevin@rosenberg.net>
Mon, 31 Jul 2000 14:48:35 +0000 (14:48 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Mon, 31 Jul 2000 14:48:35 +0000 (14:48 +0000)
12 files changed:
ChangeLog
configure
configure.in
include/phantom.h
include/scanner.h
libctgraphics/pol.cpp
libctgraphics/sgp.cpp
libctsim/filter.cpp
libctsim/phantom.cpp
libctsim/scanner.cpp
src/views.cpp
tools/phm2pj.cpp

index 73c2e1a2bf65087be469d8cd57e8cbbe89de4465..f80f630f7674c821c94e3d4a6594c0aaf1c2d307 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2.0.0-b8 - 8/1/00
    Added line color support to SGP
 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
        
 2.0.0-b7 - 7/25/00
    Finished support for dmallocxx library
index 7954212db097f6b6b88eb82255bd25813344c3d5..018913d4f5aa0e7fa8b1ce1abd0e95c5d3f84162 100755 (executable)
--- a/configure
+++ b/configure
@@ -712,7 +712,7 @@ fi
 
 PACKAGE=ctsim
 
 
 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; }
 
 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; }
index 153bd9471a20bf25a9881abaf3acf6d22f8172f9..6af88a0a8760bcdb78de093ae4f35f7d175a8d8b 100644 (file)
@@ -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)
 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.
 AM_CONFIG_HEADER(config.h)
 
 dnl Checks for programs.
index ae6a2350d845ded0409afc111ae36ab8f6009fc4..a4f29f22a787172367346af4cd8d7e7abb29bec0 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
 **  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
 **
 **  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;
 
 #if HAVE_SGP
     void show () const;
+    void show (SGP& sgp) const;
     void draw (SGP& sgp) const;
 #endif
     
     void draw (SGP& sgp) const;
 #endif
     
index 0ab132c0c79633e020b5f6d01841f98a44897e6c..887c06ecdd54da2badfa6ba97ffa58193ac97524 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
 **  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
 **
 **
 **  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 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);
 
 
   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);
 
index 9db01ce1c7b7797403882c6fe5e91eaadc81f2e0..dbc8b64d2915c53a40a60e782be55190067e86ab 100644 (file)
@@ -6,7 +6,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
 **  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
 **
 **  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 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 synerr(char *msg);
 static int pol_getch(FILE *fp);
-static void ungets(char *s);
 
 
 void pol_init (void)
 
 
 void pol_init (void)
@@ -171,7 +166,7 @@ void
 pol_skpword (char *w)
 {
        if (install (skiptable, w, 0) == NULL)
 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)
 }
 
 /* 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 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 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);
 static void 
 synerr (char *msg)
 {
        fputs (fname[currentf], stderr);
-        fprintf(stderr, "%d", linect[currentf]);
-       fputc (COLON, stderr);
        fputs (msg, stderr);
        fputc (NEWLINE, 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;
 
        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;
        } 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;
                return;
            }
            filep[currentf] = fp;
-           linect[currentf] = 1;
            fname[currentf] = strdup (fn);
        }
 }
            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)
 {
 int 
 get_inputline (FILE *fp)
 {
index bc789cf0fea2f685eed345e84b778d4b58741177..1062901737201670c32db960935990d70bc26d5e 100644 (file)
@@ -7,7 +7,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
 **  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
 **
 **  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;
 
   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
   
   if (clip_rect (x1, y1, x2, y2, viewNDC) == true) { // clip to viewport 
     stylusNDC (x1, y1, 0);  // move to first point
index 544afecbb8074ec5de18466d2490b99d5219d167..84d2e7b4e080f877d9d162973d548e70131be084 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
 **  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
 **
 **  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;
     } 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 (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;
     } else {
       m_failMessage = "Illegal domain name ";
       m_failMessage += m_idDomain;
index ac0fa4a83f76abc278d8f712b6941e13f2d6aa8b..ccf728a11d503c34c9ea1d507461c60efd1d78dd 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
 **  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
 **
 **  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);
 {
   SGPDriver driverSGP ("Phantom Show");
   SGP sgp (driverSGP);
-  draw (sgp);
+
+  show (sgp);
 
   cout << "Press return to continue";
   cio_kb_getc();
 }
 
   cout << "Press return to continue";
   cio_kb_getc();
 }
-#endif
-
 
 
-/* NAME
- *   draw              Draw vector outline of Phantom
- *
- * SYNOPSIS
- *   draw ()
- */
-
-#ifdef HAVE_SGP
 void 
 void 
-Phantom::draw (SGP& sgp) const
+Phantom::show (SGP& sgp) const
 {
   double wsize = m_xmax - m_xmin;
   if ((m_ymax - m_ymin) > wsize) 
 {
   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);
 
 
   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());
 }
   for (PElemIterator i = m_listPElem.begin(); i != m_listPElem.end(); i++)
     sgp.polylineAbs ((*i)->xOutline(), (*i)->yOutline(), (*i)->nOutlinePoints());
 }
index e39fca5d7ff0a8625c3d335893b0c641c1051bd6..75da0ae4e2986b7f1c600682df044f33fe9ab0a7 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
 **  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
 **
 **  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) {
 
 #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);
       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);
 #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);
       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) {
       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);
        }
          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) {
 
 #ifdef HAVE_SGP
        if (pSGP && m_trace >= TRACE_RAYS) {
+         pSGP->setColor (C_LTBLUE);
          pSGP->moveAbs (xs, ys);
          pSGP->lineAbs (xd, yd);
        }
          pSGP->moveAbs (xs, ys);
          pSGP->lineAbs (xd, yd);
        }
index 87e9e932135af1083e1f0cd4792ea9d63caf1011..077b9db2d9955bb0df51754a0155518fd400969f 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
 **  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
 **
 **  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);
   SGP sgp (driver);
   const Phantom& rPhantom = GetDocument()->getPhantom();
   sgp.setColor (C_RED);
-  rPhantom.draw (sgp);
+  rPhantom.show (sgp);
 }
 
 // ProjectionCanvas
 }
 
 // ProjectionCanvas
index 4c12ecf6f1e1d037bafdd731dc1821757ad4467f..a2b30216b7645624143b23b93ae662ace4f44b3c 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
 **  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
 **
 **  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) {
   SGP* pSGP = NULL;
 
   if (opt_trace >= TRACE_PHM) {
-    pSGPDriver = new SGPDriver ("phm2pj");
+    pSGPDriver = new SGPDriver ("phm2pj", 600, 600);
     pSGP = new SGP (*pSGPDriver);
   }
 
     pSGP = new SGP (*pSGPDriver);
   }