- ImageFileDocument* pReconDoc = dynamic_cast<ImageFileDocument*>(theApp->getDocManager()->CreateDocument("untitled.if", wxDOC_SILENT));
- ImageFile& imageFile = pReconDoc->getImageFile();
- const Projections& rProj = GetDocument()->getProjections();
- string optFilterName = "abs_bandlimit";
- double optFilterParam = 1.;
- string optFilterMethodName = "convolution";
- int optZeropad = 3;
- string optInterpName = "linear";
- int optInterpParam = 1;
- string optBackprojectName = "idiff3";
- imageFile.setArraySize (256, 256);
- rProj.reconstruct (imageFile, optFilterName.c_str(), optFilterParam, optFilterMethodName.c_str(), optZeropad, optInterpName.c_str(), optInterpParam, optBackprojectName.c_str(), TRACE_NONE);
- pReconDoc->Modify(true);
- pReconDoc->UpdateAllViews(this);
+#if HAVE_FFTW
+ DialogGetReconstructionParameters dialogReconstruction (m_frame, 256, 256, SignalFilter::FILTER_ABS_BANDLIMIT, 1., ProcessSignal::FILTER_METHOD_RFFTW, ProcessSignal::FILTER_GENERATION_INVERSE_FOURIER, 1, Backprojector::INTERP_LINEAR, 1, Backprojector::BPROJ_IDIFF3);
+#else
+ DialogGetReconstructionParameters dialogReconstruction (m_frame, 256, 256, SignalFilter::FILTER_ABS_BANDLIMIT, 1., ProcessSignal::FILTER_METHOD_CONVOLUTION, ProcessSignal::FILTER_GENERATION_DIRECT, 1, Backprojector::INTERP_LINEAR, 1, Backprojector::BPROJ_IDIFF3);
+#endif
+ int retVal = dialogReconstruction.ShowModal();
+ if (retVal == wxID_OK) {
+ int xSize = dialogReconstruction.getXSize();
+ int ySize = dialogReconstruction.getYSize();
+ wxString optFilterName = dialogReconstruction.getFilterName();
+ double optFilterParam = dialogReconstruction.getFilterParam();
+ wxString optFilterMethodName = dialogReconstruction.getFilterMethodName();
+ int optZeropad = dialogReconstruction.getZeropad();
+ wxString optFilterGenerationName = dialogReconstruction.getFilterGenerationName();
+ wxString optInterpName = dialogReconstruction.getInterpName();
+ int optInterpParam = dialogReconstruction.getInterpParam();
+ wxString optBackprojectName = dialogReconstruction.getBackprojectName();
+ if (xSize > 0 && ySize > 0) {
+ ImageFileDocument* pReconDoc = dynamic_cast<ImageFileDocument*>(theApp->getDocManager()->CreateDocument("untitled.if", wxDOC_SILENT));
+ ImageFile& imageFile = pReconDoc->getImageFile();
+ const Projections& rProj = GetDocument()->getProjections();
+ imageFile.setArraySize (xSize, ySize);
+ rProj.reconstruct (imageFile, optFilterName.c_str(), optFilterParam, optFilterMethodName.c_str(), optZeropad, optFilterGenerationName.c_str(), optInterpName.c_str(), optInterpParam, optBackprojectName.c_str(), TRACE_NONE);
+ pReconDoc->Modify(true);
+ pReconDoc->UpdateAllViews(this);
+ ostringstream os;
+ os << "Reconstruct " << rProj.getFilename() << ": xSize=" << xSize << ", ySize=" << ySize << ", Filter=" << optFilterName.c_str() << ", FilterParam=" << optFilterParam << ", FilterMethod=" << optFilterMethodName.c_str() << ", FilterGeneration=" << optFilterGenerationName.c_str() << ", Zeropad=" << optZeropad << ", Interpolation=" << optInterpName.c_str() << ", InterpolationParam=" << optInterpParam << ", Backprojection=" << optBackprojectName.c_str() << "\n";
+ *theApp->getLog() << os.str().c_str();
+ }
+ }