X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=libctsim%2Fprojections.cpp;h=27d5b69ffa7516d5435ce0406068b61fd94bbeea;hp=dc7248e62b9f3e42c86561612e99233c1bd6c245;hb=08c1ec110dc7936c2bbd1c619bd2cf3618c6b4cc;hpb=de411914da8b157958e9caae917bf1edeafbb713 diff --git a/libctsim/projections.cpp b/libctsim/projections.cpp index dc7248e..27d5b69 100644 --- a/libctsim/projections.cpp +++ b/libctsim/projections.cpp @@ -8,7 +8,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: projections.cpp,v 1.59 2001/03/11 15:27:30 kevin Exp $ +** $Id: projections.cpp,v 1.60 2001/03/11 17:55:29 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 @@ -688,17 +688,16 @@ Projections::convertPolar (ImageFile& rIF, int iInterpolationID) if (! v || nx == 0 || ny == 0) return false; - if (m_geometry != Scanner::GEOMETRY_PARALLEL) { - sys_error (ERR_WARNING, "convertPolar supports Parallel only"); - return false; - } + Projections* pProj = this; + if (m_geometry == Scanner::GEOMETRY_EQUIANGULAR || m_geometry == Scanner::GEOMETRY_EQUILINEAR) + pProj = interpolateToParallel(); Array2d adView (nx, ny); Array2d adDet (nx, ny); double** ppdView = adView.getArray(); double** ppdDet = adDet.getArray(); - if (! calcArrayPolarCoordinates (nx, ny, ppdView, ppdDet)) + if (! pProj->calcArrayPolarCoordinates (nx, ny, ppdView, ppdDet)) return false; std::complex** ppcDetValue = new std::complex* [m_nView]; @@ -709,12 +708,15 @@ Projections::convertPolar (ImageFile& rIF, int iInterpolationID) ppcDetValue[iView][iDet] = std::complex(getDetectorArray (iView).detValues()[iDet], 0); } - interpolatePolar (v, vImag, nx, ny, ppcDetValue, ppdView, ppdDet, m_nView, m_nDet, iInterpolationID); + pProj->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; + if (m_geometry == Scanner::GEOMETRY_EQUIANGULAR || m_geometry == Scanner::GEOMETRY_EQUILINEAR) + delete pProj; + return true; }