From: Kevin M. Rosenberg Date: Sun, 7 Jan 2001 23:18:13 +0000 (+0000) Subject: r360: no message X-Git-Tag: debian-4.5.3-3~657 X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=commitdiff_plain;h=e96390a84a8df18305c63263466c522fbc680055 r360: no message --- diff --git a/libctsim/projections.cpp b/libctsim/projections.cpp index 4d78cd7..846daf3 100644 --- a/libctsim/projections.cpp +++ b/libctsim/projections.cpp @@ -8,7 +8,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: projections.cpp,v 1.40 2001/01/07 23:03:28 kevin Exp $ +** $Id: projections.cpp,v 1.41 2001/01/07 23:18:13 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 @@ -816,9 +816,9 @@ Projections::interpolatePolar (ImageFileArray& v, ImageFileArray& vImag, v[ix][iy] = 0; } } else if (iInterpolationID == POLAR_INTERP_BILINEAR) { - int iFloorView = ppdView[ix][iy]; + int iFloorView = static_cast(ppdView[ix][iy]); double dFracView = ppdView[ix][iy] - iFloorView; - int iFloorDet = ppdDet[ix][iy]; + int iFloorDet = static_cast(ppdDet[ix][iy]); double dFracDet = ppdDet[ix][iy] - iFloorDet; if (iFloorDet >= 0 && iFloorView >= 0) { diff --git a/msvc/ctsim/ctsim.plg b/msvc/ctsim/ctsim.plg index 8fb781f..03b4431 100644 --- a/msvc/ctsim/ctsim.plg +++ b/msvc/ctsim/ctsim.plg @@ -6,7 +6,13 @@ --------------------Configuration: ctsim - Win32 Debug--------------------

Command Lines

-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP9.tmp" with contents +Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP33.tmp" with contents +[ +/nologo /G6 /MTd /W3 /Gm /GR /GX /ZI /Od /I "\wx2\include" /I "." /I "..\..\include" /I "..\..\getopt" /I "..\..\..\lpng108" /I "..\..\..\zlib" /I "..\..\..\fftw-2.1.3\fftw" /I "..\..\..\fftw-2.1.3\rfftw" /D VERSION=\"2.5.0\" /D "_DEBUG" /D "__WXMSW__" /D "HAVE_SGP" /D "HAVE_PNG" /D "HAVE_WXWINDOWS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "HAVE_STRING_H" /D "HAVE_FFTW" /D "HAVE_RFFTW" /D "HAVE_GETOPT_H" /D "MSVC" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D CTSIMVERSION=\"3.0.0beta1\" /FR"Debug/" /Fp"Debug/ctsim.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c +"C:\ctsim\src\views.cpp" +] +Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP33.tmp" +Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP34.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 @@ -21,8 +27,10 @@ comctl32.lib winmm.lib rpcrt4.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib w "\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\RSP9.tmp" +Creating command line "link.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP34.tmp"

Output Window

+Compiling... +views.cpp Linking... diff --git a/src/views.cpp b/src/views.cpp index f52b611..cf8497b 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.53 2001/01/07 22:53:36 kevin Exp $ +** $Id: views.cpp,v 1.54 2001/01/07 23:18:13 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 @@ -1138,11 +1138,11 @@ ImageFileView::OnPlotCol (wxCommandEvent& event) if (v != NULL && xCursor < nx) { double* pX = new double [ny]; - double* pYReal = new double [nx]; + double* pYReal = new double [ny]; double *pYImag, *pYMag; if (rIF.isComplex()) { - pYImag = new double [nx]; - pYMag = new double [nx]; + pYImag = new double [ny]; + pYMag = new double [ny]; } for (int i = 0; i < ny; i++) { pX[i] = i; @@ -1177,9 +1177,9 @@ ImageFileView::OnPlotCol (wxCommandEvent& event) rPlotFile.addEzsetCommand ("curve 3"); rPlotFile.addEzsetCommand ("color 0"); rPlotFile.addEzsetCommand ("solid"); - rPlotFile.setCurveSize (4, nx); + rPlotFile.setCurveSize (4, ny); } else - rPlotFile.setCurveSize (2, nx); + rPlotFile.setCurveSize (2, ny); rPlotFile.addColumn (0, pX); rPlotFile.addColumn (1, pYReal); if (rIF.isComplex()) { @@ -1272,7 +1272,6 @@ ImageFileView::OnPlotFFTRow (wxCommandEvent& event) rPlotFile.addEzsetCommand ("curve 3"); rPlotFile.addEzsetCommand ("color 0"); rPlotFile.addEzsetCommand ("solid"); - rPlotFile.setCurveSize (4, nx); rPlotFile.addEzsetCommand ("box"); rPlotFile.addEzsetCommand ("grid"); rPlotFile.setCurveSize (4, nx); @@ -1309,16 +1308,46 @@ ImageFileView::OnPlotFFTCol (wxCommandEvent& event) const ImageFile& rIF = dynamic_cast(GetDocument())->getImageFile(); ImageFileArrayConst v = rIF.getArray(); + ImageFileArrayConst vImag = rIF.getImaginaryArray(); int nx = rIF.nx(); int ny = rIF.ny(); if (v != NULL && xCursor < nx) { + fftw_complex* pcIn = new fftw_complex [ny]; + double *pdTemp = new double [ny]; + + int i; + for (i = 0; i < ny; i++) + pdTemp[i] = v[xCursor][i]; + Fourier::shuffleNaturalToFourierOrder (pdTemp, ny); + for (i = 0; i < ny; i++) + pcIn[i].re = pdTemp[i]; + + for (i = 0; i < ny; i++) { + if (rIF.isComplex()) + pdTemp[i] = vImag[xCursor][i]; + else + pdTemp[i] = 0; + } + Fourier::shuffleNaturalToFourierOrder (pdTemp, ny); + for (i = 0; i < ny; i++) + pcIn[i].im = pdTemp[i]; + + fftw_plan plan = fftw_create_plan (ny, FFTW_BACKWARD, FFTW_IN_PLACE); + fftw_one (plan, pcIn, NULL); + fftw_destroy_plan (plan); + double* pX = new double [ny]; - double* pY = new double [ny]; - for (int i = 0; i < ny; i++) { + double* pYReal = new double [ny]; + double* pYImag = new double [ny]; + double* pYMag = new double [ny]; + for (i = 0; i < ny; i++) { pX[i] = i; - pY[i] = v[xCursor][i]; + pYReal[i] = pcIn[i].re; + pYImag[i] = pcIn[i].im; + pYMag[i] = ::sqrt (pcIn[i].re * pcIn[i].re + pcIn[i].im * pcIn[i].im); } + PlotFileDocument* pPlotDoc = dynamic_cast(theApp->getDocManager()->CreateDocument("untitled.plt", wxDOC_SILENT)); if (! pPlotDoc) { sys_error (ERR_SEVERE, "Internal error: unable to create Plot file"); @@ -1329,17 +1358,38 @@ ImageFileView::OnPlotFFTCol (wxCommandEvent& event) std::string title("title "); title += os.str(); rPlotFile.addEzsetCommand (title.c_str()); - rPlotFile.addEzsetCommand ("xlabel Row"); + rPlotFile.addEzsetCommand ("xlabel Column"); rPlotFile.addEzsetCommand ("ylabel Pixel Value"); rPlotFile.addEzsetCommand ("lxfrac 0"); - rPlotFile.addEzsetCommand ("box"); + rPlotFile.addEzsetCommand ("curve 1"); + rPlotFile.addEzsetCommand ("color 1"); + rPlotFile.addEzsetCommand ("dash 1"); + rPlotFile.addEzsetCommand ("curve 2"); + rPlotFile.addEzsetCommand ("color 4"); + rPlotFile.addEzsetCommand ("dash 3"); + rPlotFile.addEzsetCommand ("curve 3"); + rPlotFile.addEzsetCommand ("color 0"); + rPlotFile.addEzsetCommand ("solid"); + rPlotFile.addEzsetCommand ("box"); rPlotFile.addEzsetCommand ("grid"); - rPlotFile.setCurveSize (2, nx); + rPlotFile.setCurveSize (4, ny); rPlotFile.addColumn (0, pX); - rPlotFile.addColumn (1, pY); + rPlotFile.addColumn (1, pYReal); + rPlotFile.addColumn (2, pYImag); + rPlotFile.addColumn (3, pYMag); + for (int iL = 0; iL < rIF.nLabels(); iL++) + rPlotFile.addDescription (rIF.labelGet(iL).getLabelString().c_str()); + os << " FFT Plot of " << GetDocument()->GetFirstView()->GetFrame()->GetTitle().c_str(); + *theApp->getLog() << os.str().c_str() << "\n"; + rPlotFile.addDescription (os.str().c_str()); } delete pX; - delete pY; + delete pYReal; + delete pYImag; + delete pYMag; + delete pdTemp; + delete [] pcIn; + if (theApp->getSetModifyNewDocs()) pPlotDoc->Modify(true); pPlotDoc->UpdateAllViews(); @@ -1403,7 +1453,7 @@ ImageFileView::OnCompareCol (wxCommandEvent& event) rPlotFile.addEzsetCommand ("dash 5"); rPlotFile.addEzsetCommand ("box"); rPlotFile.addEzsetCommand ("grid"); - rPlotFile.setCurveSize (3, nx); + rPlotFile.setCurveSize (3, ny); rPlotFile.addColumn (0, pX); rPlotFile.addColumn (1, pY1); rPlotFile.addColumn (2, pY2); @@ -1494,7 +1544,7 @@ ImageFileView::OnCompareRow (wxCommandEvent& event) rPlotFile.addEzsetCommand ("dash 5"); rPlotFile.addEzsetCommand ("box"); rPlotFile.addEzsetCommand ("grid"); - rPlotFile.setCurveSize (3, ny); + rPlotFile.setCurveSize (3, nx); rPlotFile.addColumn (0, pX); rPlotFile.addColumn (1, pY1); rPlotFile.addColumn (2, pY2); @@ -1570,7 +1620,7 @@ ImageFileView::OnPlotHistogram (wxCommandEvent& event) rPlotFile.addEzsetCommand ("ylabel Count"); rPlotFile.addEzsetCommand ("box"); rPlotFile.addEzsetCommand ("grid"); - rPlotFile.setCurveSize (2, nx); + rPlotFile.setCurveSize (2, NUMBER_HISTOGRAM_BINS); rPlotFile.addColumn (0, pX); rPlotFile.addColumn (1, pY); for (unsigned int iL = 0; iL < rIF.nLabels(); iL++) {