summaryrefslogtreecommitdiffstats
path: root/python/astra
diff options
context:
space:
mode:
authorNicola VIGANO <N.R.Vigano@cwi.nl>2017-03-08 15:14:53 +0100
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2017-03-29 10:31:46 +0200
commitee0118aceff644f7e5cdb0c7298c41064357d86a (patch)
treea3004fa73fa88dfd195f8c522a4e0bdd8e4398e1 /python/astra
parent94a1230e6e8033b75f91f7cecfb9f16878508da7 (diff)
downloadastra-ee0118aceff644f7e5cdb0c7298c41064357d86a.tar.gz
astra-ee0118aceff644f7e5cdb0c7298c41064357d86a.tar.bz2
astra-ee0118aceff644f7e5cdb0c7298c41064357d86a.tar.xz
astra-ee0118aceff644f7e5cdb0c7298c41064357d86a.zip
Python: added options for projector creation, like for the matlab interface
Signed-off-by: Nicola VIGANO <N.R.Vigano@cwi.nl>
Diffstat (limited to 'python/astra')
-rw-r--r--python/astra/creators.py5
1 files changed, 4 insertions, 1 deletions
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)