From 40979a6f4ab678a2f57ccaf8aede1156713e3bf8 Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 16 Nov 2018 10:14:17 +0100 Subject: add astra_plot_geom command and sample s024 Signed-off-by: Tim --- samples/matlab/bunny.stl | Bin 0 -> 47484 bytes samples/matlab/s024_plot_geometry.m | 42 ++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 samples/matlab/bunny.stl create mode 100644 samples/matlab/s024_plot_geometry.m (limited to 'samples') diff --git a/samples/matlab/bunny.stl b/samples/matlab/bunny.stl new file mode 100644 index 0000000..0b7fcaa Binary files /dev/null and b/samples/matlab/bunny.stl differ diff --git a/samples/matlab/s024_plot_geometry.m b/samples/matlab/s024_plot_geometry.m new file mode 100644 index 0000000..dd57997 --- /dev/null +++ b/samples/matlab/s024_plot_geometry.m @@ -0,0 +1,42 @@ +%% s024_plot_geometry.m +% brief example of usage for astra_plot_geom command +% - last update 16.11.2018 +% ----------------------------------------------------------------------- +% This file is part of the ASTRA Toolbox +% +% Copyright: 2010-2018, imec Vision Lab, University of Antwerp +% 2014-2018, CWI, Amsterdam +% License: Open Source under GPLv3 +% Contact: astra@astra-toolbox.com +% Website: http://www.astra-toolbox.com/ +% ----------------------------------------------------------------------- +%% +close all; + +% proj_geom = astra_create_example_cone('vec'); +% proj_geom = astra_create_example_cone('normal'); +proj_geom = astra_create_example_cone('helix'); +% proj_geom = astra_create_example_parallel3d('vec'); +% proj_geom = astra_create_example_fanflat('vec'); +% proj_geom = astra_create_example_fanflat(); +% proj_geom = astra_create_example_parallel3d(); +% proj_geom = create_example_cone('deform_vec'); + +astra_plot_geom(proj_geom); +hold on; + +vol_magn = 20; +phantom_size = 5; +phantom_px = 1500; +vx_size = phantom_size / phantom_px; % voxel size +vol_geom = astra_create_vol_geom(phantom_px, phantom_px, phantom_px); +line_width = 1; % line width for phantom +astra_plot_geom(vol_geom, vx_size, 'Magnification', vol_magn,... + 'LineWidth', line_width, 'Color', 'r'); + +% this magnification is empirically chosen to fit the stl file +cad_magn = 900; +astra_plot_geom('bunny.stl', cad_magn); + +hold off; +axis equal; -- cgit v1.2.3 From 3276485c96636cd38248908ff3575282654ff335 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 12 Dec 2018 14:45:38 +0100 Subject: Reorganize functions into packages/private functions This also replaces modifying the path with a request to the user to modify the path. --- samples/matlab/s024_plot_geometry.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'samples') diff --git a/samples/matlab/s024_plot_geometry.m b/samples/matlab/s024_plot_geometry.m index dd57997..6c4c3f0 100644 --- a/samples/matlab/s024_plot_geometry.m +++ b/samples/matlab/s024_plot_geometry.m @@ -13,6 +13,11 @@ %% close all; +if exist('astra_create_example_cone') ~= 2 + error('Please add astra/algorithms/plot_geom to your path to use this function') +end + + % proj_geom = astra_create_example_cone('vec'); % proj_geom = astra_create_example_cone('normal'); proj_geom = astra_create_example_cone('helix'); @@ -20,7 +25,7 @@ proj_geom = astra_create_example_cone('helix'); % proj_geom = astra_create_example_fanflat('vec'); % proj_geom = astra_create_example_fanflat(); % proj_geom = astra_create_example_parallel3d(); -% proj_geom = create_example_cone('deform_vec'); +% proj_geom = astra_create_example_cone('deform_vec'); astra_plot_geom(proj_geom); hold on; -- cgit v1.2.3