From ee0118aceff644f7e5cdb0c7298c41064357d86a Mon Sep 17 00:00:00 2001 From: Nicola VIGANO Date: Wed, 8 Mar 2017 15:14:53 +0100 Subject: Python: added options for projector creation, like for the matlab interface Signed-off-by: Nicola VIGANO --- python/astra/creators.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'python/astra') diff --git a/python/astra/creators.py b/python/astra/creators.py index aa16221..a0d347b 100644 --- a/python/astra/creators.py +++ b/python/astra/creators.py @@ -533,7 +533,7 @@ def create_reconstruction(rec_type, proj_id, sinogram, iterations=1, use_mask='n return recon_id -def create_projector(proj_type, proj_geom, vol_geom): +def create_projector(proj_type, proj_geom, vol_geom, options=None): """Create a 2D or 3D projector. :param proj_type: Projector type, such as ``'line'``, ``'linear'``, ... @@ -542,6 +542,7 @@ def create_projector(proj_type, proj_geom, vol_geom): :type proj_geom: :class:`dict` :param vol_geom: Volume geometry. :type vol_geom: :class:`dict` +:param options: Projector options structure defining ``'VoxelSuperSampling'``, ``'DetectorSuperSampling'``, and ``'GPUindex'``. :returns: :class:`int` -- The ID of the projector. """ @@ -550,6 +551,8 @@ def create_projector(proj_type, proj_geom, vol_geom): cfg = astra_dict(proj_type) cfg['ProjectionGeometry'] = proj_geom cfg['VolumeGeometry'] = vol_geom + if options is not None: + cfg['options'] = options types3d = ['linear3d', 'linearcone', 'cuda3d'] if proj_type in types3d: return projector3d.create(cfg) -- cgit v1.2.3