diff options
author | Wim van Aarle <wimvanaarle@gmail.com> | 2015-03-18 11:08:20 +0100 |
---|---|---|
committer | Wim van Aarle <wimvanaarle@gmail.com> | 2015-03-18 11:08:20 +0100 |
commit | fb01aaf4cd4e7f22308e07bd94dcfc97083e8ec8 (patch) | |
tree | f61cc9842bfc1875d9fc4fa37a697efb3bba8895 /python/astra/data3d.py | |
parent | c9730a84bd2be4fa2df2fd2ef947a624e9a09f02 (diff) | |
download | astra-fb01aaf4cd4e7f22308e07bd94dcfc97083e8ec8.tar.gz astra-fb01aaf4cd4e7f22308e07bd94dcfc97083e8ec8.tar.bz2 astra-fb01aaf4cd4e7f22308e07bd94dcfc97083e8ec8.tar.xz astra-fb01aaf4cd4e7f22308e07bd94dcfc97083e8ec8.zip |
updated python bindings
Diffstat (limited to 'python/astra/data3d.py')
-rw-r--r-- | python/astra/data3d.py | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/python/astra/data3d.py b/python/astra/data3d.py index 33bde51..a2e9201 100644 --- a/python/astra/data3d.py +++ b/python/astra/data3d.py @@ -27,7 +27,7 @@ from . import data3d_c as d def create(datatype,geometry,data=None): """Create a 3D object. - + :param datatype: Data object type, '-vol' or '-sino'. :type datatype: :class:`string` :param geometry: Volume or projection geometry. @@ -35,67 +35,77 @@ def create(datatype,geometry,data=None): :param data: Data to fill the constructed object with, either a scalar or array. :type data: :class:`float` or :class:`numpy.ndarray` :returns: :class:`int` -- the ID of the constructed object. - + """ return d.create(datatype,geometry,data) def get(i): """Get a 3D object. - + :param i: ID of object to get. :type i: :class:`int` :returns: :class:`numpy.ndarray` -- The object data. - + """ return d.get(i) def get_shared(i): """Get a 3D object with memory shared between the ASTRA toolbox and numpy array. - + :param i: ID of object to get. :type i: :class:`int` :returns: :class:`numpy.ndarray` -- The object data. - + """ return d.get_shared(i) def get_single(i): """Get a 3D object in single precision. - + :param i: ID of object to get. :type i: :class:`int` :returns: :class:`numpy.ndarray` -- The object data. - + """ return g.get_single(i) def store(i,data): """Fill existing 3D object with data. - + :param i: ID of object to fill. :type i: :class:`int` :param data: Data to fill the object with, either a scalar or array. :type data: :class:`float` or :class:`numpy.ndarray` - + """ return d.store(i,data) +def get_geometry(i): + """Get the geometry of a 3D object. + + :param i: ID of object. + :type i: :class:`int` + :returns: :class:`dict` -- The geometry of object with ID ``i``. + + """ + return d.get_geometry(i) + def dimensions(i): """Get dimensions of a 3D object. - + :param i: ID of object. :type i: :class:`int` :returns: :class:`tuple` -- dimensions of object with ID ``i``. - + """ return d.dimensions(i) def delete(ids): """Delete a 2D object. - + :param ids: ID or list of ID's to delete. :type ids: :class:`int` or :class:`list` - + """ return d.delete(ids) |