X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=libctsim%2Fprocsignal.cpp;fp=libctsim%2Fprocsignal.cpp;h=155d8944f0c0ac67ae03a31bd1113c83c58eebc4;hp=b717f8037e104bebc5a453e4571249e5f81173e3;hb=efc79bd4b7deba9df501fccd39bc342f1329e6e6;hpb=ed576a069b0ba9de2e9153707012eba620ac606e diff --git a/libctsim/procsignal.cpp b/libctsim/procsignal.cpp index b717f80..155d894 100644 --- a/libctsim/procsignal.cpp +++ b/libctsim/procsignal.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: procsignal.cpp,v 1.20 2001/01/12 21:53:27 kevin Exp $ +** $Id: procsignal.cpp,v 1.21 2001/01/13 02:55:14 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 @@ -297,10 +297,9 @@ ProcessSignal::init (const int idFilter, const int idFilterMethod, double dBandw } #endif - // This doesn't work: Need to add filtering for divergent geometries & Frequency/Direct filtering - // Jan 2001: Direct seems to work for equilinear and equiangular - // however, inverse_fourier doesn't work for equiangular on all versions of CTSim tested - // Scaling is done with data in frequency space, natural order + // This works fairly well. I'm not sure why since scaling for geometries is done on + // frequency filter rather than spatial filter as it should be. + // It gives values slightly off than freq/inverse filtering if (m_idGeometry == Scanner::GEOMETRY_EQUILINEAR) { for (i = 0; i < m_nFilterPoints; i++) m_adFilter[i] *= 0.5; @@ -365,8 +364,6 @@ ProcessSignal::init (const int idFilter, const int idFilterMethod, double dBandw } #endif -#define PRE_JAN_2001 1 -#ifdef PRE_JAN_2001 if (m_idGeometry == Scanner::GEOMETRY_EQUILINEAR) { for (i = 0; i < nSpatialPoints; i++) adSpatialFilter[i] *= 0.5; @@ -408,68 +405,6 @@ ProcessSignal::init (const int idFilter, const int idFilterMethod, double dBandw dlgEZPlot.ShowModal(); } #endif - -#else - for (i = nSpatialPoints; i < m_nFilterPoints; i++) - adSpatialFilter[i] = 0; - - std::complex* acInverseFilter = new std::complex [m_nFilterPoints]; - finiteFourierTransform (adSpatialFilter, acInverseFilter, m_nFilterPoints, FORWARD); - delete adSpatialFilter; - m_adFilter = new double [m_nFilterPoints]; - for (i = 0; i < m_nFilterPoints; i++) - m_adFilter[i] = std::abs(acInverseFilter[i]); - delete acInverseFilter; - -#if defined(HAVE_WXWINDOWS) && (defined(DEBUG) || defined(_DEBUG)) - if (g_bRunningWXWindows && m_traceLevel > 0) { - EZPlotDialog dlgEZPlot; - dlgEZPlot.getEZPlot()->ezset ("title Inverse Spatial Filter: Fourier order"); - dlgEZPlot.getEZPlot()->addCurve (m_adFilter, m_nFilterPoints); - dlgEZPlot.ShowModal(); - } -#endif - Fourier::shuffleFourierToNaturalOrder(m_adFilter, m_nFilterPoints); -#if defined(HAVE_WXWINDOWS) && (defined(DEBUG) || defined(_DEBUG)) - if (g_bRunningWXWindows && m_traceLevel > 0) { - EZPlotDialog dlgEZPlot; - dlgEZPlot.getEZPlot()->ezset ("title Inverse Spatial Filter: Natural order"); - dlgEZPlot.getEZPlot()->addCurve (m_adFilter, m_nFilterPoints); - dlgEZPlot.ShowModal(); - } -#endif - if (m_idGeometry == Scanner::GEOMETRY_EQUILINEAR) { - for (i = 0; i < m_nFilterPoints; i++) - m_adFilter[i] *= 0.5; - } else if (m_idGeometry == Scanner::GEOMETRY_EQUIANGULAR) { - for (i = 0; i < m_nFilterPoints; i++) { - int iDetFromZero = i - ((m_nFilterPoints - 1) / 2); - if (abs(iDetFromZero) < m_nSignalPoints) { - double sinScale = 1 / SignalFilter::sinc (iDetFromZero * m_dSignalInc); - double dScale = 0.5 * sinScale * sinScale; - m_adFilter[i] *= dScale; - } - } - } -#if defined(HAVE_WXWINDOWS) && (defined(DEBUG) || defined(_DEBUG)) - if (g_bRunningWXWindows && m_traceLevel > 0) { - EZPlotDialog dlgEZPlot; - dlgEZPlot.getEZPlot()->ezset ("title Scaled Inverse Spatial Filter: Natural order"); - dlgEZPlot.getEZPlot()->addCurve (m_adFilter, m_nFilterPoints); - dlgEZPlot.ShowModal(); - } -#endif - Fourier::shuffleNaturalToFourierOrder(m_adFilter, m_nFilterPoints); -#endif - -#if defined(HAVE_WXWINDOWS) && (defined(DEBUG) || defined(_DEBUG)) - if (g_bRunningWXWindows && m_traceLevel > 0) { - EZPlotDialog dlgEZPlot; - dlgEZPlot.getEZPlot()->ezset ("title Spatial Filter Inverse Post Geometry Filtering"); - dlgEZPlot.getEZPlot()->addCurve (m_adFilter, m_nFilterPoints); - dlgEZPlot.ShowModal(); - } -#endif } }