** 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
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);
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");
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");
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");
pEZPlot->plot();
delete pEZPlot;
}
+#endif
for (int i = 0; i < m_nFilterPoints; i++) {
m_adFilter[i] /= m_dSignalInc;
}
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;
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);
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");
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;
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);
pEZPlot->plot();
delete pEZPlot;
}
+#endif
if (m_idGeometry == Scanner::GEOMETRY_EQUILINEAR) {
for (int i = 0; i < m_nFilterPoints; i++)
adSpatialFilter[i] *= 0.5;
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");
pEZPlot->plot();
delete pEZPlot;
}
+#endif
}
}