r129: *** empty log message ***
[ctsim.git] / libctsim / projections.cpp
index b54186447141fafa9f21b672dd120820c32bb20d..1d90776a039a15d85479c82b11327b7c0763586f 100644 (file)
@@ -8,7 +8,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: projections.cpp,v 1.9 2000/07/03 11:02:06 kevin Exp $
+**  $Id: projections.cpp,v 1.10 2000/07/04 18:33: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
@@ -516,20 +516,22 @@ Projections::reconstruct (ImageFile& im, const char* const filterName, double fi
 
 #if HAVE_SGP
   SGP_ID gid;
-  int n_vec_filter = filter.getNFilterPoints();
-  double plot_xaxis [n_vec_filter];                    // array for plotting 
+  int nVecFilter = filter.getNFilterPoints();
+  double plot_xaxis [nVecFilter];                      // array for plotting 
 
-  if (trace > TRACE_TEXT)  {
+  if (trace > TRACE_TEXT && nVecFilter > 0)  {
     int i;
     double f;
     double filterInc = filter.getFilterIncrement();
-    for (i = 0, f = filter.getFilterMin(); i < n_vec_filter; i++, f += filterInc)
+    for (i = 0, f = filter.getFilterMin(); i < nVecFilter; i++, f += filterInc) 
       plot_xaxis[i] = f;
-      
-    gid = ezplot (plot_xaxis, filter.getFilter(), n_vec_filter);
-    cio_put_str ("Press any key to continue");
-    cio_kb_getc ();
-    sgp2_close (gid);
+
+    if (filter.getFilter()) {
+      gid = ezplot (plot_xaxis, filter.getFilter(), nVecFilter);
+      cio_put_str ("Press any key to continue");
+      cio_kb_getc ();
+      sgp2_close (gid);
+    }
   }
   if (trace >= TRACE_TEXT) {
     printf ("nview=%d, ndet=%d, det_start=%.4f, detInc=%.4f\n", m_nView, m_nDet, m_detStart, m_detInc);
@@ -551,9 +553,6 @@ Projections::reconstruct (ImageFile& im, const char* const filterName, double fi
 
     filter.filterSignal (detval, filteredProj);
 
-    //    for (int j = 0; j < m_nDet; j++)
-    //      filteredProj[j] = filter.convolve (detval, detInc, j, m_nDet);
-
 #ifdef HAVE_SGP
     if (trace >= TRACE_PLOT)  {
       ezset  ("clear.");