From a88e7c621978193191b30aa3c8879b0de3c8333e Mon Sep 17 00:00:00 2001 From: Daniil Kazantsev Date: Mon, 9 Apr 2018 20:22:46 +0100 Subject: [PATCH] mex_compile file updated to fit any OS --- matlab/Model2DGeneratorDemo.m | 2 +- matlab/install/compile_mex.m | 14 ++++++++------ python/Demos/astraOP.py | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/matlab/Model2DGeneratorDemo.m b/matlab/Model2DGeneratorDemo.m index 30a2415..50d0e48 100644 --- a/matlab/Model2DGeneratorDemo.m +++ b/matlab/Model2DGeneratorDemo.m @@ -70,4 +70,4 @@ figure; subplot(1,2,1); imagesc(rec_an, [0 1]); daspect([1 1 1]); colormap hot; title('Analytical Sinogram Reconstruction [ASTRA]'); subplot(1,2,2); imagesc(rec_num, [0 1]); daspect([1 1 1]); colormap hot; title('Numerical Sinogram Reconstruction [ASTRA]'); -%% \ No newline at end of file +%% diff --git a/matlab/install/compile_mex.m b/matlab/install/compile_mex.m index 0757d11..e8bfa06 100755 --- a/matlab/install/compile_mex.m +++ b/matlab/install/compile_mex.m @@ -6,17 +6,19 @@ fprintf('%s \n', 'Building functions...'); mex TomoP2DModel.c TomoP2DModel_core.c utils.c CFLAGS="\$CFLAGS -fopenmp -Wall -std=c99" LDFLAGS="\$LDFLAGS -fopenmp" -movefile TomoP2DModel.mexa64 ../matlab/compiled/ +movefile TomoP2DModel.mex* ../matlab/compiled/ mex TomoP2DObject.c TomoP2DModel_core.c utils.c CFLAGS="\$CFLAGS -fopenmp -Wall -std=c99" LDFLAGS="\$LDFLAGS -fopenmp" -movefile TomoP2DObject.mexa64 ../matlab/compiled/ +movefile TomoP2DObject.mex* ../matlab/compiled/ mex TomoP2DModelSino.c TomoP2DModelSino_core.c utils.c CFLAGS="\$CFLAGS -fopenmp -Wall -std=c99" LDFLAGS="\$LDFLAGS -fopenmp" -movefile TomoP2DModelSino.mexa64 ../matlab/compiled/ +movefile TomoP2DModelSino.mex* ../matlab/compiled/ mex TomoP2DObjectSino.c TomoP2DModelSino_core.c utils.c CFLAGS="\$CFLAGS -fopenmp -Wall -std=c99" LDFLAGS="\$LDFLAGS -fopenmp" -movefile TomoP2DObjectSino.mexa64 ../matlab/compiled/ +movefile TomoP2DObjectSino.mex* ../matlab/compiled/ mex TomoP3DModel.c TomoP3DModel_core.c utils.c CFLAGS="\$CFLAGS -fopenmp -Wall -std=c99" LDFLAGS="\$LDFLAGS -fopenmp" -movefile TomoP3DModel.mexa64 ../matlab/compiled/ +movefile TomoP3DModel.mex* ../matlab/compiled/ mex TomoP3DObject.c TomoP3DModel_core.c utils.c CFLAGS="\$CFLAGS -fopenmp -Wall -std=c99" LDFLAGS="\$LDFLAGS -fopenmp" -movefile TomoP3DObject.mexa64 ../matlab/compiled/ +movefile TomoP3DObject.mex* ../matlab/compiled/ +mex BackProjCPU.c CFLAGS="\$CFLAGS -fopenmp -Wall -std=c99" LDFLAGS="\$LDFLAGS -fopenmp" +movefile BackProjCPU.mex* ../matlab/compiled/ fprintf('%s \n', 'All compiled!'); cd ../ diff --git a/python/Demos/astraOP.py b/python/Demos/astraOP.py index 49c1479..e6b31d3 100644 --- a/python/Demos/astraOP.py +++ b/python/Demos/astraOP.py @@ -34,7 +34,7 @@ def backproj(self, sinogram): """Applying backprojection""" rec_id, image = astra.create_backprojection(sinogram, self.proj_id) astra.data2d.delete(self.proj_id) - astra.data2d.delete(rec_id) + astra.data2d.delete(rec_id) return image def fbp2D(self, sinogram): """perform FBP reconstruction"""