From: Kevin M. Rosenberg Date: Fri, 12 Jan 2001 03:49:07 +0000 (+0000) Subject: r380: no message X-Git-Tag: debian-4.5.3-3~637 X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=commitdiff_plain;h=1f05afcd917bbf8b56a9446e4f937864f09b33f4 r380: no message --- diff --git a/ChangeLog b/ChangeLog index b961d68..f62ec4e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 3.0.0alpha5 - Released + * ctsim: Changed default reconstruction filter generation + * ctsimtext: Fixed bugs for MSVC and with empty input lines * syserror.cpp: fixed reporting for fatal errors diff --git a/libctsim/filter.cpp b/libctsim/filter.cpp index 60f97c8..26c1c0e 100644 --- a/libctsim/filter.cpp +++ b/libctsim/filter.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: filter.cpp,v 1.33 2001/01/02 16:02:13 kevin Exp $ +** $Id: filter.cpp,v 1.34 2001/01/12 03:49:07 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 @@ -559,30 +559,21 @@ SignalFilter::spatialResponseAnalytic (int filterID, double bw, double x, double } -/* NAME - * sinc Return sin(x)/x function - * - * SYNOPSIS - * v = sinc (x, mult) - * double v sinc value - * double x, mult - * - * DESCRIPTION - * v = sin(x * mult) / x; - */ +// Functions that are inline in filter.h + + +// sinc Return sin(x)/x function +// v = sinc (x, mult) +// Calculates sin(x * mult) / x; + +// integral_abscos Returns integral of u*cos(u) +// +// q = integral_abscos (u, w) +// double q Integral value +// double u Integration variable +// double w Upper integration boundary +// Returns the value of integral of u*cos(u)*dV for V = 0 to w -/* NAME - * integral_abscos Returns integral of u*cos(u) - * - * SYNOPSIS - * q = integral_abscos (u, w) - * double q Integral value - * double u Integration variable - * double w Upper integration boundary - * - * DESCRIPTION - * Returns the value of integral of u*cos(u)*dV for V = 0 to w - */ diff --git a/libctsim/procsignal.cpp b/libctsim/procsignal.cpp index 71a0e67..c40e297 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.14 2001/01/02 16:02:13 kevin Exp $ +** $Id: procsignal.cpp,v 1.15 2001/01/12 03:49:07 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 @@ -77,7 +77,10 @@ const int ProcessSignal::s_iFilterGenerationCount = sizeof(s_aszFilterGeneration // CLASS IDENTIFICATION // ProcessSignal // -ProcessSignal::ProcessSignal (const char* szFilterName, const char* szFilterMethodName, double dBandwidth, double dSignalIncrement, int nSignalPoints, double dFilterParam, const char* szDomainName, const char* szFilterGenerationName, int iZeropad, int iPreinterpolationFactor, int iTraceLevel, int iGeometry, double dFocalLength, SGP* pSGP) +ProcessSignal::ProcessSignal (const char* szFilterName, const char* szFilterMethodName, double dBandwidth, + double dSignalIncrement, int nSignalPoints, double dFilterParam, const char* szDomainName, + const char* szFilterGenerationName, int iZeropad, int iPreinterpolationFactor, int iTraceLevel, + int iGeometry, double dFocalLength, SGP* pSGP) : m_adFourierCosTable(NULL), m_adFourierSinTable(NULL), m_adFilter(NULL), m_fail(false) { m_idFilterMethod = convertFilterMethodNameToID (szFilterMethodName); @@ -109,12 +112,16 @@ ProcessSignal::ProcessSignal (const char* szFilterName, const char* szFilterMeth return; } - init (m_idFilter, m_idFilterMethod, dBandwidth, dSignalIncrement, nSignalPoints, dFilterParam, m_idDomain, m_idFilterGeneration, iZeropad, iPreinterpolationFactor, iTraceLevel, iGeometry, dFocalLength, pSGP); + init (m_idFilter, m_idFilterMethod, dBandwidth, dSignalIncrement, nSignalPoints, dFilterParam, m_idDomain, + m_idFilterGeneration, iZeropad, iPreinterpolationFactor, iTraceLevel, iGeometry, dFocalLength, pSGP); } void -ProcessSignal::init (const int idFilter, const int idFilterMethod, double dBandwidth, double dSignalIncrement, int nSignalPoints, double dFilterParam, const int idDomain, const int idFilterGeneration, const int iZeropad, const int iPreinterpolationFactor, int iTraceLevel, int iGeometry, double dFocalLength, SGP* pSGP) +ProcessSignal::init (const int idFilter, const int idFilterMethod, double dBandwidth, double dSignalIncrement, + int nSignalPoints, double dFilterParam, const int idDomain, const int idFilterGeneration, + const int iZeropad, const int iPreinterpolationFactor, int iTraceLevel, int iGeometry, + double dFocalLength, SGP* pSGP) { int i; m_idFilter = idFilter; @@ -139,7 +146,8 @@ ProcessSignal::init (const int idFilter, const int idFilterMethod, double dBandw m_iPreinterpolationFactor = iPreinterpolationFactor; // scale signalInc/BW to signalInc/2 to adjust for imaginary detector - // through origin of phantom, see Kak-Slaney Fig 3.22, for Collinear + // through origin of phantom rather than 2 times distance to detector, + // see Kak-Slaney Fig 3.22, for Collinear diagram if (m_idGeometry == Scanner::GEOMETRY_EQUILINEAR) { m_dSignalInc /= 2; m_dBandwidth *= 2; @@ -278,6 +286,9 @@ ProcessSignal::init (const int idFilter, const int idFilterMethod, double dBandw // 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 + if (m_idGeometry == Scanner::GEOMETRY_EQUILINEAR) { for (i = 0; i < m_nFilterPoints; i++) m_adFilter[i] *= 0.5; @@ -350,6 +361,7 @@ ProcessSignal::init (const int idFilter, const int idFilterMethod, double dBandw delete pEZPlot; } #endif + if (m_idGeometry == Scanner::GEOMETRY_EQUILINEAR) { for (i = 0; i < m_nFilterPoints; i++) adSpatialFilter[i] *= 0.5; @@ -375,6 +387,7 @@ ProcessSignal::init (const int idFilter, const int idFilterMethod, double dBandw for (i = 0; i < m_nFilterPoints; i++) m_adFilter[i] = std::abs (acInverseFilter[i]) * m_dSignalInc; delete acInverseFilter; + #ifdef HAVE_SGP if (pEZPlot && m_traceLevel >= Trace::TRACE_PLOT) { pEZPlot->ezset ("title Spatial Filter: Inverse"); diff --git a/msvc/ctsim/ctsim.plg b/msvc/ctsim/ctsim.plg index 80c16f3..f011491 100644 --- a/msvc/ctsim/ctsim.plg +++ b/msvc/ctsim/ctsim.plg @@ -3,9 +3,74 @@
 

Build Log

+--------------------Configuration: libctsim - Win32 Debug-------------------- +

+

Command Lines

+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP2F.tmp" with contents +[ +/nologo /G6 /MTd /W3 /Gm /GR /GX /ZI /Od /I "..\..\..\zlib" /I "..\..\INCLUDE" /I "..\..\getopt" /I "..\..\..\lpng108" /I "..\..\..\fftw-2.1.3\fftw" /I "..\..\..\fftw-2.1.3\rfftw" /I "..\..\..\wx2\include" /D "_DEBUG" /D "HAVE_WXWIN" /D "HAVE_STRING_H" /D "HAVE_GETOPT_H" /D "WIN32" /D "_MBCS" /D "_LIB" /D "MSVC" /D "HAVE_FFTW" /D "HAVE_PNG" /D "HAVE_SGP" /D "HAVE_WXWINDOWS" /D "__WXMSW__" /FR"Debug/" /Fp"Debug/libctsim.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c +"D:\ctsim\libctsim\procsignal.cpp" +] +Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP2F.tmp" +Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP30.tmp" with contents +[ +/nologo /out:"Debug\libctsim.lib" +.\Debug\array2dfile.obj +.\Debug\backprojectors.obj +.\Debug\clip.obj +.\Debug\consoleio.obj +.\Debug\ezplot.obj +.\Debug\ezset.obj +.\Debug\ezsupport.obj +.\Debug\filter.obj +.\Debug\fnetorderstream.obj +.\Debug\fourier.obj +.\Debug\getopt.obj +.\Debug\getopt1.obj +.\Debug\hashtable.obj +.\Debug\imagefile.obj +.\Debug\mathfuncs.obj +.\Debug\phantom.obj +.\Debug\plotfile.obj +.\Debug\pol.obj +.\Debug\procsignal.obj +.\Debug\projections.obj +.\Debug\reconstruct.obj +.\Debug\scanner.obj +.\Debug\sgp.obj +.\Debug\strfuncs.obj +.\Debug\syserror.obj +.\Debug\trace.obj +.\Debug\transformmatrix.obj +.\Debug\xform.obj +] +Creating command line "link.exe -lib @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP30.tmp" +

Output Window

+Compiling... +procsignal.cpp +Creating library... +

--------------------Configuration: ctsim - Win32 Debug--------------------

Command Lines

+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP31.tmp" with contents +[ +comctl32.lib winmm.lib rpcrt4.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../libctsim/Debug/libctsim.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\..\lpng108\msvc\win32\libpng\lib_dbg\libpng.lib ..\..\..\lpng108\msvc\win32\zlib\lib_dbg\zlib.lib libcmtd.lib ..\..\..\fftw-2.1.3\Win32\FFTW2st\Debug\FFTW2st.lib ..\..\..\fftw-2.1.3\Win32\RFFTW2st\Debug\RFFTW2st.lib ../../../wx2/lib/wxd.lib /nologo /subsystem:windows /incremental:yes /pdb:"Debug/ctsim.pdb" /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /nodefaultlib:"msvcrtd.lib" /out:"Debug/ctsim.exe" /pdbtype:sept /libpath:"..\..\..\lpng108\msvc\win32\libpng\lib" /libpath:"..\..\..\lpng108\msvc\win32\zlib\lib" +.\Debug\ctsim.obj +.\Debug\dialogs.obj +.\Debug\dlgprojections.obj +.\Debug\dlgreconstruct.obj +.\Debug\docs.obj +.\Debug\views.obj +.\Debug\wx.res +\ctsim\msvc\libctsim\Debug\libctsim.lib +"\fftw-2.1.3\Win32\FFTW2st\Debug\FFTW2st.lib" +"\fftw-2.1.3\Win32\RFFTW2st\Debug\RFFTW2st.lib" +\wx2\lib\wxd.lib +] +Creating command line "link.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP31.tmp" +

Output Window

+Linking... diff --git a/src/views.cpp b/src/views.cpp index c5fed7c..02ded20 100644 --- a/src/views.cpp +++ b/src/views.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: views.cpp,v 1.57 2001/01/08 02:03:24 kevin Exp $ +** $Id: views.cpp,v 1.58 2001/01/12 03:49:07 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 @@ -2009,7 +2009,7 @@ ProjectionFileView::ProjectionFileView(void) m_dDefaultFilterParam = 1.; #if HAVE_FFTW m_iDefaultFilterMethod = ProcessSignal::FILTER_METHOD_RFFTW; - m_iDefaultFilterGeneration = ProcessSignal::FILTER_GENERATION_INVERSE_FOURIER; + m_iDefaultFilterGeneration = ProcessSignal::FILTER_GENERATION_DIRECT; #else m_iDefaultFilterMethod = ProcessSignal::FILTER_METHOD_CONVOLUTION; m_iDefaultFilterGeneration = ProcessSignal::FILTER_GENERATION_DIRECT; @@ -2147,9 +2147,11 @@ ProjectionFileView::OnReconstructFBP (wxCommandEvent& event) const Projections& rProj = GetDocument()->getProjections(); imageFile.setArraySize (m_iDefaultNX, m_iDefaultNY); - if (m_iDefaultFilterMethod != ProcessSignal::FILTER_METHOD_CONVOLUTION && m_iDefaultFilterGeneration == ProcessSignal::FILTER_GENERATION_DIRECT && rProj.geometry() != Scanner::GEOMETRY_PARALLEL) { - wxMessageBox ("Sorry!\nCurrently, frequency-based filtering with direct filter generation is not support for geometries other than parallel.\nAborting command.", "Not Supported", wxOK | wxICON_WARNING, m_frame); - return; + if (m_iDefaultFilterMethod != ProcessSignal::FILTER_METHOD_CONVOLUTION && + m_iDefaultFilterGeneration == ProcessSignal::FILTER_GENERATION_INVERSE_FOURIER && + rProj.geometry() == Scanner::GEOMETRY_EQUIANGULAR) { + wxMessageBox ("Sorry!\nCurrently, frequency-based filtering with inverse_fourier filter generation is not supported equiangular geometry.\nAborting command.", "Not Supported", wxOK | wxICON_WARNING, m_frame); + // return; } Reconstructor* pReconstruct = new Reconstructor (rProj, imageFile, optFilterName.c_str(), m_dDefaultFilterParam, optFilterMethodName.c_str(), m_iDefaultZeropad, optFilterGenerationName.c_str(), optInterpName.c_str(), m_iDefaultInterpParam, optBackprojectName.c_str(), m_iDefaultTrace);