summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2015-03-11 17:27:44 +0100
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2015-03-11 17:27:44 +0100
commit18d12242207d1113c3015b451f522531168e626a (patch)
tree6b46783f569ce587bee745ac0d41f27ec340359a /src
parente188bcdaaffee075adf5fa4371453d91bcb71225 (diff)
downloadastra-18d12242207d1113c3015b451f522531168e626a.tar.gz
astra-18d12242207d1113c3015b451f522531168e626a.tar.bz2
astra-18d12242207d1113c3015b451f522531168e626a.tar.xz
astra-18d12242207d1113c3015b451f522531168e626a.zip
Add flexible volgeom3d support to astraCudaBP_SIRTWeighted
Diffstat (limited to 'src')
-rw-r--r--src/CudaBackProjectionAlgorithm3D.cpp87
1 files changed, 28 insertions, 59 deletions
diff --git a/src/CudaBackProjectionAlgorithm3D.cpp b/src/CudaBackProjectionAlgorithm3D.cpp
index abcf096..7117cfc 100644
--- a/src/CudaBackProjectionAlgorithm3D.cpp
+++ b/src/CudaBackProjectionAlgorithm3D.cpp
@@ -107,16 +107,8 @@ bool CCudaBackProjectionAlgorithm3D::initialize(const Config& _cfg)
m_iVoxelSuperSampling = (int)_cfg.self->getOptionNumerical("VoxelSuperSampling", 1);
CC.markOptionParsed("VoxelSuperSampling");
- 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();
@@ -178,7 +170,12 @@ void CCudaBackProjectionAlgorithm3D::run(int _iNrIterations)
const CParallelVecProjectionGeometry3D* parvec3dgeom = dynamic_cast<const CParallelVecProjectionGeometry3D*>(projgeom);
const CVolumeGeometry3D& volgeom = *pReconMem->getGeometry();
- if (conegeom) {
+ if (m_bSIRTWeighting) {
+ astraCudaBP_SIRTWeighted(pReconMem->getData(),
+ pSinoMem->getDataConst(),
+ &volgeom, projgeom,
+ m_iGPUIndex, m_iVoxelSuperSampling);
+ } else if (conegeom) {
astraCudaConeBP(pReconMem->getData(), pSinoMem->getDataConst(),
volgeom.getGridColCount(),
volgeom.getGridRowCount(),
@@ -193,55 +190,27 @@ void CCudaBackProjectionAlgorithm3D::run(int _iNrIterations)
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);
- }
+ 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 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);
- }
+ astraCudaPar3DBP(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(),