summaryrefslogtreecommitdiffstats
path: root/python/astra/data3d.py
diff options
context:
space:
mode:
authorDaniel M. Pelt <D.M.Pelt@cwi.nl>2015-03-02 17:22:42 +0100
committerDaniel M. Pelt <D.M.Pelt@cwi.nl>2015-03-03 12:11:51 +0100
commit46eb9cce2bc172514096c761cd50b0fc74e6c8e6 (patch)
treeea54ff6dc4b1c8bb759fee58181904b81c1054e2 /python/astra/data3d.py
parente468c6c546dbb4d9665ccb95b1571a160753d50e (diff)
downloadastra-46eb9cce2bc172514096c761cd50b0fc74e6c8e6.tar.gz
astra-46eb9cce2bc172514096c761cd50b0fc74e6c8e6.tar.bz2
astra-46eb9cce2bc172514096c761cd50b0fc74e6c8e6.tar.xz
astra-46eb9cce2bc172514096c761cd50b0fc74e6c8e6.zip
Make Python get_geometry code match Matlab (after 03a9dd972ada50eedb83386910cecf02fe8d0e35)
Diffstat (limited to 'python/astra/data3d.py')
-rw-r--r--python/astra/data3d.py38
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)