summaryrefslogtreecommitdiffstats
path: root/src/CudaBackProjectionAlgorithm3D.cpp
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2015-12-02 15:29:58 +0100
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2015-12-02 15:29:58 +0100
commitf637af457985fbcf6be5641e98df6d87ca622d24 (patch)
tree4c015188c6b5e33c1a9d88032f61a434063259fb /src/CudaBackProjectionAlgorithm3D.cpp
parente48d0a53730bb7faa2463a64db0989ba341e12b8 (diff)
parent6d57f7874713e6632c2e49590538c6a48ddcc311 (diff)
downloadastra-f637af457985fbcf6be5641e98df6d87ca622d24.tar.gz
astra-f637af457985fbcf6be5641e98df6d87ca622d24.tar.bz2
astra-f637af457985fbcf6be5641e98df6d87ca622d24.tar.xz
astra-f637af457985fbcf6be5641e98df6d87ca622d24.zip
Merge branch 'master' into volgeom3d
Diffstat (limited to 'src/CudaBackProjectionAlgorithm3D.cpp')
-rw-r--r--src/CudaBackProjectionAlgorithm3D.cpp43
1 files changed, 31 insertions, 12 deletions
diff --git a/src/CudaBackProjectionAlgorithm3D.cpp b/src/CudaBackProjectionAlgorithm3D.cpp
index a5c3445..8cf4c3b 100644
--- a/src/CudaBackProjectionAlgorithm3D.cpp
+++ b/src/CudaBackProjectionAlgorithm3D.cpp
@@ -38,6 +38,8 @@ $Id$
#include "astra/ParallelVecProjectionGeometry3D.h"
#include "astra/ConeVecProjectionGeometry3D.h"
+#include "astra/Logging.h"
+
#include "../cuda/3d/astra3d.h"
using namespace std;
@@ -87,6 +89,24 @@ bool CCudaBackProjectionAlgorithm3D::_check()
}
//---------------------------------------------------------------------------------------
+void CCudaBackProjectionAlgorithm3D::initializeFromProjector()
+{
+ m_iVoxelSuperSampling = 1;
+ m_iGPUIndex = -1;
+
+ CCudaProjector3D* pCudaProjector = dynamic_cast<CCudaProjector3D*>(m_pProjector);
+ if (!pCudaProjector) {
+ if (m_pProjector) {
+ ASTRA_WARN("non-CUDA Projector3D passed to BP3D_CUDA");
+ }
+ } else {
+ m_iVoxelSuperSampling = pCudaProjector->getVoxelSuperSampling();
+ m_iGPUIndex = pCudaProjector->getGPUIndex();
+ }
+
+}
+
+//---------------------------------------------------------------------------------------
// Initialize - Config
bool CCudaBackProjectionAlgorithm3D::initialize(const Config& _cfg)
{
@@ -103,21 +123,18 @@ bool CCudaBackProjectionAlgorithm3D::initialize(const Config& _cfg)
return false;
}
- CCudaProjector3D* pCudaProjector = 0;
- pCudaProjector = dynamic_cast<CCudaProjector3D*>(m_pProjector);
- if (!pCudaProjector) {
- // TODO: Report
- }
-
- m_iGPUIndex = (int)_cfg.self.getOptionNumerical("GPUindex", -1);
- CC.markOptionParsed("GPUindex");
-
+ initializeFromProjector();
- m_iVoxelSuperSampling = 1;
- if (pCudaProjector)
- m_iVoxelSuperSampling = pCudaProjector->getVoxelSuperSampling();
+ // Deprecated options
m_iVoxelSuperSampling = (int)_cfg.self.getOptionNumerical("VoxelSuperSampling", m_iVoxelSuperSampling);
+ m_iGPUIndex = (int)_cfg.self.getOptionNumerical("GPUindex", m_iGPUIndex);
+ m_iGPUIndex = (int)_cfg.self.getOptionNumerical("GPUIndex", m_iGPUIndex);
CC.markOptionParsed("VoxelSuperSampling");
+ CC.markOptionParsed("GPUIndex");
+ if (!_cfg.self.hasOption("GPUIndex"))
+ CC.markOptionParsed("GPUindex");
+
+
m_bSIRTWeighting = _cfg.self.getOptionBool("SIRTWeighting", false);
CC.markOptionParsed("SIRTWeighting");
@@ -143,6 +160,8 @@ bool CCudaBackProjectionAlgorithm3D::initialize(CProjector3D* _pProjector,
m_pSinogram = _pSinogram;
m_pReconstruction = _pReconstruction;
+ initializeFromProjector();
+
// success
m_bIsInitialized = _check();
return m_bIsInitialized;