diff options
author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2019-09-27 15:16:26 +0200 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2019-09-27 15:16:26 +0200 |
commit | 54af7e8e22a3f1c9d90b13291b28d39778c05564 (patch) | |
tree | 260310b16d624261bb80f82979af27750022259b /cuda/2d/cgls.cu | |
parent | 1fec36f7ccadd5f7dcf2bb59b0654dc53653b0f3 (diff) | |
parent | b629db207bb263495bfff2e61ce189ccac27b4b9 (diff) | |
download | astra-54af7e8e22a3f1c9d90b13291b28d39778c05564.tar.gz astra-54af7e8e22a3f1c9d90b13291b28d39778c05564.tar.bz2 astra-54af7e8e22a3f1c9d90b13291b28d39778c05564.tar.xz astra-54af7e8e22a3f1c9d90b13291b28d39778c05564.zip |
Merge branch 'consistent_scaling'
Diffstat (limited to 'cuda/2d/cgls.cu')
-rw-r--r-- | cuda/2d/cgls.cu | 65 |
1 files changed, 2 insertions, 63 deletions
diff --git a/cuda/2d/cgls.cu b/cuda/2d/cgls.cu index b6a9fae..e7238b9 100644 --- a/cuda/2d/cgls.cu +++ b/cuda/2d/cgls.cu @@ -29,10 +29,6 @@ along with the ASTRA Toolbox. If not, see <http://www.gnu.org/licenses/>. #include "astra/cuda/2d/util.h" #include "astra/cuda/2d/arith.h" -#ifdef STANDALONE -#include "testutil.h" -#endif - #include <cstdio> #include <cassert> @@ -102,14 +98,14 @@ bool CGLS::setBuffers(float* _D_volumeData, unsigned int _volumePitch, return true; } -bool CGLS::copyDataToGPU(const float* pfSinogram, unsigned int iSinogramPitch, float fSinogramScale, +bool CGLS::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) { sliceInitialized = false; - return ReconAlgo::copyDataToGPU(pfSinogram, iSinogramPitch, fSinogramScale, pfReconstruction, iReconstructionPitch, pfVolMask, iVolMaskPitch, pfSinoMask, iSinoMaskPitch); + return ReconAlgo::copyDataToGPU(pfSinogram, iSinogramPitch, pfReconstruction, iReconstructionPitch, pfVolMask, iVolMaskPitch, pfSinoMask, iSinoMaskPitch); } bool CGLS::iterate(unsigned int iterations) @@ -206,60 +202,3 @@ float CGLS::computeDiffNorm() } - -#ifdef STANDALONE - -using namespace astraCUDA; - -int main() -{ - float* D_volumeData; - float* D_sinoData; - - SDimensions dims; - dims.iVolWidth = 1024; - dims.iVolHeight = 1024; - dims.iProjAngles = 512; - dims.iProjDets = 1536; - dims.fDetScale = 1.0f; - dims.iRaysPerDet = 1; - unsigned int volumePitch, sinoPitch; - - allocateVolume(D_volumeData, dims.iVolWidth, dims.iVolHeight, volumePitch); - zeroVolume(D_volumeData, volumePitch, dims.iVolWidth, dims.iVolHeight); - printf("pitch: %u\n", volumePitch); - - allocateVolume(D_sinoData, dims.iProjDets, dims.iProjAngles, sinoPitch); - zeroVolume(D_sinoData, sinoPitch, dims.iProjDets, dims.iProjAngles); - printf("pitch: %u\n", sinoPitch); - - unsigned int y, x; - float* sino = loadImage("sino.png", y, x); - - float* img = new float[dims.iVolWidth*dims.iVolHeight]; - - copySinogramToDevice(sino, dims.iProjDets, dims.iProjDets, dims.iProjAngles, D_sinoData, sinoPitch); - - float* angle = new float[dims.iProjAngles]; - - for (unsigned int i = 0; i < dims.iProjAngles; ++i) - angle[i] = i*(M_PI/dims.iProjAngles); - - CGLS cgls; - - cgls.setGeometry(dims, angle); - cgls.init(); - - cgls.setBuffers(D_volumeData, volumePitch, D_sinoData, sinoPitch); - - cgls.iterate(25); - - delete[] angle; - - copyVolumeFromDevice(img, dims.iVolWidth, dims.iVolWidth, dims.iVolHeight, D_volumeData, volumePitch); - - saveImage("vol.png",dims.iVolHeight,dims.iVolWidth,img); - - return 0; -} -#endif |