diff options
author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2018-03-18 19:06:15 +0100 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2018-03-18 19:06:15 +0100 |
commit | 7917587464fc6f3e4cf98a7e0e4c73a0be615dc4 (patch) | |
tree | cfe4e47f067f5092f65b40be51e29d6e6690137d /cuda/2d/fbp.cu | |
parent | 74cc865c203cc729f13d9e8348814236271aa6c8 (diff) | |
parent | a9ee92fa1f5d72cf5fa178fbf6a6a547c95f7cc8 (diff) | |
download | astra-7917587464fc6f3e4cf98a7e0e4c73a0be615dc4.tar.gz astra-7917587464fc6f3e4cf98a7e0e4c73a0be615dc4.tar.bz2 astra-7917587464fc6f3e4cf98a7e0e4c73a0be615dc4.tar.xz astra-7917587464fc6f3e4cf98a7e0e4c73a0be615dc4.zip |
Merge branch 'fdk'
Diffstat (limited to 'cuda/2d/fbp.cu')
-rw-r--r-- | cuda/2d/fbp.cu | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/cuda/2d/fbp.cu b/cuda/2d/fbp.cu index e7ed277..ecaf544 100644 --- a/cuda/2d/fbp.cu +++ b/cuda/2d/fbp.cu @@ -260,6 +260,7 @@ bool FBP::iterate(unsigned int iterations) bool ok = false; + float fFanDetSize = 0.0f; if (fanProjs) { // Call FDK_PreWeight to handle fan beam geometry. We treat // this as a cone beam setup of a single slice: @@ -271,12 +272,12 @@ bool FBP::iterate(unsigned int iterations) float *pfAngles = new float[dims.iProjAngles]; - float fOriginSource, fOriginDetector, fDetSize, fOffset; + float fOriginSource, fOriginDetector, fOffset; for (unsigned int i = 0; i < dims.iProjAngles; ++i) { bool ok = astra::getFanParameters(fanProjs[i], dims.iProjDets, pfAngles[i], fOriginSource, fOriginDetector, - fDetSize, fOffset); + fFanDetSize, fOffset); if (!ok) { ASTRA_ERROR("FBP_CUDA: Failed to extract circular fan beam parameters from fan beam geometry"); return false; @@ -300,7 +301,7 @@ bool FBP::iterate(unsigned int iterations) astraCUDA3d::FDK_PreWeight(tmp, fOriginSource, fOriginDetector, 0.0f, - fDetSize, 1.0f, + fFanDetSize, 1.0f, /* fPixelSize */ 1.0f, m_bShortScan, dims3d, pfAngles); } else { // TODO: How should different detector pixel size in different @@ -326,12 +327,17 @@ bool FBP::iterate(unsigned int iterations) } - float fOutputScale = (M_PI / 2.0f) / (float)dims.iProjAngles; - if (fanProjs) { + float fOutputScale = 1.0 / (/*fPixelSize * fPixelSize * fPixelSize * */ fFanDetSize * fFanDetSize); + ok = FanBP_FBPWeighted(D_volumeData, volumePitch, D_sinoData, sinoPitch, dims, fanProjs, 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)dims.iProjAngles; + //fOutputScale /= fDetSize * fDetSize; + ok = BP(D_volumeData, volumePitch, D_sinoData, sinoPitch, dims, parProjs, fOutputScale); } if(!ok) |