** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: projections.cpp,v 1.47 2001/02/08 06:25:07 kevin Exp $
+** $Id: projections.cpp,v 1.49 2001/02/22 18:22:40 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
const int Projections::POLAR_INTERP_BILINEAR = 1;
const int Projections::POLAR_INTERP_BICUBIC = 2;
-const char* Projections::s_aszInterpName[] =
+const char* const Projections::s_aszInterpName[] =
{
{"nearest"},
{"bilinear"},
// {"bicubic"},
};
-const char* Projections::s_aszInterpTitle[] =
+const char* const Projections::s_aszInterpTitle[] =
{
{"Nearest"},
{"Bilinear"},
double** ppdView = adView.getArray();
double** ppdDet = adDet.getArray();
- calcArrayPolarCoordinates (nx, ny, ppdView, ppdDet);
+ if (! calcArrayPolarCoordinates (nx, ny, ppdView, ppdDet))
+ return false;
std::complex<double>** ppcDetValue = new std::complex<double>* [m_nView];
unsigned int iView;
fftw_destroy_plan (plan);
delete [] pcIn;
- calcArrayPolarCoordinates (nx, ny, ppdView, ppdDet);
+ bool bError = calcArrayPolarCoordinates (nx, ny, ppdView, ppdDet);
- interpolatePolar (v, vImag, nx, ny, ppcDetValue, ppdView, ppdDet, m_nView, m_nDet, iInterpolationID);
+ if (! bError)
+ interpolatePolar (v, vImag, nx, ny, ppcDetValue, ppdView, ppdDet, m_nView, m_nDet, iInterpolationID);
for (iView = 0; iView < m_nView; iView++)
delete [] ppcDetValue[iView];
delete [] ppcDetValue;
- return true;
+ return bError;
#endif
}
-void
+bool
Projections::calcArrayPolarCoordinates (unsigned int nx, unsigned int ny, double** ppdView, double** ppdDet)
{
double xMin = -phmLen() / 2;
if (m_geometry != Scanner::GEOMETRY_PARALLEL) {
sys_error (ERR_WARNING, "convertPolar supports Parallel only");
- return;
+ return false;
}
// Calculates polar coordinates (view#, det#) for each point on phantom grid
ppdDet[ix][iy] = (r / m_detInc) + iDetCenter;
}
}
+
+ return true;
}
void