r358: no message
[ctsim.git] / libctsim / projections.cpp
index 22171504420064543e7d958bb168e461f9f9f79c..3c4f956e891c6f0ab2a644703df81a84e3f74a8d 100644 (file)
@@ -8,7 +8,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: projections.cpp,v 1.38 2001/01/06 15:33:15 kevin Exp $
+**  $Id: projections.cpp,v 1.39 2001/01/07 22:53:36 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
@@ -722,16 +722,16 @@ Projections::convertFFTPolar (ImageFile& rIF, int iInterpolationID, int iZeropad
   fftw_plan plan = fftw_create_plan (m_nDet, FFTW_FORWARD, FFTW_IN_PLACE);
 
   for (iView = 0; iView < m_nView; iView++) {
-    ppcDetValue[iView] = new std::complex<double> [m_nDet];
     unsigned int iDet;
     for (iDet = 0; iDet < m_nDet; iDet++) {
       pcIn[iDet].re = getDetectorArray(iView).detValues()[iDet];
       pcIn[iDet].im = 0;
     }
     fftw_one (plan, pcIn, NULL);
+    ppcDetValue[iView] = new std::complex<double> [m_nDet];
     for (iDet = 0; iDet < m_nDet; iDet++)
-      ppcDetValue[iView][iDet] = std::complex<double> (pcIn[iDet].re, pcIn[iDet].im);
-   Fourier::shuffleFourierToNaturalOrder (ppcDetValue[iView], m_nDet);
+      ppcDetValue[iView][iDet] = std::complex<double> (pcIn[iDet].re, pcIn[iDet].im); 
+    Fourier::shuffleFourierToNaturalOrder (ppcDetValue[iView], m_nDet);
   }
 
   fftw_destroy_plan (plan);  
@@ -748,6 +748,7 @@ Projections::convertFFTPolar (ImageFile& rIF, int iInterpolationID, int iZeropad
   return true;
 }
 
+
 void
 Projections::calcArrayPolarCoordinates (unsigned int nx, unsigned int ny, double** ppdView, double** ppdDet)
 {
@@ -763,8 +764,10 @@ Projections::calcArrayPolarCoordinates (unsigned int nx, unsigned int ny, double
 
   if (m_geometry != Scanner::GEOMETRY_PARALLEL) {
     sys_error (ERR_WARNING, "convertPolar supports Parallel only");
+    return;
   }
   
+  // Calculates polar coordinates (view#, det#) for each point on phantom grid
   double x = xMin + xInc / 2;  // Rectang coords of center of pixel 
   for (unsigned int ix = 0; ix < nx; x += xInc, ix++) {
     double y = yMin + yInc / 2;