From 167ec3f4e1cbe4eb856474cb515291261955b053 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Fri, 22 May 2015 14:56:28 +0200 Subject: Add supersampling options to Cuda Projectors --- include/astra/CudaProjector2D.h | 6 ++++++ include/astra/CudaProjector3D.h | 5 ++++- src/CudaProjector2D.cpp | 8 ++++++++ src/CudaProjector3D.cpp | 8 ++++++++ 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/include/astra/CudaProjector2D.h b/include/astra/CudaProjector2D.h index a571851..ecfca41 100644 --- a/include/astra/CudaProjector2D.h +++ b/include/astra/CudaProjector2D.h @@ -121,9 +121,15 @@ public: virtual std::string description() const; + Cuda2DProjectionKernel getProjectionKernel() const { return m_projectionKernel; } + int getVoxelSuperSampling() const { return m_iVoxelSuperSampling; } + int getDetectorSuperSampling() const { return m_iDetectorSuperSampling; } + protected: Cuda2DProjectionKernel m_projectionKernel; + int m_iVoxelSuperSampling; + int m_iDetectorSuperSampling; }; //---------------------------------------------------------------------------------------- diff --git a/include/astra/CudaProjector3D.h b/include/astra/CudaProjector3D.h index a181531..1d570fe 100644 --- a/include/astra/CudaProjector3D.h +++ b/include/astra/CudaProjector3D.h @@ -115,11 +115,14 @@ public: Cuda3DProjectionKernel getProjectionKernel() const { return m_projectionKernel; } + int getVoxelSuperSampling() const { return m_iVoxelSuperSampling; } + int getDetectorSuperSampling() const { return m_iDetectorSuperSampling; } protected: Cuda3DProjectionKernel m_projectionKernel; - + int m_iVoxelSuperSampling; + int m_iDetectorSuperSampling; }; diff --git a/src/CudaProjector2D.cpp b/src/CudaProjector2D.cpp index fa024c8..a26e32d 100644 --- a/src/CudaProjector2D.cpp +++ b/src/CudaProjector2D.cpp @@ -59,6 +59,8 @@ void CCudaProjector2D::_clear() m_bIsInitialized = false; m_projectionKernel = ker2d_default; + m_iVoxelSuperSampling = 1; + m_iDetectorSuperSampling = 1; } //---------------------------------------------------------------------------------------- @@ -117,6 +119,12 @@ bool CCudaProjector2D::initialize(const Config& _cfg) } CC.markNodeParsed("ProjectionKernel"); + m_iVoxelSuperSampling = (int)_cfg.self.getOptionNumerical("VoxelSuperSampling", 1); + CC.markOptionParsed("VoxelSuperSampling"); + + m_iDetectorSuperSampling = (int)_cfg.self.getOptionNumerical("DetectorSuperSampling", 1); + CC.markOptionParsed("DetectorSuperSampling"); + m_bIsInitialized = _check(); return m_bIsInitialized; } diff --git a/src/CudaProjector3D.cpp b/src/CudaProjector3D.cpp index 41529a5..d2fd74c 100644 --- a/src/CudaProjector3D.cpp +++ b/src/CudaProjector3D.cpp @@ -62,6 +62,8 @@ void CCudaProjector3D::_clear() m_bIsInitialized = false; m_projectionKernel = ker3d_default; + m_iVoxelSuperSampling = 1; + m_iDetectorSuperSampling = 1; } //---------------------------------------------------------------------------------------- @@ -120,6 +122,12 @@ bool CCudaProjector3D::initialize(const Config& _cfg) } CC.markNodeParsed("ProjectionKernel"); + m_iVoxelSuperSampling = (int)_cfg.self.getOptionNumerical("VoxelSuperSampling", 1); + CC.markOptionParsed("VoxelSuperSampling"); + + m_iDetectorSuperSampling = (int)_cfg.self.getOptionNumerical("DetectorSuperSampling", 1); + CC.markOptionParsed("DetectorSuperSampling"); + m_bIsInitialized = _check(); return m_bIsInitialized; } -- cgit v1.2.3