diff options
author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2017-02-14 14:10:08 +0100 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2017-02-14 14:11:29 +0100 |
commit | f591df5ff62deb8de2956cc8200db4034fb6ea05 (patch) | |
tree | b1bc92e1b86695907d9afbc83892450ad9e414f2 /cuda/3d | |
parent | 981d6adc0e3c98a67403b92b1ec4cdb881c62fda (diff) | |
download | astra-f591df5ff62deb8de2956cc8200db4034fb6ea05.tar.gz astra-f591df5ff62deb8de2956cc8200db4034fb6ea05.tar.bz2 astra-f591df5ff62deb8de2956cc8200db4034fb6ea05.tar.xz astra-f591df5ff62deb8de2956cc8200db4034fb6ea05.zip |
Fix FDK shortscan weighting
It was computing weights for angles in [0,2pi) but using them
on angles in (-2pi,0].
Diffstat (limited to 'cuda/3d')
-rw-r--r-- | cuda/3d/fdk.cu | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/cuda/3d/fdk.cu b/cuda/3d/fdk.cu index bf41b62..27357ad 100644 --- a/cuda/3d/fdk.cu +++ b/cuda/3d/fdk.cu @@ -121,14 +121,8 @@ __global__ void devFDK_ParkerWeight(void* D_projData, unsigned int projPitch, un // TODO: Detector pixel size const float fU = (detectorU - 0.5f*dims.iProjU + 0.5f) * fDetUSize; - //const float fGamma = atanf(fU / fCentralRayLength); - //const float fBeta = gC_angle[angle]; const float fGamma = atanf(fU / fCentralRayLength); - float fBeta = -gC_angle[angle]; - if (fBeta < 0.0f) - fBeta += 2*M_PI; - if (fBeta >= 2*M_PI) - fBeta -= 2*M_PI; + float fBeta = gC_angle[angle]; // compute the weight depending on the location in the central fan's radon // space @@ -195,24 +189,23 @@ bool FDK_PreWeight(cudaPitchedPtr D_projData, float fAngleBase; if (fdA >= 0.0f) { // going up from angles[0] - fAngleBase = angles[dims.iProjAngles - 1]; + fAngleBase = angles[0]; } else { // going down from angles[0] - fAngleBase = angles[0]; + fAngleBase = angles[dims.iProjAngles - 1]; } - // We pick the highest end of the range, and then - // move all angles so they fall in (-2pi,0] + // We pick the lowest end of the range, and then + // move all angles so they fall in [0,2pi) float *fRelAngles = new float[dims.iProjAngles]; for (unsigned int i = 0; i < dims.iProjAngles; ++i) { float f = angles[i] - fAngleBase; - while (f > 0) + while (f >= 2*M_PI) f -= 2*M_PI; - while (f <= -2*M_PI) + while (f < 0) f += 2*M_PI; fRelAngles[i] = f; - } cudaError_t e1 = cudaMemcpyToSymbol(gC_angle, fRelAngles, |