From 9fa2ffdc5348f8f19de48d06a72b82bdc1ba8f22 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Thu, 30 Nov 2017 16:59:18 +0100 Subject: Start on fixing FDK and BP voxel-size weighting factors --- cuda/2d/astra.cu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cuda/2d') diff --git a/cuda/2d/astra.cu b/cuda/2d/astra.cu index c0132b2..0069bc3 100644 --- a/cuda/2d/astra.cu +++ b/cuda/2d/astra.cu @@ -343,7 +343,7 @@ bool AstraFBP::run() astraCUDA3d::FDK_PreWeight(tmp, pData->fOriginSourceDistance, pData->fOriginDetectorDistance, 0.0f, - pData->dims.fDetScale, 1.0f, // TODO: Are these correct? + pData->dims.fDetScale, 1.0f, 1.0f, // TODO: Are these correct? pData->bShortScan, dims3d, pData->angles); } -- cgit v1.2.3 From d61ce8cb50cee2145d66a209cbeb2b07ae645355 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Thu, 30 Nov 2017 17:41:13 +0100 Subject: Adapt FBP_CUDA voxel-size weighting factors --- cuda/2d/astra.cu | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'cuda/2d') diff --git a/cuda/2d/astra.cu b/cuda/2d/astra.cu index 0069bc3..41ce0c8 100644 --- a/cuda/2d/astra.cu +++ b/cuda/2d/astra.cu @@ -343,7 +343,7 @@ bool AstraFBP::run() astraCUDA3d::FDK_PreWeight(tmp, pData->fOriginSourceDistance, pData->fOriginDetectorDistance, 0.0f, - pData->dims.fDetScale, 1.0f, 1.0f, // TODO: Are these correct? + pData->dims.fDetScale, 1.0f, pData->fPixelSize, // TODO: Are these correct? pData->bShortScan, dims3d, pData->angles); } @@ -366,12 +366,17 @@ bool AstraFBP::run() } - float fOutputScale = (M_PI / 2.0f) / (float)pData->dims.iProjAngles; if (pData->bFanBeam) { - ok = FanBP_FBPWeighted(pData->D_volumeData, pData->volumePitch, pData->D_sinoData, pData->sinoPitch, pData->dims, pData->fanProjections, fOutputScale); + float fOutputScale = 1.0 / (pData->fPixelSize * pData->fPixelSize * pData->fPixelSize * pData->dims.fDetScale * pData->dims.fDetScale); + ok = FanBP_FBPWeighted(pData->D_volumeData, pData->volumePitch, pData->D_sinoData, pData->sinoPitch, pData->dims, pData->fanProjections, fOutputScale); } else { + // scale by number of angles. For the fan-beam case, this is already + // handled by FDK_PreWeight + float fOutputScale = (M_PI / 2.0f) / (float)pData->dims.iProjAngles; + fOutputScale /= pData->dims.fDetScale * pData->dims.fDetScale; + ok = BP(pData->D_volumeData, pData->volumePitch, pData->D_sinoData, pData->sinoPitch, pData->dims, pData->angles, pData->TOffsets, fOutputScale); } if(!ok) -- cgit v1.2.3