diff options
| author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2016-12-01 14:03:56 +0100 | 
|---|---|---|
| committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2016-12-01 14:05:54 +0100 | 
| commit | 55dabbf035b55f71c4261c9de7ef572da46300ff (patch) | |
| tree | 0452eaf1342a67c56e1f785387116e1bb62fcd31 | |
| parent | 72aaa4f9176416303eff7cbd9ec56dcb13adc54f (diff) | |
Expose the density weighting option of cone_bp
It is now exposed via the new DensityWeighting option of CudaProjector3D.
| -rw-r--r-- | cuda/3d/mem3d.cu | 4 | ||||
| -rw-r--r-- | cuda/3d/mem3d.h | 2 | ||||
| -rw-r--r-- | include/astra/CudaProjector3D.h | 2 | ||||
| -rw-r--r-- | src/CompositeGeometryManager.cpp | 4 | ||||
| -rw-r--r-- | src/CudaProjector3D.cpp | 11 | 
5 files changed, 20 insertions, 3 deletions
| diff --git a/cuda/3d/mem3d.cu b/cuda/3d/mem3d.cu index eae9676..2b26fe1 100644 --- a/cuda/3d/mem3d.cu +++ b/cuda/3d/mem3d.cu @@ -249,7 +249,7 @@ bool FP(const astra::CProjectionGeometry3D* pProjGeom, MemHandle3D projData, con  	return ok;  } -bool BP(const astra::CProjectionGeometry3D* pProjGeom, MemHandle3D projData, const astra::CVolumeGeometry3D* pVolGeom, MemHandle3D volData, int iVoxelSuperSampling) +bool BP(const astra::CProjectionGeometry3D* pProjGeom, MemHandle3D projData, const astra::CVolumeGeometry3D* pVolGeom, MemHandle3D volData, int iVoxelSuperSampling, bool bFDKWeighting)  {  	SDimensions3D dims;  	SProjectorParams3D params; @@ -269,6 +269,8 @@ bool BP(const astra::CProjectionGeometry3D* pProjGeom, MemHandle3D projData, con  	                          pParProjs, pConeProjs,  	                          params); +	params.bFDKWeighting = bFDKWeighting; +  	if (pParProjs)  		ok &= Par3DBP(volData.d->ptr, projData.d->ptr, dims, pParProjs, params);  	else diff --git a/cuda/3d/mem3d.h b/cuda/3d/mem3d.h index 0e29774..a0829e2 100644 --- a/cuda/3d/mem3d.h +++ b/cuda/3d/mem3d.h @@ -93,7 +93,7 @@ bool setGPUIndex(int index);  bool FP(const astra::CProjectionGeometry3D* pProjGeom, MemHandle3D projData, const astra::CVolumeGeometry3D* pVolGeom, MemHandle3D volData, int iDetectorSuperSampling, astra::Cuda3DProjectionKernel projKernel); -bool BP(const astra::CProjectionGeometry3D* pProjGeom, MemHandle3D projData, const astra::CVolumeGeometry3D* pVolGeom, MemHandle3D volData, int iVoxelSuperSampling); +bool BP(const astra::CProjectionGeometry3D* pProjGeom, MemHandle3D projData, const astra::CVolumeGeometry3D* pVolGeom, MemHandle3D volData, int iVoxelSuperSampling, bool bFDKWeighting);  bool FDK(const astra::CProjectionGeometry3D* pProjGeom, MemHandle3D projData, const astra::CVolumeGeometry3D* pVolGeom, MemHandle3D volData, bool bShortScan, const float *pfFilter = 0); diff --git a/include/astra/CudaProjector3D.h b/include/astra/CudaProjector3D.h index 4c27b78..079321d 100644 --- a/include/astra/CudaProjector3D.h +++ b/include/astra/CudaProjector3D.h @@ -117,6 +117,7 @@ public:  	int getVoxelSuperSampling() const { return m_iVoxelSuperSampling; }  	int getDetectorSuperSampling() const { return m_iDetectorSuperSampling; }  	int getGPUIndex() const { return m_iGPUIndex; } +	bool getDensityWeighting() const { return m_bDensityWeighting; }  protected: @@ -124,6 +125,7 @@ protected:  	int m_iVoxelSuperSampling;  	int m_iDetectorSuperSampling;  	int m_iGPUIndex; +	bool m_bDensityWeighting;  }; diff --git a/src/CompositeGeometryManager.cpp b/src/CompositeGeometryManager.cpp index f72f38a..c3af228 100644 --- a/src/CompositeGeometryManager.cpp +++ b/src/CompositeGeometryManager.cpp @@ -1228,10 +1228,12 @@ static bool doJob(const CCompositeGeometryManager::TJobSet::const_iterator& iter  		Cuda3DProjectionKernel projKernel = ker3d_default;  		int detectorSuperSampling = 1;  		int voxelSuperSampling = 1; +		bool densityWeighting = false;  		if (projector) {  			projKernel = projector->getProjectionKernel();  			detectorSuperSampling = projector->getDetectorSuperSampling();  			voxelSuperSampling = projector->getVoxelSuperSampling(); +			densityWeighting = projector->getDensityWeighting();  		}  		size_t inx, iny, inz; @@ -1274,7 +1276,7 @@ static bool doJob(const CCompositeGeometryManager::TJobSet::const_iterator& iter  			ASTRA_DEBUG("CCompositeGeometryManager::doJobs: doing BP"); -			ok = astraCUDA3d::BP(((CCompositeGeometryManager::CProjectionPart*)j.pInput.get())->pGeom, inputMem, ((CCompositeGeometryManager::CVolumePart*)j.pOutput.get())->pGeom, outputMem, voxelSuperSampling); +			ok = astraCUDA3d::BP(((CCompositeGeometryManager::CProjectionPart*)j.pInput.get())->pGeom, inputMem, ((CCompositeGeometryManager::CVolumePart*)j.pOutput.get())->pGeom, outputMem, voxelSuperSampling, densityWeighting);  			if (!ok) ASTRA_ERROR("Error performing sub-BP");  			ASTRA_DEBUG("CCompositeGeometryManager::doJobs: BP done");  		} diff --git a/src/CudaProjector3D.cpp b/src/CudaProjector3D.cpp index 29af0c6..a1f091e 100644 --- a/src/CudaProjector3D.cpp +++ b/src/CudaProjector3D.cpp @@ -30,6 +30,9 @@ along with the ASTRA Toolbox. If not, see <http://www.gnu.org/licenses/>.  #include "astra/VolumeGeometry3D.h"  #include "astra/ProjectionGeometry3D.h" +#include "astra/ConeProjectionGeometry3D.h" +#include "astra/ConeVecProjectionGeometry3D.h" +  namespace astra  { @@ -64,6 +67,7 @@ void CCudaProjector3D::_clear()  	m_iVoxelSuperSampling = 1;  	m_iDetectorSuperSampling = 1;  	m_iGPUIndex = -1; +	m_bDensityWeighting = false;  }  //---------------------------------------------------------------------------------------- @@ -128,6 +132,13 @@ bool CCudaProjector3D::initialize(const Config& _cfg)  	m_iDetectorSuperSampling = (int)_cfg.self.getOptionNumerical("DetectorSuperSampling", 1);  	CC.markOptionParsed("DetectorSuperSampling"); +	if (dynamic_cast<CConeProjectionGeometry3D*>(m_pProjectionGeometry) || +	    dynamic_cast<CConeVecProjectionGeometry3D*>(m_pProjectionGeometry)) +	{ +		m_bDensityWeighting = _cfg.self.getOptionBool("DensityWeighting", false); +		CC.markOptionParsed("DensityWeighting"); +	} +  	m_iGPUIndex = (int)_cfg.self.getOptionNumerical("GPUindex", -1);  	m_iGPUIndex = (int)_cfg.self.getOptionNumerical("GPUIndex", m_iGPUIndex);  	CC.markOptionParsed("GPUIndex"); | 
