diff options
author | Willem Jan Palenstijn <wjp@usecode.org> | 2015-06-26 12:01:09 +0200 |
---|---|---|
committer | Willem Jan Palenstijn <wjp@usecode.org> | 2015-06-26 12:01:09 +0200 |
commit | ba092a5602abba8b1a4bd17988dee6b567f02b7a (patch) | |
tree | e7addffc79f6871c4d93338064f08a0347692047 /src/CudaSirtAlgorithm3D.cpp | |
parent | 62f3aa5792011792db866ce0841c8d164aa9a34d (diff) | |
parent | 233331b4a192c0149f58af1d4c89526260cd3a58 (diff) | |
download | astra-ba092a5602abba8b1a4bd17988dee6b567f02b7a.tar.gz astra-ba092a5602abba8b1a4bd17988dee6b567f02b7a.tar.bz2 astra-ba092a5602abba8b1a4bd17988dee6b567f02b7a.tar.xz astra-ba092a5602abba8b1a4bd17988dee6b567f02b7a.zip |
Merge pull request #75 from wjp/cuda_options
Move supersampling options from Algorithm to CudaProjector
Diffstat (limited to 'src/CudaSirtAlgorithm3D.cpp')
-rw-r--r-- | src/CudaSirtAlgorithm3D.cpp | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/CudaSirtAlgorithm3D.cpp b/src/CudaSirtAlgorithm3D.cpp index 5ad131b..abbb9fd 100644 --- a/src/CudaSirtAlgorithm3D.cpp +++ b/src/CudaSirtAlgorithm3D.cpp @@ -36,6 +36,7 @@ $Id$ #include "astra/ParallelProjectionGeometry3D.h" #include "astra/ParallelVecProjectionGeometry3D.h" #include "astra/ConeVecProjectionGeometry3D.h" +#include "astra/CudaProjector3D.h" #include "../cuda/3d/astra3d.h" @@ -107,12 +108,28 @@ bool CCudaSirtAlgorithm3D::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"); - m_iDetectorSuperSampling = (int)_cfg.self.getOptionNumerical("DetectorSuperSampling", 1); - CC.markOptionParsed("DetectorSuperSampling"); - m_iVoxelSuperSampling = (int)_cfg.self.getOptionNumerical("VoxelSuperSampling", 1); + + + m_iVoxelSuperSampling = 1; + m_iDetectorSuperSampling = 1; + if (pCudaProjector) { + // New interface + m_iVoxelSuperSampling = pCudaProjector->getVoxelSuperSampling(); + m_iDetectorSuperSampling = pCudaProjector->getDetectorSuperSampling(); + } + // Deprecated options + m_iVoxelSuperSampling = (int)_cfg.self.getOptionNumerical("VoxelSuperSampling", m_iVoxelSuperSampling); + m_iDetectorSuperSampling = (int)_cfg.self.getOptionNumerical("DetectorSuperSampling", m_iDetectorSuperSampling); CC.markOptionParsed("VoxelSuperSampling"); + CC.markOptionParsed("DetectorSuperSampling"); m_pSirt = new AstraSIRT3d(); |