diff options
author | Willem Jan Palenstijn <WillemJan.Palenstijn@uantwerpen.be> | 2014-04-16 11:13:22 +0000 |
---|---|---|
committer | wpalenst <WillemJan.Palenstijn@uantwerpen.be> | 2014-04-16 11:13:22 +0000 |
commit | 0c77eee16e2f4161c1ebc110b15ce6563d4a96c2 (patch) | |
tree | d824a763da5578391839c57057d5ecee26554873 /src | |
parent | 8b046691e7cf5ba603b690e5a820869f7aba0bb6 (diff) | |
download | astra-0c77eee16e2f4161c1ebc110b15ce6563d4a96c2.tar.gz astra-0c77eee16e2f4161c1ebc110b15ce6563d4a96c2.tar.bz2 astra-0c77eee16e2f4161c1ebc110b15ce6563d4a96c2.tar.xz astra-0c77eee16e2f4161c1ebc110b15ce6563d4a96c2.zip |
Add fan beam support to FBP_CUDA
Diffstat (limited to 'src')
-rw-r--r-- | src/CudaFilteredBackProjectionAlgorithm.cpp | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/src/CudaFilteredBackProjectionAlgorithm.cpp b/src/CudaFilteredBackProjectionAlgorithm.cpp index 3656f3f..c53ac2d 100644 --- a/src/CudaFilteredBackProjectionAlgorithm.cpp +++ b/src/CudaFilteredBackProjectionAlgorithm.cpp @@ -27,6 +27,7 @@ $Id$ */ #include <astra/CudaFilteredBackProjectionAlgorithm.h> +#include <astra/FanFlatProjectionGeometry2D.h> #include <boost/lexical_cast.hpp> #include <cstring> @@ -226,7 +227,8 @@ void CCudaFilteredBackProjectionAlgorithm::run(int _iNrIterations /* = 0 */) if (!m_bAstraFBPInit) { const CVolumeGeometry2D& volgeom = *m_pReconstruction->getGeometry(); - const CParallelProjectionGeometry2D& projgeom = *dynamic_cast<CParallelProjectionGeometry2D*>(m_pSinogram->getGeometry()); + const CParallelProjectionGeometry2D* parprojgeom = dynamic_cast<CParallelProjectionGeometry2D*>(m_pSinogram->getGeometry()); + const CFanFlatProjectionGeometry2D* fanprojgeom = dynamic_cast<CFanFlatProjectionGeometry2D*>(m_pSinogram->getGeometry()); bool ok = true; @@ -235,10 +237,26 @@ void CCudaFilteredBackProjectionAlgorithm::run(int _iNrIterations /* = 0 */) volgeom.getGridRowCount(), volgeom.getPixelLengthX()); // TODO: off-center geometry - ok &= m_pFBP->setProjectionGeometry(projgeom.getProjectionAngleCount(), - projgeom.getDetectorCount(), - projgeom.getProjectionAngles(), - projgeom.getDetectorWidth()); + int iDetectorCount; + if (parprojgeom) { + ok &= m_pFBP->setProjectionGeometry(parprojgeom->getProjectionAngleCount(), + parprojgeom->getDetectorCount(), + parprojgeom->getProjectionAngles(), + parprojgeom->getDetectorWidth()); + iDetectorCount = parprojgeom->getDetectorCount(); + } else if (fanprojgeom) { + ok &= m_pFBP->setFanGeometry(fanprojgeom->getProjectionAngleCount(), + fanprojgeom->getDetectorCount(), + fanprojgeom->getProjectionAngles(), + fanprojgeom->getOriginSourceDistance(), + fanprojgeom->getOriginDetectorDistance(), + fanprojgeom->getDetectorWidth(), + false); // TODO: Support short-scan + + iDetectorCount = fanprojgeom->getDetectorCount(); + } else { + assert(false); + } ok &= m_pFBP->setPixelSuperSampling(m_iPixelSuperSampling); @@ -252,7 +270,7 @@ void CCudaFilteredBackProjectionAlgorithm::run(int _iNrIterations /* = 0 */) ok &= m_pFBP->init(m_iGPUIndex); ASTRA_ASSERT(ok); - ok &= m_pFBP->setSinogram(m_pSinogram->getDataConst(), projgeom.getDetectorCount()); + ok &= m_pFBP->setSinogram(m_pSinogram->getDataConst(), iDetectorCount); ASTRA_ASSERT(ok); ok &= m_pFBP->setFilter(m_eFilter, m_pfFilter, m_iFilterWidth, m_fFilterD, m_fFilterParameter); |