From 628e1da0b73140bd73501de3805b27b78ec8a19c Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 1 Dec 2021 10:52:15 +0100 Subject: Handle angular range discretisation better --- cuda/3d/fdk.cu | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'cuda') diff --git a/cuda/3d/fdk.cu b/cuda/3d/fdk.cu index e549670..754aa7b 100644 --- a/cuda/3d/fdk.cu +++ b/cuda/3d/fdk.cu @@ -218,6 +218,10 @@ bool FDK_PreWeight(cudaPitchedPtr D_projData, } float fRange = fabs(fRelAngles[dims.iProjAngles-1] - fRelAngles[0]); + // Adjust for discretisation + fRange /= dims.iProjAngles - 1; + fRange *= dims.iProjAngles; + ASTRA_DEBUG("Assuming angles are linearly ordered and equally spaced for Parker weighting. Angular range %f radians", fRange); float fScale = fRange / M_PI; @@ -230,8 +234,7 @@ bool FDK_PreWeight(cudaPitchedPtr D_projData, float fCentralFanAngle = fabs(atanf(fDetUSize * (dims.iProjU*0.5f) / (fSrcOrigin + fDetOrigin))); - // Check range, but take possible discretisation and rounding into affect - if (fRange + 1e-3 < (M_PI + 2*fCentralFanAngle) * (dims.iProjAngles - 1)/ dims.iProjAngles) { + if (fRange + 1e-3 < M_PI + 2*fCentralFanAngle) { ASTRA_WARN("Angular range (%f rad) smaller than Parker weighting range (%f rad)", fRange, M_PI + 2*fCentralFanAngle); } -- cgit v1.2.3