From: Kevin M. Rosenberg Date: Tue, 2 Jan 2001 06:29:23 +0000 (+0000) Subject: r329: *** empty log message *** X-Git-Tag: debian-4.5.3-3~688 X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=commitdiff_plain;h=e3776d3d7bf82adfea545c1f06c8b4ce660190b0 r329: *** empty log message *** --- diff --git a/ChangeLog b/ChangeLog index 3a553b1..aaf76fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,6 @@ -TODO - Be consistant with creation of new images - - copy labels from original image to new images +3.0alpha2 - Released 1/01/01 -3.0alpha2 - Released 1/02/01 + * ctsim: All functions of command-line tools are now in graphical ctsim * ctsim: added generation of filter images diff --git a/include/array2dfile.h b/include/array2dfile.h index e9d4ab2..5aa522d 100644 --- a/include/array2dfile.h +++ b/include/array2dfile.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: array2dfile.h,v 1.15 2001/01/02 05:34:57 kevin Exp $ +** $Id: array2dfile.h,v 1.16 2001/01/02 06:29:23 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 @@ -152,7 +152,7 @@ public: void labelAdd (int type, const char* const m_strLabel, double calc_time=0.); - void labelsCopy (Array2dFile& file, const char* const idStr = NULL); + void labelsCopy (const Array2dFile& file, const char* const idStr = NULL); void setPixelFormat (int type) { m_pixelFormat = type; } diff --git a/libctsim/array2dfile.cpp b/libctsim/array2dfile.cpp index c450a0e..e0ab0a4 100644 --- a/libctsim/array2dfile.cpp +++ b/libctsim/array2dfile.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: array2dfile.cpp,v 1.24 2001/01/02 05:34:57 kevin Exp $ +** $Id: array2dfile.cpp,v 1.25 2001/01/02 06:29:23 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 @@ -646,7 +646,7 @@ Array2dFile::labelAdd (const Array2dFileLabel& label) } void -Array2dFile::labelsCopy (Array2dFile& copyFile, const char* const pszId) +Array2dFile::labelsCopy (const Array2dFile& copyFile, const char* const pszId) { std::string id; if (pszId) diff --git a/libctsim/projections.cpp b/libctsim/projections.cpp index d2ab2b6..4c31b38 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.33 2000/12/17 22:30:09 kevin Exp $ +** $Id: projections.cpp,v 1.34 2001/01/02 06:29:23 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 @@ -71,6 +71,15 @@ Projections::init (const int nView, const int nDet) m_nView = nView; m_nDet = nDet; newProjData (); + + time_t t = time (NULL); + tm* lt = localtime (&t); + m_year = lt->tm_year; + m_month = lt->tm_mon; + m_day = lt->tm_mday; + m_hour = lt->tm_hour; + m_minute = lt->tm_min; + m_second = lt->tm_sec; } void @@ -442,17 +451,6 @@ Projections::write (const char* filename) return false; } -#ifdef HAVE_TIME - time_t t = time(NULL); - tm* lt = localtime(&t); - m_year = lt->tm_year; - m_month = lt->tm_mon; - m_day = lt->tm_mday; - m_hour = lt->tm_hour; - m_minute = lt->tm_min; - m_second = lt->tm_sec; -#endif - if (! headerWrite (fs)) return false; diff --git a/msvc/ctsim/ctsim.plg b/msvc/ctsim/ctsim.plg index 8035dcd..004d342 100644 --- a/msvc/ctsim/ctsim.plg +++ b/msvc/ctsim/ctsim.plg @@ -3,45 +3,99 @@
 

Build Log

---------------------Configuration: ctsim - Win32 Release-------------------- +--------------------Configuration: libctsim - Win32 Debug--------------------

Command Lines

-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP22A.tmp" with contents +Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP39.tmp" with contents [ -/nologo /G6 /MT /W3 /GR /GX /O2 /I "." /I "..\..\include" /I "..\..\getopt" /I "..\..\..\lpng108" /I "..\..\..\zlib" /I "..\..\..\fftw-2.1.3\fftw" /I "..\..\..\fftw-2.1.3\rfftw" /I "..\..\..\wx2\include" /D CTSIMVERSION=\"2.5.0\" /D "NDEBUG" /D "__WXWIN__" /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" /FR"Release/" /Fp"Release/ctsim.pch" /YX /Fo"Release/" /Fd"Release/" /FD /c -"C:\ctsim-2.0.6\src\views.cpp" +/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 +"C:\ctsim-2.0.6\libctsim\projections.cpp" ] -Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP22A.tmp" -Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP22B.tmp" with contents +Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP39.tmp" +Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP3A.tmp" with contents [ -kernel32.lib user32.lib wsock32.lib comctl32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libpng.lib zlib.lib /nologo /subsystem:windows /incremental:no /pdb:"Release/ctsim.pdb" /machine:I386 /out:"Release/ctsim.exe" /libpath:"..\..\..\lpng108\msvc\win32\libpng\lib" /libpath:"..\..\..\lpng108\msvc\win32\zlib\lib" -".\Release\ctsim.obj" -".\Release\dialogs.obj" -".\Release\dlgprojections.obj" -".\Release\dlgreconstruct.obj" -".\Release\docs.obj" -".\Release\views.obj" -".\Release\wx.res" -"\ctsim-2.0.6\msvc\libctsim\Release\libctsim.lib" -"\fftw-2.1.3\Win32\FFTW2st\Release\FFTW2st.lib" -"\fftw-2.1.3\Win32\RFFTW2st\Release\RFFTW2st.lib" -"\wx2\lib\wx.lib" +/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 @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP22B.tmp" +Creating command line "link.exe -lib @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP3A.tmp"

Output Window

Compiling... -views.cpp -Linking... -LINK : warning LNK4089: all references to "ADVAPI32.dll" discarded by /OPT:REF -LINK : warning LNK4089: all references to "WSOCK32.dll" discarded by /OPT:REF -Creating command line "bscmake.exe /nologo /o"Release/ctsim.bsc" ".\Release\ctsim.sbr" ".\Release\dialogs.sbr" ".\Release\dlgprojections.sbr" ".\Release\dlgreconstruct.sbr" ".\Release\docs.sbr" ".\Release\views.sbr"" -Creating browse info file... +projections.cpp +Creating library... +

+--------------------Configuration: FFTW2st - Win32 Debug-------------------- +

+

Command Lines

+

+--------------------Configuration: zlib - Win32 DLL-------------------- +

+

Command Lines

+

+--------------------Configuration: libpng - Win32 DLL-------------------- +

+

Command Lines

+

+--------------------Configuration: RFFTW2st - Win32 Debug-------------------- +

+

Command Lines

+

+--------------------Configuration: wxvc - Win32 Debug-------------------- +

+

Command Lines

+

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

+

Command Lines

+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP3B.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-2.0.6\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\RSP3B.tmp"

Output Window

+Linking...

Results

-ctsim.exe - 0 error(s), 2 warning(s) +ctsim.exe - 0 error(s), 0 warning(s)
diff --git a/src/ctsim.h b/src/ctsim.h index aa349c1..9a26c00 100644 --- a/src/ctsim.h +++ b/src/ctsim.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: ctsim.h,v 1.17 2001/01/02 05:34:57 kevin Exp $ +** $Id: ctsim.h,v 1.18 2001/01/02 06:29:23 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 @@ -124,7 +124,7 @@ public: void getCompatibleImages (const ImageFileDocument* pIFDoc, std::vector& vecIF); bool getSetModifyNewDocs() const - { return false; } + { return true; } private: wxDocManager* m_docManager; @@ -160,24 +160,24 @@ enum { IFMENU_COMPARE_IMAGES, IFMENU_COMPARE_ROW, IFMENU_COMPARE_COL, - IFMENU_PROCESS_INVERTVALUES, - IFMENU_PROCESS_SQRT, - IFMENU_PROCESS_SQUARE, - IFMENU_PROCESS_LOG, - IFMENU_PROCESS_EXP, - IFMENU_PROCESS_MULTIPLY, - IFMENU_PROCESS_SUBTRACT, - IFMENU_PROCESS_SCALESIZE, - IFMENU_PROCESS_DIVIDE, - IFMENU_PROCESS_ADD, - IFMENU_PROCESS_FOURIER, - IFMENU_PROCESS_INVERSE_FOURIER, - IFMENU_PROCESS_FFT, - IFMENU_PROCESS_IFFT, - IFMENU_PROCESS_MAGNITUDE, - IFMENU_PROCESS_PHASE, - IFMENU_PROCESS_SHUFFLENATURALTOFOURIERORDER, - IFMENU_PROCESS_SHUFFLEFOURIERTONATURALORDER, + IFMENU_IMAGE_SCALESIZE, + IFMENU_IMAGE_ADD, + IFMENU_IMAGE_SUBTRACT, + IFMENU_IMAGE_MULTIPLY, + IFMENU_IMAGE_DIVIDE, + IFMENU_FILTER_INVERTVALUES, + IFMENU_FILTER_SQRT, + IFMENU_FILTER_SQUARE, + IFMENU_FILTER_LOG, + IFMENU_FILTER_EXP, + IFMENU_FILTER_FOURIER, + IFMENU_FILTER_INVERSE_FOURIER, + IFMENU_FILTER_FFT, + IFMENU_FILTER_IFFT, + IFMENU_FILTER_MAGNITUDE, + IFMENU_FILTER_PHASE, + IFMENU_FILTER_SHUFFLENATURALTOFOURIERORDER, + IFMENU_FILTER_SHUFFLEFOURIERTONATURALORDER, PHMMENU_PROCESS_RASTERIZE, PHMMENU_PROCESS_PROJECTIONS, PLOTMENU_VIEW_SCALE_MINMAX, diff --git a/src/views.cpp b/src/views.cpp index 3ec3b6b..0a8f4c8 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.44 2001/01/02 05:34:57 kevin Exp $ +** $Id: views.cpp,v 1.45 2001/01/02 06:29:23 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 @@ -173,26 +173,26 @@ EVT_MENU(IFMENU_VIEW_SCALE_AUTO, ImageFileView::OnScaleAuto) EVT_MENU(IFMENU_COMPARE_IMAGES, ImageFileView::OnCompare) EVT_MENU(IFMENU_COMPARE_ROW, ImageFileView::OnCompareRow) EVT_MENU(IFMENU_COMPARE_COL, ImageFileView::OnCompareCol) -EVT_MENU(IFMENU_PROCESS_INVERTVALUES, ImageFileView::OnInvertValues) -EVT_MENU(IFMENU_PROCESS_SQUARE, ImageFileView::OnSquare) -EVT_MENU(IFMENU_PROCESS_SQRT, ImageFileView::OnSquareRoot) -EVT_MENU(IFMENU_PROCESS_LOG, ImageFileView::OnLog) -EVT_MENU(IFMENU_PROCESS_EXP, ImageFileView::OnExp) -EVT_MENU(IFMENU_PROCESS_ADD, ImageFileView::OnAdd) -EVT_MENU(IFMENU_PROCESS_SUBTRACT, ImageFileView::OnSubtract) -EVT_MENU(IFMENU_PROCESS_MULTIPLY, ImageFileView::OnMultiply) -EVT_MENU(IFMENU_PROCESS_DIVIDE, ImageFileView::OnDivide) -EVT_MENU(IFMENU_PROCESS_FOURIER, ImageFileView::OnFourier) -EVT_MENU(IFMENU_PROCESS_SCALESIZE, ImageFileView::OnScaleSize) -EVT_MENU(IFMENU_PROCESS_INVERSE_FOURIER, ImageFileView::OnInverseFourier) -EVT_MENU(IFMENU_PROCESS_SHUFFLEFOURIERTONATURALORDER, ImageFileView::OnShuffleFourierToNaturalOrder) -EVT_MENU(IFMENU_PROCESS_SHUFFLENATURALTOFOURIERORDER, ImageFileView::OnShuffleNaturalToFourierOrder) +EVT_MENU(IFMENU_FILTER_INVERTVALUES, ImageFileView::OnInvertValues) +EVT_MENU(IFMENU_FILTER_SQUARE, ImageFileView::OnSquare) +EVT_MENU(IFMENU_FILTER_SQRT, ImageFileView::OnSquareRoot) +EVT_MENU(IFMENU_FILTER_LOG, ImageFileView::OnLog) +EVT_MENU(IFMENU_FILTER_EXP, ImageFileView::OnExp) +EVT_MENU(IFMENU_FILTER_FOURIER, ImageFileView::OnFourier) +EVT_MENU(IFMENU_FILTER_INVERSE_FOURIER, ImageFileView::OnInverseFourier) +EVT_MENU(IFMENU_FILTER_SHUFFLEFOURIERTONATURALORDER, ImageFileView::OnShuffleFourierToNaturalOrder) +EVT_MENU(IFMENU_FILTER_SHUFFLENATURALTOFOURIERORDER, ImageFileView::OnShuffleNaturalToFourierOrder) +EVT_MENU(IFMENU_IMAGE_ADD, ImageFileView::OnAdd) +EVT_MENU(IFMENU_IMAGE_SUBTRACT, ImageFileView::OnSubtract) +EVT_MENU(IFMENU_IMAGE_MULTIPLY, ImageFileView::OnMultiply) +EVT_MENU(IFMENU_IMAGE_DIVIDE, ImageFileView::OnDivide) +EVT_MENU(IFMENU_IMAGE_SCALESIZE, ImageFileView::OnScaleSize) #ifdef HAVE_FFTW -EVT_MENU(IFMENU_PROCESS_FFT, ImageFileView::OnFFT) -EVT_MENU(IFMENU_PROCESS_IFFT, ImageFileView::OnIFFT) +EVT_MENU(IFMENU_FILTER_FFT, ImageFileView::OnFFT) +EVT_MENU(IFMENU_FILTER_IFFT, ImageFileView::OnIFFT) #endif -EVT_MENU(IFMENU_PROCESS_MAGNITUDE, ImageFileView::OnMagnitude) -EVT_MENU(IFMENU_PROCESS_PHASE, ImageFileView::OnPhase) +EVT_MENU(IFMENU_FILTER_MAGNITUDE, ImageFileView::OnMagnitude) +EVT_MENU(IFMENU_FILTER_PHASE, ImageFileView::OnPhase) EVT_MENU(IFMENU_PLOT_ROW, ImageFileView::OnPlotRow) EVT_MENU(IFMENU_PLOT_COL, ImageFileView::OnPlotCol) END_EVENT_TABLE() @@ -325,6 +325,15 @@ ImageFileView::OnCompare (wxCommandEvent& event) return; } + wxString s = GetDocument()->GetFirstView()->GetFrame()->GetTitle() + ": "; + differenceImage.labelsCopy (rIF, s.c_str()); + s = pCompareDoc->GetFirstView()->GetFrame()->GetTitle() + ": "; + differenceImage.labelsCopy (rCompareIF, s.c_str()); + std::ostringstream osLabel; + osLabel << "Compare image " << GetDocument()->GetFirstView()->GetFrame()->GetTitle().c_str() + << " and " << pCompareDoc->GetFirstView()->GetFrame()->GetTitle().c_str() << ": " + << os.str().c_str(); + differenceImage.labelAdd (os.str().c_str()); if (theApp->getSetModifyNewDocs()) pDifferenceDoc->Modify(true); pDifferenceDoc->UpdateAllViews(this); @@ -405,15 +414,27 @@ ImageFileView::OnAdd (wxCommandEvent& event) ImageFile& rIF = GetDocument()->getImageFile(); ImageFileDocument* pRHSDoc = dialogGetCompare.getImageFileDocument(); const ImageFile& rRHSIF = pRHSDoc->getImageFile(); - rIF.addImages (rRHSIF, rIF); + ImageFileDocument* pNewDoc = dynamic_cast(theApp->getDocManager()->CreateDocument("untitled.if", wxDOC_SILENT)); + if (! pNewDoc) { + sys_error (ERR_SEVERE, "Unable to create image file"); + return; + } + ImageFile& newImage = pNewDoc->getImageFile(); + newImage.setArraySize (rIF.nx(), rIF.ny()); + rIF.addImages (rRHSIF, newImage); std::ostringstream os; os << "Add image " << GetDocument()->GetFirstView()->GetFrame()->GetTitle().c_str() << " and " << pRHSDoc->GetFirstView()->GetFrame()->GetTitle().c_str(); - rIF.labelAdd (os.str().c_str()); + wxString s = GetDocument()->GetFirstView()->GetFrame()->GetTitle() + ": "; + newImage.labelsCopy (rIF, s.c_str()); + s = pRHSDoc->GetFirstView()->GetFrame()->GetTitle() + ": "; + newImage.labelsCopy (rRHSIF, s.c_str()); + newImage.labelAdd (os.str().c_str()); *theApp->getLog() << os.str().c_str() << "\n"; if (theApp->getSetModifyNewDocs()) - GetDocument()->Modify(TRUE); - GetDocument()->UpdateAllViews(this); + pNewDoc->Modify(TRUE); + pNewDoc->UpdateAllViews(this); + pNewDoc->GetFirstView()->OnUpdate (this, NULL); } } } @@ -433,15 +454,27 @@ ImageFileView::OnSubtract (wxCommandEvent& event) ImageFile& rIF = GetDocument()->getImageFile(); ImageFileDocument* pRHSDoc = dialogGetCompare.getImageFileDocument(); const ImageFile& rRHSIF = pRHSDoc->getImageFile(); - rIF.subtractImages (rRHSIF, rIF); + ImageFileDocument* pNewDoc = dynamic_cast(theApp->getDocManager()->CreateDocument("untitled.if", wxDOC_SILENT)); + if (! pNewDoc) { + sys_error (ERR_SEVERE, "Unable to create image file"); + return; + } + ImageFile& newImage = pNewDoc->getImageFile(); + newImage.setArraySize (rIF.nx(), rIF.ny()); + rIF.subtractImages (rRHSIF, newImage); std::ostringstream os; - os << "Subtract image " << GetDocument()->GetFirstView()->GetFrame()->GetTitle().c_str() - << " and " << pRHSDoc->GetFirstView()->GetFrame()->GetTitle().c_str(); - rIF.labelAdd (os.str().c_str()); + os << "Subtract image " << GetDocument()->GetFirstView()->GetFrame()->GetTitle().c_str() << " and " + << pRHSDoc->GetFirstView()->GetFrame()->GetTitle().c_str(); + wxString s = GetDocument()->GetFirstView()->GetFrame()->GetTitle() + ": "; + newImage.labelsCopy (rIF, s.c_str()); + s = pRHSDoc->GetFirstView()->GetFrame()->GetTitle() + ": "; + newImage.labelsCopy (rRHSIF, s.c_str()); + newImage.labelAdd (os.str().c_str()); *theApp->getLog() << os.str().c_str() << "\n"; if (theApp->getSetModifyNewDocs()) - GetDocument()->Modify(TRUE); - GetDocument()->UpdateAllViews(this); + pNewDoc->Modify(TRUE); + pNewDoc->UpdateAllViews(this); + pNewDoc->GetFirstView()->OnUpdate (this, NULL); } } } @@ -461,15 +494,27 @@ ImageFileView::OnMultiply (wxCommandEvent& event) ImageFile& rIF = GetDocument()->getImageFile(); ImageFileDocument* pRHSDoc = dialogGetCompare.getImageFileDocument(); const ImageFile& rRHSIF = pRHSDoc->getImageFile(); - rIF.multiplyImages (rRHSIF, rIF); + ImageFileDocument* pNewDoc = dynamic_cast(theApp->getDocManager()->CreateDocument("untitled.if", wxDOC_SILENT)); + if (! pNewDoc) { + sys_error (ERR_SEVERE, "Unable to create image file"); + return; + } + ImageFile& newImage = pNewDoc->getImageFile(); + newImage.setArraySize (rIF.nx(), rIF.ny()); + rIF.multiplyImages (rRHSIF, newImage); std::ostringstream os; - os << "Multiply image " << GetDocument()->GetFirstView()->GetFrame()->GetTitle().c_str() - << " and " << pRHSDoc->GetFirstView()->GetFrame()->GetTitle().c_str(); - rIF.labelAdd (os.str().c_str()); + os << "Multiply image " << GetDocument()->GetFirstView()->GetFrame()->GetTitle().c_str() << " and " + << pRHSDoc->GetFirstView()->GetFrame()->GetTitle().c_str(); + wxString s = GetDocument()->GetFirstView()->GetFrame()->GetTitle() + ": "; + newImage.labelsCopy (rIF, s.c_str()); + s = pRHSDoc->GetFirstView()->GetFrame()->GetTitle() + ": "; + newImage.labelsCopy (rRHSIF, s.c_str()); + newImage.labelAdd (os.str().c_str()); *theApp->getLog() << os.str().c_str() << "\n"; if (theApp->getSetModifyNewDocs()) - GetDocument()->Modify(TRUE); - GetDocument()->UpdateAllViews(this); + pNewDoc->Modify(TRUE); + pNewDoc->UpdateAllViews(this); + pNewDoc->GetFirstView()->OnUpdate (this, NULL); } } } @@ -489,15 +534,27 @@ ImageFileView::OnDivide (wxCommandEvent& event) ImageFile& rIF = GetDocument()->getImageFile(); ImageFileDocument* pRHSDoc = dialogGetCompare.getImageFileDocument(); const ImageFile& rRHSIF = pRHSDoc->getImageFile(); - rIF.divideImages (rRHSIF, rIF); + ImageFileDocument* pNewDoc = dynamic_cast(theApp->getDocManager()->CreateDocument("untitled.if", wxDOC_SILENT)); + if (! pNewDoc) { + sys_error (ERR_SEVERE, "Unable to create image file"); + return; + } + ImageFile& newImage = pNewDoc->getImageFile(); + newImage.setArraySize (rIF.nx(), rIF.ny()); + rIF.divideImages (rRHSIF, newImage); std::ostringstream os; - os << "Divide image " << GetDocument()->GetFirstView()->GetFrame()->GetTitle().c_str() - << " by " << pRHSDoc->GetFirstView()->GetFrame()->GetTitle().c_str(); - rIF.labelAdd (os.str().c_str()); + os << "Divide image " << GetDocument()->GetFirstView()->GetFrame()->GetTitle().c_str() << " by " + << pRHSDoc->GetFirstView()->GetFrame()->GetTitle().c_str(); + wxString s = GetDocument()->GetFirstView()->GetFrame()->GetTitle() + ": "; + newImage.labelsCopy (rIF, s.c_str()); + s = pRHSDoc->GetFirstView()->GetFrame()->GetTitle() + ": "; + newImage.labelsCopy (rRHSIF, s.c_str()); + newImage.labelAdd (os.str().c_str()); *theApp->getLog() << os.str().c_str() << "\n"; if (theApp->getSetModifyNewDocs()) - GetDocument()->Modify(TRUE); - GetDocument()->UpdateAllViews(this); + pNewDoc->Modify(TRUE); + pNewDoc->UpdateAllViews(this); + pNewDoc->GetFirstView()->OnUpdate (this, NULL); } } } @@ -660,33 +717,35 @@ ImageFileView::CreateChildFrame(wxDocument *doc, wxView *view) view_menu->Append(IFMENU_VIEW_SCALE_MINMAX, "Display Scale &Set..."); view_menu->Append(IFMENU_VIEW_SCALE_AUTO, "Display Scale &Auto..."); - wxMenu* process_menu = new wxMenu; - process_menu->Append (IFMENU_PROCESS_INVERTVALUES, "&Invert Values"); - process_menu->Append (IFMENU_PROCESS_SQUARE, "&Square"); - process_menu->Append (IFMENU_PROCESS_SQRT, "Square &Root"); - process_menu->Append (IFMENU_PROCESS_LOG, "&Log"); - process_menu->Append (IFMENU_PROCESS_EXP, "&Exp"); - process_menu->AppendSeparator(); - process_menu->Append (IFMENU_PROCESS_ADD, "&Add"); - process_menu->Append (IFMENU_PROCESS_SUBTRACT, "Su&btract"); - process_menu->Append (IFMENU_PROCESS_MULTIPLY, "&Multiply"); - process_menu->Append (IFMENU_PROCESS_DIVIDE, "&Divide"); - process_menu->AppendSeparator(); - process_menu->Append (IFMENU_PROCESS_SCALESIZE, "S&cale Size..."); - process_menu->AppendSeparator(); + wxMenu* filter_menu = new wxMenu; + filter_menu->Append (IFMENU_FILTER_INVERTVALUES, "&Invert Values"); + filter_menu->Append (IFMENU_FILTER_SQUARE, "&Square"); + filter_menu->Append (IFMENU_FILTER_SQRT, "Square &Root"); + filter_menu->Append (IFMENU_FILTER_LOG, "&Log"); + filter_menu->Append (IFMENU_FILTER_EXP, "&Exp"); + filter_menu->AppendSeparator(); #ifdef HAVE_FFTW - process_menu->Append (IFMENU_PROCESS_FFT, "&FFT"); - process_menu->Append (IFMENU_PROCESS_IFFT, "&IFFT"); - process_menu->Append (IFMENU_PROCESS_FOURIER, "F&ourier"); - process_menu->Append (IFMENU_PROCESS_INVERSE_FOURIER, "Inverse Fo&urier"); + filter_menu->Append (IFMENU_FILTER_FFT, "&FFT"); + filter_menu->Append (IFMENU_FILTER_IFFT, "&IFFT"); + filter_menu->Append (IFMENU_FILTER_FOURIER, "F&ourier"); + filter_menu->Append (IFMENU_FILTER_INVERSE_FOURIER, "Inverse Fo&urier"); #else - process_menu->Append (IFMENU_PROCESS_FOURIER, "&Fourier"); - process_menu->Append (IFMENU_PROCESS_INVERSE_FOURIER, "&Inverse Fourier"); + filter_menu->Append (IFMENU_FILTER_FOURIER, "&Fourier"); + filter_menu->Append (IFMENU_FILTER_INVERSE_FOURIER, "&Inverse Fourier"); #endif - process_menu->Append (IFMENU_PROCESS_SHUFFLEFOURIERTONATURALORDER, "S&huffle Fourier to Natural Order"); - process_menu->Append (IFMENU_PROCESS_SHUFFLENATURALTOFOURIERORDER, "Shu&ffle Natural to Fourier Order"); - process_menu->Append (IFMENU_PROCESS_MAGNITUDE, "&Magnitude"); - process_menu->Append (IFMENU_PROCESS_PHASE, "&Phase"); + filter_menu->Append (IFMENU_FILTER_SHUFFLEFOURIERTONATURALORDER, "S&huffle Fourier to Natural Order"); + filter_menu->Append (IFMENU_FILTER_SHUFFLENATURALTOFOURIERORDER, "Shu&ffle Natural to Fourier Order"); + filter_menu->Append (IFMENU_FILTER_MAGNITUDE, "&Magnitude"); + filter_menu->Append (IFMENU_FILTER_PHASE, "&Phase"); + + wxMenu* image_menu = new wxMenu; + filter_menu->AppendSeparator(); + image_menu->Append (IFMENU_IMAGE_ADD, "&Add..."); + image_menu->Append (IFMENU_IMAGE_SUBTRACT, "&Subtract..."); + image_menu->Append (IFMENU_IMAGE_MULTIPLY, "&Multiply..."); + image_menu->Append (IFMENU_IMAGE_DIVIDE, "&Divide..."); + image_menu->AppendSeparator(); + image_menu->Append (IFMENU_IMAGE_SCALESIZE, "S&cale Size..."); wxMenu *plot_menu = new wxMenu; plot_menu->Append (IFMENU_PLOT_ROW, "Plot &Row"); @@ -704,7 +763,8 @@ ImageFileView::CreateChildFrame(wxDocument *doc, wxView *view) menu_bar->Append(file_menu, "&File"); menu_bar->Append(view_menu, "&View"); - menu_bar->Append(process_menu, "&Process"); + menu_bar->Append(image_menu, "&Image"); + menu_bar->Append(filter_menu, "Fi<er"); menu_bar->Append(plot_menu, "P&lot"); menu_bar->Append(compare_menu, "&Compare"); menu_bar->Append(help_menu, "&Help"); @@ -1292,7 +1352,7 @@ PhantomView::OnRasterize (wxCommandEvent& event) if (retVal == wxID_OK) { int xSize = dialogRaster.getXSize(); int ySize = dialogRaster.getYSize(); - int nSamples = dialogRaster.getNSamples(); + int nSamples = dialogRaster.getNSamples(); if (nSamples < 1) nSamples = 1; if (xSize > 0 && ySize > 0) { @@ -1305,7 +1365,8 @@ PhantomView::OnRasterize (wxCommandEvent& event) ImageFile& imageFile = pRasterDoc->getImageFile(); imageFile.setArraySize (xSize, ySize); - wxProgressDialog dlgProgress (wxString("Rasterize"), wxString("Rasterization Progress"), imageFile.nx() + 1, m_frame, wxPD_CAN_ABORT); + wxProgressDialog dlgProgress (wxString("Rasterize"), wxString("Rasterization Progress"), imageFile.nx() + 1, m_frame, wxPD_CAN_ABORT); + Timer timer; for (unsigned int i = 0; i < imageFile.nx(); i++) { rPhantom.convertToImagefile (imageFile, nSamples, Trace::TRACE_NONE, i, 1, true); if (! dlgProgress.Update(i+1)) { @@ -1315,16 +1376,17 @@ PhantomView::OnRasterize (wxCommandEvent& event) } if (theApp->getSetModifyNewDocs()) pRasterDoc->Modify(true); - pRasterDoc->UpdateAllViews(this); + pRasterDoc->UpdateAllViews(this); + std::ostringstream os; + os << "Rasterize Phantom " << rPhantom.name() << ": XSize=" << xSize << ", YSize=" << ySize << ", nSamples=" << nSamples; + *theApp->getLog() << os.str().c_str() << "\n"; + imageFile.labelAdd (os.str().c_str(), timer.timerEnd()); ImageFileView* rasterView = dynamic_cast(pRasterDoc->GetFirstView()); if (rasterView) { rasterView->getFrame()->SetFocus(); rasterView->OnUpdate (rasterView, NULL); } - std::ostringstream os; - os << "Rasterize Phantom " << rPhantom.name() << ": XSize=" << xSize << ", YSize=" << ySize << ", nSamples=" << nSamples << "\n"; - *theApp->getLog() << os.str().c_str(); } } } @@ -1552,24 +1614,9 @@ ProjectionFileView::OnReconstruct (wxCommandEvent& event) 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 0 - SGPDriver* pSGPDriver = NULL; - SGP* pSGP = NULL; - wxMemoryDC* pDCPlot = NULL; - wxBitmap bitmap; - if (m_iDefaultTrace >= Trace::TRACE_PLOT) { - bitmap.Create (500, 500); - pDCPlot = new wxMemoryDC; - pDCPlot->SelectObject (bitmap); - pSGPDriver = new SGPDriver (dynamic_castpDCPlot, 500, 500); - pSGP = new SGP (*pSGPDriver); - } - 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, pSGP); - delete pSGP; -#else + 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); -#endif - + Timer timerRecon; if (m_iDefaultTrace > Trace::TRACE_CONSOLE) { ReconstructDialog* pDlgReconstruct = new ReconstructDialog (*pReconstruct, rProj, imageFile, m_iDefaultTrace, m_frame); @@ -1614,7 +1661,7 @@ ProjectionFileView::OnReconstruct (wxCommandEvent& event) os << "Reconstruct " << rProj.getFilename() << ": xSize=" << m_iDefaultNX << ", ySize=" << m_iDefaultNY << ", Filter=" << optFilterName.c_str() << ", FilterParam=" << m_dDefaultFilterParam << ", FilterMethod=" << optFilterMethodName.c_str() << ", FilterGeneration=" << optFilterGenerationName.c_str() << ", Zeropad=" << m_iDefaultZeropad << ", Interpolation=" << optInterpName.c_str() << ", InterpolationParam=" << m_iDefaultInterpParam << ", Backprojection=" << optBackprojectName.c_str(); *theApp->getLog() << os.str().c_str() << "\n"; imageFile.labelAdd (rProj.getLabel()); - imageFile.labelAdd (Array2dFileLabel::L_HISTORY, os.str().c_str(), timerRecon.timerEnd()); + imageFile.labelAdd (os.str().c_str(), timerRecon.timerEnd()); } } }