diff options
author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2015-12-01 12:27:44 +0100 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2015-12-01 12:27:44 +0100 |
commit | fff0e6dba508744f540bcf5efff76f676fe7af48 (patch) | |
tree | 5f33544e7d79b59501a5dd63a4922722eed8a98b /src/CudaSirtAlgorithm3D.cpp | |
parent | 0d5947a0e8e7d6f86c7591a96d877dfe14b187e4 (diff) | |
parent | dcfd15335549fa8e3e56260791cc4510331f7be6 (diff) | |
download | astra-fff0e6dba508744f540bcf5efff76f676fe7af48.tar.gz astra-fff0e6dba508744f540bcf5efff76f676fe7af48.tar.bz2 astra-fff0e6dba508744f540bcf5efff76f676fe7af48.tar.xz astra-fff0e6dba508744f540bcf5efff76f676fe7af48.zip |
Merge branch 'master' into python-plugins
Conflicts:
python/astra/utils.pyx
Diffstat (limited to 'src/CudaSirtAlgorithm3D.cpp')
-rw-r--r-- | src/CudaSirtAlgorithm3D.cpp | 43 |
1 files changed, 37 insertions, 6 deletions
diff --git a/src/CudaSirtAlgorithm3D.cpp b/src/CudaSirtAlgorithm3D.cpp index 5ad131b..67594f4 100644 --- a/src/CudaSirtAlgorithm3D.cpp +++ b/src/CudaSirtAlgorithm3D.cpp @@ -36,6 +36,9 @@ $Id$ #include "astra/ParallelProjectionGeometry3D.h" #include "astra/ParallelVecProjectionGeometry3D.h" #include "astra/ConeVecProjectionGeometry3D.h" +#include "astra/CudaProjector3D.h" + +#include "astra/Logging.h" #include "../cuda/3d/astra3d.h" @@ -89,7 +92,27 @@ bool CCudaSirtAlgorithm3D::_check() return true; } -//--------------------------------------------------------------------------------------- +//---------------------------------------------------------------------------------------- +void CCudaSirtAlgorithm3D::initializeFromProjector() +{ + m_iVoxelSuperSampling = 1; + m_iDetectorSuperSampling = 1; + m_iGPUIndex = -1; + + CCudaProjector3D* pCudaProjector = dynamic_cast<CCudaProjector3D*>(m_pProjector); + if (!pCudaProjector) { + if (m_pProjector) { + ASTRA_WARN("non-CUDA Projector3D passed to SIRT3D_CUDA"); + } + } else { + m_iVoxelSuperSampling = pCudaProjector->getVoxelSuperSampling(); + m_iDetectorSuperSampling = pCudaProjector->getDetectorSuperSampling(); + m_iGPUIndex = pCudaProjector->getGPUIndex(); + } + +} + +//-------------------------------------------------------------------------------------- // Initialize - Config bool CCudaSirtAlgorithm3D::initialize(const Config& _cfg) { @@ -107,12 +130,20 @@ bool CCudaSirtAlgorithm3D::initialize(const Config& _cfg) return false; } - m_iGPUIndex = (int)_cfg.self.getOptionNumerical("GPUindex", -1); - CC.markOptionParsed("GPUindex"); - m_iDetectorSuperSampling = (int)_cfg.self.getOptionNumerical("DetectorSuperSampling", 1); - CC.markOptionParsed("DetectorSuperSampling"); - m_iVoxelSuperSampling = (int)_cfg.self.getOptionNumerical("VoxelSuperSampling", 1); + initializeFromProjector(); + + // Deprecated options + m_iVoxelSuperSampling = (int)_cfg.self.getOptionNumerical("VoxelSuperSampling", m_iVoxelSuperSampling); + m_iDetectorSuperSampling = (int)_cfg.self.getOptionNumerical("DetectorSuperSampling", m_iDetectorSuperSampling); + m_iGPUIndex = (int)_cfg.self.getOptionNumerical("GPUindex", m_iGPUIndex); + m_iGPUIndex = (int)_cfg.self.getOptionNumerical("GPUIndex", m_iGPUIndex); CC.markOptionParsed("VoxelSuperSampling"); + CC.markOptionParsed("DetectorSuperSampling"); + CC.markOptionParsed("GPUIndex"); + if (!_cfg.self.hasOption("GPUIndex")) + CC.markOptionParsed("GPUindex"); + + m_pSirt = new AstraSIRT3d(); |