summaryrefslogtreecommitdiffstats
path: root/src/CudaBackProjectionAlgorithm3D.cpp
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <wjp@usecode.org>2015-12-02 17:20:12 +0100
committerWillem Jan Palenstijn <wjp@usecode.org>2015-12-02 17:20:12 +0100
commitfd65fb03397ded59cfb872eb361e7d2e154c3335 (patch)
tree4c015188c6b5e33c1a9d88032f61a434063259fb /src/CudaBackProjectionAlgorithm3D.cpp
parent6d57f7874713e6632c2e49590538c6a48ddcc311 (diff)
parentf637af457985fbcf6be5641e98df6d87ca622d24 (diff)
downloadastra-fd65fb03397ded59cfb872eb361e7d2e154c3335.tar.gz
astra-fd65fb03397ded59cfb872eb361e7d2e154c3335.tar.bz2
astra-fd65fb03397ded59cfb872eb361e7d2e154c3335.tar.xz
astra-fd65fb03397ded59cfb872eb361e7d2e154c3335.zip
Merge pull request #91 from wjp/volgeom3d
Remove restrictions on volgeom3d
Diffstat (limited to 'src/CudaBackProjectionAlgorithm3D.cpp')
-rw-r--r--src/CudaBackProjectionAlgorithm3D.cpp99
1 files changed, 10 insertions, 89 deletions
diff --git a/src/CudaBackProjectionAlgorithm3D.cpp b/src/CudaBackProjectionAlgorithm3D.cpp
index c9d9447..8cf4c3b 100644
--- a/src/CudaBackProjectionAlgorithm3D.cpp
+++ b/src/CudaBackProjectionAlgorithm3D.cpp
@@ -136,16 +136,8 @@ bool CCudaBackProjectionAlgorithm3D::initialize(const Config& _cfg)
- CFloat32ProjectionData3DMemory* pSinoMem = dynamic_cast<CFloat32ProjectionData3DMemory*>(m_pSinogram);
- ASTRA_ASSERT(pSinoMem);
- const CProjectionGeometry3D* projgeom = pSinoMem->getGeometry();
-const CParallelProjectionGeometry3D* par3dgeom = dynamic_cast<const CParallelProjectionGeometry3D*>(projgeom);
- const CParallelVecProjectionGeometry3D* parvec3dgeom = dynamic_cast<const CParallelVecProjectionGeometry3D*>(projgeom);
- if (parvec3dgeom || par3dgeom) {
- // This option is only supported for Par3D currently
- m_bSIRTWeighting = _cfg.self.getOptionBool("SIRTWeighting", false);
- CC.markOptionParsed("SIRTWeighting");
- }
+ m_bSIRTWeighting = _cfg.self.getOptionBool("SIRTWeighting", false);
+ CC.markOptionParsed("SIRTWeighting");
// success
m_bIsInitialized = _check();
@@ -203,88 +195,17 @@ void CCudaBackProjectionAlgorithm3D::run(int _iNrIterations)
ASTRA_ASSERT(pReconMem);
const CProjectionGeometry3D* projgeom = pSinoMem->getGeometry();
- const CConeProjectionGeometry3D* conegeom = dynamic_cast<const CConeProjectionGeometry3D*>(projgeom);
- const CParallelProjectionGeometry3D* par3dgeom = dynamic_cast<const CParallelProjectionGeometry3D*>(projgeom);
- const CConeVecProjectionGeometry3D* conevecgeom = dynamic_cast<const CConeVecProjectionGeometry3D*>(projgeom);
- const CParallelVecProjectionGeometry3D* parvec3dgeom = dynamic_cast<const CParallelVecProjectionGeometry3D*>(projgeom);
const CVolumeGeometry3D& volgeom = *pReconMem->getGeometry();
- if (conegeom) {
- astraCudaConeBP(pReconMem->getData(), pSinoMem->getDataConst(),
- volgeom.getGridColCount(),
- volgeom.getGridRowCount(),
- volgeom.getGridSliceCount(),
- conegeom->getProjectionCount(),
- conegeom->getDetectorColCount(),
- conegeom->getDetectorRowCount(),
- conegeom->getOriginSourceDistance(),
- conegeom->getOriginDetectorDistance(),
- conegeom->getDetectorSpacingX(),
- conegeom->getDetectorSpacingY(),
- conegeom->getProjectionAngles(),
- m_iGPUIndex, m_iVoxelSuperSampling);
- } else if (par3dgeom) {
- if (!m_bSIRTWeighting) {
- astraCudaPar3DBP(pReconMem->getData(), pSinoMem->getDataConst(),
- volgeom.getGridColCount(),
- volgeom.getGridRowCount(),
- volgeom.getGridSliceCount(),
- par3dgeom->getProjectionCount(),
- par3dgeom->getDetectorColCount(),
- par3dgeom->getDetectorRowCount(),
- par3dgeom->getDetectorSpacingX(),
- par3dgeom->getDetectorSpacingY(),
- par3dgeom->getProjectionAngles(),
- m_iGPUIndex, m_iVoxelSuperSampling);
- } else {
- astraCudaPar3DBP_SIRTWeighted(pReconMem->getData(),
- pSinoMem->getDataConst(),
- volgeom.getGridColCount(),
- volgeom.getGridRowCount(),
- volgeom.getGridSliceCount(),
- par3dgeom->getProjectionCount(),
- par3dgeom->getDetectorColCount(),
- par3dgeom->getDetectorRowCount(),
- par3dgeom->getDetectorSpacingX(),
- par3dgeom->getDetectorSpacingY(),
- par3dgeom->getProjectionAngles(),
- m_iGPUIndex, m_iVoxelSuperSampling);
- }
- } else if (parvec3dgeom) {
- if (!m_bSIRTWeighting) {
- astraCudaPar3DBP(pReconMem->getData(), pSinoMem->getDataConst(),
- volgeom.getGridColCount(),
- volgeom.getGridRowCount(),
- volgeom.getGridSliceCount(),
- parvec3dgeom->getProjectionCount(),
- parvec3dgeom->getDetectorColCount(),
- parvec3dgeom->getDetectorRowCount(),
- parvec3dgeom->getProjectionVectors(),
- m_iGPUIndex, m_iVoxelSuperSampling);
- } else {
- astraCudaPar3DBP_SIRTWeighted(pReconMem->getData(),
- pSinoMem->getDataConst(),
- volgeom.getGridColCount(),
- volgeom.getGridRowCount(),
- volgeom.getGridSliceCount(),
- parvec3dgeom->getProjectionCount(),
- parvec3dgeom->getDetectorColCount(),
- parvec3dgeom->getDetectorRowCount(),
- parvec3dgeom->getProjectionVectors(),
- m_iGPUIndex, m_iVoxelSuperSampling);
- }
- } else if (conevecgeom) {
- astraCudaConeBP(pReconMem->getData(), pSinoMem->getDataConst(),
- volgeom.getGridColCount(),
- volgeom.getGridRowCount(),
- volgeom.getGridSliceCount(),
- conevecgeom->getProjectionCount(),
- conevecgeom->getDetectorColCount(),
- conevecgeom->getDetectorRowCount(),
- conevecgeom->getProjectionVectors(),
- m_iGPUIndex, m_iVoxelSuperSampling);
+ if (m_bSIRTWeighting) {
+ astraCudaBP_SIRTWeighted(pReconMem->getData(),
+ pSinoMem->getDataConst(),
+ &volgeom, projgeom,
+ m_iGPUIndex, m_iVoxelSuperSampling);
} else {
- ASTRA_ASSERT(false);
+ astraCudaBP(pReconMem->getData(), pSinoMem->getDataConst(),
+ &volgeom, projgeom,
+ m_iGPUIndex, m_iVoxelSuperSampling);
}
}