/*****************************************************************************
** FILE IDENTIFICATION
**
-** Name: reconstruct.cpp Reconstruction class
+** Name: reconstruct.cpp Reconstruction class
** Programmer: Kevin Rosenberg
** Date Started: Aug 84
**
** This is part of the CTSim program
-** Copyright (c) 1983-2001 Kevin Rosenberg
-**
-** $Id: reconstruct.cpp,v 1.17 2001/03/13 08:24:41 kevin Exp $
+** Copyright (c) 1983-2009 Kevin Rosenberg
**
** 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
*
* SYNOPSIS
* im = proj.reconstruct (im, filt_type, filt_param, interp_type)
- * IMAGE *im Output image
- * int filt_type Type of convolution filter to use
- * double filt_param Filter specific parameter
- * Currently, used only with Hamming filters
- * int interp_type Type of interpolation method to use
+ * IMAGE *im Output image
+ * int filt_type Type of convolution filter to use
+ * double filt_param Filter specific parameter
+ * Currently, used only with Hamming filters
+ * int interp_type Type of interpolation method to use
*
* ALGORITHM
*
- * Calculate one-dimensional filter in spatial domain
- * Allocate & clear (zero) the 2d output image array
+ * Calculate one-dimensional filter in spatial domain
+ * Allocate & clear (zero) the 2d output image array
* For each projection view
- * Convolve raysum array with filter
- * Backproject raysums and add (summate) to image array
+ * Convolve raysum array with filter
+ * Backproject raysums and add (summate) to image array
* end
*/
-Reconstructor::Reconstructor (const Projections& rProj, ImageFile& rIF, const char* const filterName,
- double filt_param, const char* const filterMethodName, const int zeropad,
- const char* filterGenerationName, const char* const interpName,
- int interpFactor, const char* const backprojectName, const int iTrace,
+Reconstructor::Reconstructor (const Projections& rProj, ImageFile& rIF, const char* const filterName,
+ double filt_param, const char* const filterMethodName, const int zeropad,
+ const char* filterGenerationName, const char* const interpName,
+ int interpFactor, const char* const backprojectName, const int iTrace,
ReconstructionROI* pROI, bool bRebinToParallel, SGP* pSGP)
- : m_rOriginalProj(rProj),
+ : m_rOriginalProj(rProj),
m_pProj(bRebinToParallel ? m_rOriginalProj.interpolateToParallel() : &m_rOriginalProj),
- m_rImagefile(rIF), m_pProcessSignal(0), m_pBackprojector(0),
+ m_rImagefile(rIF), m_pProcessSignal(0), m_pBackprojector(0),
m_iTrace(iTrace), m_bRebinToParallel(bRebinToParallel), m_bFail(false), m_adPlotXAxis(0)
{
m_nFilteredProjections = m_pProj->nDet() * interpFactor;
#endif
double filterBW = 1. / m_pProj->detInc();
- m_pProcessSignal = new ProcessSignal (filterName, filterMethodName, filterBW, m_pProj->detInc(),
- m_pProj->nDet(), filt_param, "spatial", filterGenerationName, zeropad, interpFactor, iTrace,
+ m_pProcessSignal = new ProcessSignal (filterName, filterMethodName, filterBW, m_pProj->detInc(),
+ m_pProj->nDet(), filt_param, "spatial", filterGenerationName, zeropad, interpFactor, iTrace,
m_pProj->geometry(), m_pProj->focalLength(), m_pProj->sourceDetectorLength(), pSGP);
if (m_pProcessSignal->fail()) {
if (iViewCount <= 0)
iViewCount = m_pProj->nView() - iStartView;
-
+
for (int iView = iStartView; iView < (iStartView + iViewCount); iView++) {
- if (m_iTrace == Trace::TRACE_CONSOLE)
- std::cout <<"Reconstructing view " << iView << " (last = " << m_pProj->nView() - 1 << ")\n";
-
+ if (m_iTrace == Trace::TRACE_CONSOLE)
+ std::cout <<"Reconstructing view " << iView << " (last = " << m_pProj->nView() - 1 << ")\n";
+
const DetectorArray& rDetArray = m_pProj->getDetectorArray (iView);
const DetectorValue* detval = rDetArray.detValues();
m_pProcessSignal->filterSignal (detval, adFilteredProj);
#ifdef HAVE_BSPLINE_INTERP
- if (interp_type == I_BSPLINE)
- bspline (m_pProj->nDet(), zoom_factor, spline_order, adFilteredProj, adFilteredProj);
-
+ if (interp_type == I_BSPLINE)
+ bspline (m_pProj->nDet(), zoom_factor, spline_order, adFilteredProj, adFilteredProj);
+
#ifdef HAVE_SGP
if (trace >= Trace::TRACE_PLOT && interp_type == I_BSPLINE && pSGP) {
- bspline (m_pProj->nDet(), zoom_factor, spline_order, adFilteredProj, adFilteredProj);
+ bspline (m_pProj->nDet(), zoom_factor, spline_order, adFilteredProj, adFilteredProj);
ezplot_1d (adFilteredProj, m_nFilteredProjections);
}
#endif
#endif
- if (bBackprojectView)
+ if (bBackprojectView)
m_pBackprojector->BackprojectView (adFilteredProj, rDetArray.viewAngle());
#ifdef HAVE_SGP
pSGP->setTextPointSize (12);
ezplotProj.plot (pSGP);
-}
+}
#endif //HAVE_SGP
}