X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=libctsim%2Fprojections.cpp;h=3c4f956e891c6f0ab2a644703df81a84e3f74a8d;hp=22171504420064543e7d958bb168e461f9f9f79c;hb=acd157c5e61e2eeba8308a49b4d7fc4a4aba9a84;hpb=e9c20d8b9cf2a0f49d0086e50bd6a4eb2c6c2dac diff --git a/libctsim/projections.cpp b/libctsim/projections.cpp index 2217150..3c4f956 100644 --- a/libctsim/projections.cpp +++ b/libctsim/projections.cpp @@ -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 [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 [m_nDet]; for (iDet = 0; iDet < m_nDet; iDet++) - ppcDetValue[iView][iDet] = std::complex (pcIn[iDet].re, pcIn[iDet].im); - Fourier::shuffleFourierToNaturalOrder (ppcDetValue[iView], m_nDet); + ppcDetValue[iView][iDet] = std::complex (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;