From 399422985fd27a1e6a1f8cea3642402128b050fa Mon Sep 17 00:00:00 2001 From: "Daniel M. Pelt" Date: Fri, 20 May 2016 15:10:03 +0200 Subject: Add option to specify custom filter for FDK --- cuda/3d/astra3d.cu | 4 ++-- cuda/3d/astra3d.h | 2 +- cuda/3d/fdk.cu | 12 ++++++++++-- cuda/3d/fdk.h | 3 ++- 4 files changed, 15 insertions(+), 6 deletions(-) (limited to 'cuda/3d') diff --git a/cuda/3d/astra3d.cu b/cuda/3d/astra3d.cu index 5670873..35e3cd4 100644 --- a/cuda/3d/astra3d.cu +++ b/cuda/3d/astra3d.cu @@ -1311,7 +1311,7 @@ bool astraCudaFDK(float* pfVolume, const float* pfProjections, const CVolumeGeometry3D* pVolGeom, const CConeProjectionGeometry3D* pProjGeom, bool bShortScan, - int iGPUIndex, int iVoxelSuperSampling) + int iGPUIndex, int iVoxelSuperSampling, const float* filter) { SDimensions3D dims; @@ -1369,7 +1369,7 @@ bool astraCudaFDK(float* pfVolume, const float* pfProjections, // TODO: Offer interface for SrcZ, DetZ ok &= FDK(D_volumeData, D_projData, fOriginSourceDistance, fOriginDetectorDistance, 0, 0, fDetUSize, fDetVSize, - dims, pfAngles, bShortScan); + dims, pfAngles, bShortScan, filter); ok &= copyVolumeFromDevice(pfVolume, D_volumeData, dims, dims.iVolX); diff --git a/cuda/3d/astra3d.h b/cuda/3d/astra3d.h index 2137587..dde1347 100644 --- a/cuda/3d/astra3d.h +++ b/cuda/3d/astra3d.h @@ -314,7 +314,7 @@ _AstraExport bool astraCudaFDK(float* pfVolume, const float* pfProjections, const CVolumeGeometry3D* pVolGeom, const CConeProjectionGeometry3D* pProjGeom, bool bShortScan, - int iGPUIndex, int iVoxelSuperSampling); + int iGPUIndex, int iVoxelSuperSampling, const float* filter); } diff --git a/cuda/3d/fdk.cu b/cuda/3d/fdk.cu index 0e13be1..4899ad1 100644 --- a/cuda/3d/fdk.cu +++ b/cuda/3d/fdk.cu @@ -394,7 +394,8 @@ bool FDK(cudaPitchedPtr D_volumeData, cudaPitchedPtr D_projData, float fSrcOrigin, float fDetOrigin, float fSrcZ, float fDetZ, float fDetUSize, float fDetVSize, - const SDimensions3D& dims, const float* angles, bool bShortScan) + const SDimensions3D& dims, const float* angles, bool bShortScan, + const float* filter) { bool ok; // Generate filter @@ -412,7 +413,14 @@ bool FDK(cudaPitchedPtr D_volumeData, cufftComplex *pHostFilter = new cufftComplex[dims.iProjAngles * iHalfFFTSize]; memset(pHostFilter, 0, sizeof(cufftComplex) * dims.iProjAngles * iHalfFFTSize); - genFilter(FILTER_RAMLAK, 1.0f, dims.iProjAngles, pHostFilter, iPaddedDetCount, iHalfFFTSize); + if (filter==NULL){ + genFilter(FILTER_RAMLAK, 1.0f, dims.iProjAngles, pHostFilter, iPaddedDetCount, iHalfFFTSize); + }else{ + for(int i=0;i