summaryrefslogtreecommitdiffstats
path: root/src/CudaForwardProjectionAlgorithm.cpp
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2018-01-09 14:09:40 +0100
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2018-01-09 14:09:40 +0100
commitde27e439a0c59fade175fba4e0b4a1e0c84b933d (patch)
tree8d724e10b35291f5bfd63174eeeca95e52a863df /src/CudaForwardProjectionAlgorithm.cpp
parent324611ce98a82944def875e61cb93dd98ced9c79 (diff)
parent84da1d5e27abadf28e97695e88494c58bf1c2697 (diff)
downloadastra-de27e439a0c59fade175fba4e0b4a1e0c84b933d.tar.gz
astra-de27e439a0c59fade175fba4e0b4a1e0c84b933d.tar.bz2
astra-de27e439a0c59fade175fba4e0b4a1e0c84b933d.tar.xz
astra-de27e439a0c59fade175fba4e0b4a1e0c84b933d.zip
Merge branch 'parallel_vec'
Diffstat (limited to 'src/CudaForwardProjectionAlgorithm.cpp')
-rw-r--r--src/CudaForwardProjectionAlgorithm.cpp66
1 files changed, 29 insertions, 37 deletions
diff --git a/src/CudaForwardProjectionAlgorithm.cpp b/src/CudaForwardProjectionAlgorithm.cpp
index bac1251..f4cafe6 100644
--- a/src/CudaForwardProjectionAlgorithm.cpp
+++ b/src/CudaForwardProjectionAlgorithm.cpp
@@ -220,56 +220,48 @@ void CCudaForwardProjectionAlgorithm::run(int)
// check initialized
assert(m_bIsInitialized);
- CVolumeGeometry2D* pVolGeom = m_pVolume->getGeometry();
- const CParallelProjectionGeometry2D* parProjGeom = dynamic_cast<CParallelProjectionGeometry2D*>(m_pSinogram->getGeometry());
- const CFanFlatProjectionGeometry2D* fanProjGeom = dynamic_cast<CFanFlatProjectionGeometry2D*>(m_pSinogram->getGeometry());
- const CFanFlatVecProjectionGeometry2D* fanVecProjGeom = dynamic_cast<CFanFlatVecProjectionGeometry2D*>(m_pSinogram->getGeometry());
+ bool ok;
- bool ok = false;
- if (parProjGeom) {
+ const CVolumeGeometry2D* pVolGeom = m_pVolume->getGeometry();
+ const CProjectionGeometry2D* pProjGeom = m_pSinogram->getGeometry();
+ astraCUDA::SDimensions dims;
- float *offsets, *angles, detSize, outputScale;
- ok = convertAstraGeometry(pVolGeom, parProjGeom, offsets, angles, detSize, outputScale);
+ ok = convertAstraGeometry_dims(pVolGeom, pProjGeom, dims);
- ASTRA_ASSERT(ok); // FIXME
+ if (!ok)
+ return;
- // FIXME: Output scaling
+ astraCUDA::SParProjection* pParProjs = 0;
+ astraCUDA::SFanProjection* pFanProjs = 0;
+ float fOutputScale = 1.0f;
- ok = astraCudaFP(m_pVolume->getDataConst(), m_pSinogram->getData(),
- pVolGeom->getGridColCount(), pVolGeom->getGridRowCount(),
- parProjGeom->getProjectionAngleCount(),
- parProjGeom->getDetectorCount(),
- angles, offsets, detSize,
- m_iDetectorSuperSampling, 1.0f * outputScale, m_iGPUIndex);
-
- delete[] offsets;
- delete[] angles;
+ ok = convertAstraGeometry(pVolGeom, pProjGeom, pParProjs, pFanProjs, fOutputScale);
+ if (!ok)
+ return;
- } else if (fanProjGeom || fanVecProjGeom) {
+ if (pParProjs) {
+ assert(!pFanProjs);
- astraCUDA::SFanProjection* projs;
- float outputScale;
+ ok = astraCudaFP(m_pVolume->getDataConst(), m_pSinogram->getData(),
+ pVolGeom->getGridColCount(), pVolGeom->getGridRowCount(),
+ pProjGeom->getProjectionAngleCount(),
+ pProjGeom->getDetectorCount(),
+ pParProjs,
+ m_iDetectorSuperSampling, 1.0f * fOutputScale, m_iGPUIndex);
- if (fanProjGeom) {
- ok = convertAstraGeometry(pVolGeom, fanProjGeom, projs, outputScale);
- } else {
- ok = convertAstraGeometry(pVolGeom, fanVecProjGeom, projs, outputScale);
- }
+ delete[] pParProjs;
- ASTRA_ASSERT(ok);
+ } else {
+ assert(pFanProjs);
ok = astraCudaFanFP(m_pVolume->getDataConst(), m_pSinogram->getData(),
pVolGeom->getGridColCount(), pVolGeom->getGridRowCount(),
- m_pSinogram->getGeometry()->getProjectionAngleCount(),
- m_pSinogram->getGeometry()->getDetectorCount(),
- projs,
- m_iDetectorSuperSampling, outputScale, m_iGPUIndex);
-
- delete[] projs;
-
- } else {
+ pProjGeom->getProjectionAngleCount(),
+ pProjGeom->getDetectorCount(),
+ pFanProjs,
+ m_iDetectorSuperSampling, fOutputScale, m_iGPUIndex);
- ASTRA_ASSERT(false);
+ delete[] pFanProjs;
}