r198: *** empty log message ***
[ctsim.git] / libctsim / procsignal.cpp
index a9ab2c7956053165a89eff72eea2ad5ec813a5e5..5a52c03c300ea3108787bc8ad17dc4356a04c557 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: procsignal.cpp,v 1.6 2000/09/02 05:10:39 kevin Exp $
+**  $Id: procsignal.cpp,v 1.7 2000/09/07 14:29:05 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
@@ -178,6 +178,7 @@ ProcessSignal::init (const int idFilter, const int idFilterMethod, double dBandw
        m_adFilter = new double[ m_nFilterPoints ];
        double adFrequencyFilter [m_nFilterPoints];
        filter.copyFilterData (adFrequencyFilter, 0, m_nFilterPoints);
+#ifdef HAVE_SGP
        EZPlot* pEZPlot = NULL;
        if (pSGP && m_traceLevel >= Trace::TRACE_PLOT) {
          pEZPlot = new EZPlot (*pSGP);
@@ -186,8 +187,9 @@ ProcessSignal::init (const int idFilter, const int idFilterMethod, double dBandw
          pEZPlot->addCurve (adFrequencyFilter, m_nFilterPoints);
          pEZPlot->plot();
        }
-           
+#endif     
        shuffleNaturalToFourierOrder (adFrequencyFilter, m_nFilterPoints);
+#ifdef HAVE_SGP
        if (pEZPlot && m_traceLevel >= Trace::TRACE_PLOT) {
          pEZPlot->ezset ("title Filter Response: Fourier Order");
          pEZPlot->ezset ("ylength 0.25");
@@ -195,7 +197,9 @@ ProcessSignal::init (const int idFilter, const int idFilterMethod, double dBandw
          pEZPlot->addCurve (adFrequencyFilter, m_nFilterPoints);
          pEZPlot->plot();
        }
+#endif
        ProcessSignal::finiteFourierTransform (adFrequencyFilter, m_adFilter, m_nFilterPoints, -1);
+#ifdef HAVE_SGP
        if (pEZPlot && m_traceLevel >= Trace::TRACE_PLOT) {
          pEZPlot->ezset ("title Inverse Fourier Frequency: Fourier Order");
          pEZPlot->ezset ("ylength 0.25");
@@ -203,7 +207,9 @@ ProcessSignal::init (const int idFilter, const int idFilterMethod, double dBandw
          pEZPlot->addCurve (m_adFilter, m_nFilterPoints);
          pEZPlot->plot();
        }
+#endif
        shuffleFourierToNaturalOrder (m_adFilter, m_nFilterPoints);
+#ifdef HAVE_SGP
        if (pEZPlot && m_traceLevel >= Trace::TRACE_PLOT) {
          pEZPlot->ezset ("title Inverse Fourier Frequency: Natural Order");
          pEZPlot->ezset ("ylength 0.25");
@@ -212,6 +218,7 @@ ProcessSignal::init (const int idFilter, const int idFilterMethod, double dBandw
          pEZPlot->plot();
          delete pEZPlot;
        }
+#endif
        for (int i = 0; i < m_nFilterPoints; i++) {
            m_adFilter[i] /= m_dSignalInc;
        }
@@ -267,6 +274,8 @@ ProcessSignal::init (const int idFilter, const int idFilterMethod, double dBandw
       m_adFilter = new double [m_nFilterPoints];
       filter.copyFilterData (m_adFilter, 0, m_nFilterPoints);
 
+      // This doesn't work!
+      // Need to add filtering for divergent geometries & Frequency/Direct filtering
       if (m_idGeometry == Scanner::GEOMETRY_EQUILINEAR) {
        for (int i = 0; i < m_nFilterPoints; i++)
          m_adFilter[i] *= 0.5;
@@ -279,9 +288,10 @@ ProcessSignal::init (const int idFilter, const int idFilterMethod, double dBandw
          else
            sinScale = (iDetFromZero * m_dSignalInc) / sinScale;
          double dScale = 0.5 * sinScale * sinScale;
-         //      m_adFilter[i] *= dScale;
+         m_adFilter[i] *= dScale;
        }
       }
+#ifdef HAVE_SGP
       EZPlot* pEZPlot = NULL;
       if (pSGP && m_traceLevel >= Trace::TRACE_PLOT) {
        pEZPlot = new EZPlot (*pSGP);
@@ -291,7 +301,9 @@ ProcessSignal::init (const int idFilter, const int idFilterMethod, double dBandw
        pEZPlot->addCurve (m_adFilter, m_nFilterPoints);
        pEZPlot->plot();
       }
+#endif
       shuffleNaturalToFourierOrder (m_adFilter, m_nFilterPoints);
+#ifdef HAVE_SGP
       if (pEZPlot && m_traceLevel >= Trace::TRACE_PLOT) {
        pEZPlot->ezset ("title Filter Filter: Fourier Order");
        pEZPlot->ezset ("ylength 0.50");
@@ -300,6 +312,7 @@ ProcessSignal::init (const int idFilter, const int idFilterMethod, double dBandw
        pEZPlot->plot();
        delete pEZPlot;
       }
+#endif
     } else if (m_idFilterGeneration == FILTER_GENERATION_INVERSE_FOURIER) {
       // calculate number of filter points with zeropadding
       int nSpatialPoints = 2 * (m_nSignalPoints - 1) + 1;
@@ -323,6 +336,7 @@ ProcessSignal::init (const int idFilter, const int idFilterMethod, double dBandw
       double adSpatialFilter [m_nFilterPoints];
       SignalFilter filter (m_idFilter, m_dFilterMin, m_dFilterMax, nSpatialPoints, m_dBandwidth, m_dFilterParam, SignalFilter::DOMAIN_SPATIAL);
       filter.copyFilterData (adSpatialFilter, 0, nSpatialPoints);
+#ifdef HAVE_SGP
       EZPlot* pEZPlot = NULL;
       if (pSGP && m_traceLevel >= Trace::TRACE_PLOT) {
        pEZPlot = new EZPlot (*pSGP);
@@ -333,6 +347,7 @@ ProcessSignal::init (const int idFilter, const int idFilterMethod, double dBandw
        pEZPlot->plot();
        delete pEZPlot;
       }
+#endif
       if (m_idGeometry == Scanner::GEOMETRY_EQUILINEAR) {
        for (int i = 0; i < m_nFilterPoints; i++)
          adSpatialFilter[i] *= 0.5;
@@ -356,6 +371,7 @@ ProcessSignal::init (const int idFilter, const int idFilterMethod, double dBandw
       finiteFourierTransform (adSpatialFilter, acInverseFilter, m_nFilterPoints, 1);
       for (int i = 0; i < m_nFilterPoints; i++)
        m_adFilter[i] = abs(acInverseFilter[i]) * m_dSignalInc;
+#ifdef HAVE_SGP
       if (pEZPlot && m_traceLevel >= Trace::TRACE_PLOT) {
        pEZPlot->ezset ("title Spatial Filter: Inverse");
        pEZPlot->ezset ("ylength 0.50");
@@ -364,6 +380,7 @@ ProcessSignal::init (const int idFilter, const int idFilterMethod, double dBandw
        pEZPlot->plot();
        delete pEZPlot;
       }
+#endif
     }
   }