r11859: Canonicalize whitespace
[ctsim.git] / libctsim / reconstruct.cpp
index 3497882730241d72357d87613d8a0a6cf9031ef7..a81a34be97d6bd7df9cb2b9667b4dc821eedb71b 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
 ** FILE IDENTIFICATION
 **
-**   Name:        reconstruct.cpp         Reconstruction class
+**   Name:         reconstruct.cpp         Reconstruction class
 **   Programmer:   Kevin Rosenberg
 **   Date Started: Aug 84
 **
  *
  * 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;
@@ -72,8 +72,8 @@ Reconstructor::Reconstructor (const Projections& rProj, ImageFile& rIF, const ch
 #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()) {
@@ -162,29 +162,29 @@ Reconstructor::reconstructView (int iStartView, int iViewCount, SGP* pSGP, bool
 
   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
@@ -233,7 +233,7 @@ Reconstructor::reconstructView (int iStartView, int iViewCount, SGP* pSGP, bool
       pSGP->setTextPointSize (12);
       ezplotProj.plot (pSGP);
 
-} 
+}
 #endif  //HAVE_SGP
   }