diff options
Diffstat (limited to 'cuda/2d/fbp.cu')
-rw-r--r-- | cuda/2d/fbp.cu | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/cuda/2d/fbp.cu b/cuda/2d/fbp.cu index a5b8a7a..4fc3983 100644 --- a/cuda/2d/fbp.cu +++ b/cuda/2d/fbp.cu @@ -58,7 +58,8 @@ int FBP::calcFourierFilterSize(int _iDetectorCount) FBP::FBP() : ReconAlgo() { D_filter = 0; - + m_bShortScan = false; + fReconstructionScale = 1.0f; } FBP::~FBP() @@ -72,6 +73,8 @@ void FBP::reset() freeComplexOnDevice((cufftComplex *)D_filter); D_filter = 0; } + m_bShortScan = false; + fReconstructionScale = 1.0f; } bool FBP::init() @@ -79,6 +82,12 @@ bool FBP::init() return true; } +bool FBP::setReconstructionScale(float fScale) +{ + fReconstructionScale = fScale; + return true; +} + bool FBP::setFilter(const astra::SFilterConfig &_cfg) { if (D_filter) @@ -292,7 +301,7 @@ bool FBP::iterate(unsigned int iterations) astraCUDA3d::FDK_PreWeight(tmp, fOriginSource, fOriginDetector, 0.0f, - fFanDetSize, 1.0f, /* fPixelSize */ 1.0f, + fFanDetSize, 1.0f, m_bShortScan, dims3d, pfAngles); } else { // TODO: How should different detector pixel size in different @@ -319,17 +328,14 @@ bool FBP::iterate(unsigned int iterations) } if (fanProjs) { - float fOutputScale = 1.0 / (/*fPixelSize * fPixelSize * fPixelSize * */ fFanDetSize * fFanDetSize); - - ok = FanBP_FBPWeighted(D_volumeData, volumePitch, D_sinoData, sinoPitch, dims, fanProjs, fOutputScale); + ok = FanBP_FBPWeighted(D_volumeData, volumePitch, D_sinoData, sinoPitch, dims, fanProjs, fProjectorScale * fReconstructionScale); } 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); + ok = BP(D_volumeData, volumePitch, D_sinoData, sinoPitch, dims, parProjs, fOutputScale * fProjectorScale * fReconstructionScale); } if(!ok) { |