From 3cf63d335ebe392a8c77f0c90395c18150647aeb Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Fri, 29 Mar 2019 21:21:29 +0100 Subject: Adjust adjoint to line integral scaling --- cuda/2d/algo.cu | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'cuda/2d/algo.cu') diff --git a/cuda/2d/algo.cu b/cuda/2d/algo.cu index b4c2864..11422ff 100644 --- a/cuda/2d/algo.cu +++ b/cuda/2d/algo.cu @@ -258,10 +258,10 @@ bool ReconAlgo::copyDataToGPU(const float* pfSinogram, unsigned int iSinogramPit if (!ok) return false; - // rescale sinogram to adjust for pixel size - processSino(D_sinoData, fSinogramScale, - //1.0f/(fPixelSize*fPixelSize), - sinoPitch, dims); + // rescale sinogram + if (fSinogramScale != 1.0f) + processSino(D_sinoData, fSinogramScale, + sinoPitch, dims); ok = copyVolumeToDevice(pfReconstruction, iReconstructionPitch, dims, @@ -331,11 +331,11 @@ bool ReconAlgo::callBP(float* D_volumeData, unsigned int volumePitch, if (parProjs) { assert(!fanProjs); return BP(D_volumeData, volumePitch, D_projData, projPitch, - dims, parProjs, outputScale); + dims, parProjs, fOutputScale * outputScale); } else { assert(fanProjs); return FanBP(D_volumeData, volumePitch, D_projData, projPitch, - dims, fanProjs, outputScale); + dims, fanProjs, fOutputScale * outputScale); } } -- cgit v1.2.3 From 48f4e7b165404a0375db300b9fe59da92edf1cce Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sat, 30 Mar 2019 20:49:42 +0100 Subject: Adjust FBP to line integral scaling --- cuda/2d/algo.cu | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'cuda/2d/algo.cu') diff --git a/cuda/2d/algo.cu b/cuda/2d/algo.cu index 11422ff..59ea984 100644 --- a/cuda/2d/algo.cu +++ b/cuda/2d/algo.cu @@ -153,6 +153,12 @@ bool ReconAlgo::setSuperSampling(int raysPerDet, int raysPerPixelDim) return true; } +bool ReconAlgo::setReconstructionScale(float fScale) +{ + fOutputScale *= fScale; + return true; +} + bool ReconAlgo::setVolumeMask(float* _D_maskData, unsigned int _maskPitch) { assert(useVolumeMask); @@ -242,7 +248,7 @@ bool ReconAlgo::allocateBuffers() return true; } -bool ReconAlgo::copyDataToGPU(const float* pfSinogram, unsigned int iSinogramPitch, float fSinogramScale, +bool ReconAlgo::copyDataToGPU(const float* pfSinogram, unsigned int iSinogramPitch, const float* pfReconstruction, unsigned int iReconstructionPitch, const float* pfVolMask, unsigned int iVolMaskPitch, const float* pfSinoMask, unsigned int iSinoMaskPitch) @@ -258,11 +264,6 @@ bool ReconAlgo::copyDataToGPU(const float* pfSinogram, unsigned int iSinogramPit if (!ok) return false; - // rescale sinogram - if (fSinogramScale != 1.0f) - processSino(D_sinoData, fSinogramScale, - sinoPitch, dims); - ok = copyVolumeToDevice(pfReconstruction, iReconstructionPitch, dims, D_volumeData, volumePitch); -- cgit v1.2.3 From 11114e33fb504b0b74f3d239e77fe248a027cc23 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sat, 30 Mar 2019 21:12:01 +0100 Subject: Clean up outputscale naming confusion in cuda::algo --- cuda/2d/algo.cu | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'cuda/2d/algo.cu') diff --git a/cuda/2d/algo.cu b/cuda/2d/algo.cu index 59ea984..be15b25 100644 --- a/cuda/2d/algo.cu +++ b/cuda/2d/algo.cu @@ -134,8 +134,8 @@ bool ReconAlgo::setGeometry(const astra::CVolumeGeometry2D* pVolGeom, delete[] fanProjs; fanProjs = 0; - fOutputScale = 1.0f; - ok = convertAstraGeometry(pVolGeom, pProjGeom, parProjs, fanProjs, fOutputScale); + fProjectorScale = 1.0f; + ok = convertAstraGeometry(pVolGeom, pProjGeom, parProjs, fanProjs, fProjectorScale); if (!ok) return false; @@ -153,12 +153,6 @@ bool ReconAlgo::setSuperSampling(int raysPerDet, int raysPerPixelDim) return true; } -bool ReconAlgo::setReconstructionScale(float fScale) -{ - fOutputScale *= fScale; - return true; -} - bool ReconAlgo::setVolumeMask(float* _D_maskData, unsigned int _maskPitch) { assert(useVolumeMask); @@ -317,11 +311,11 @@ bool ReconAlgo::callFP(float* D_volumeData, unsigned int volumePitch, if (parProjs) { assert(!fanProjs); return FP(D_volumeData, volumePitch, D_projData, projPitch, - dims, parProjs, fOutputScale * outputScale); + dims, parProjs, fProjectorScale * outputScale); } else { assert(fanProjs); return FanFP(D_volumeData, volumePitch, D_projData, projPitch, - dims, fanProjs, fOutputScale * outputScale); + dims, fanProjs, fProjectorScale * outputScale); } } @@ -332,11 +326,11 @@ bool ReconAlgo::callBP(float* D_volumeData, unsigned int volumePitch, if (parProjs) { assert(!fanProjs); return BP(D_volumeData, volumePitch, D_projData, projPitch, - dims, parProjs, fOutputScale * outputScale); + dims, parProjs, fProjectorScale * outputScale); } else { assert(fanProjs); return FanBP(D_volumeData, volumePitch, D_projData, projPitch, - dims, fanProjs, fOutputScale * outputScale); + dims, fanProjs, fProjectorScale * outputScale); } } -- cgit v1.2.3