3D data objects: the data3d module
- astra.data3d.change_geometry(i, geometry)[source]
 Change the geometry of a 3D object.
- Parameters:
 i (
int) – ID of object.geometry (
dict) – Volume or projection geometry.
- astra.data3d.create(datatype, geometry, data=None)[source]
 Create a 3D object.
- Parameters:
 datatype (
string) – Data object type, ‘-vol’ or ‘-sino’.geometry (
dict) – Volume or projection geometry.data (
floatornumpy.ndarray) – Data to fill the constructed object with, either a scalar or array.
- Returns:
 int– the ID of the constructed object.
- astra.data3d.delete(ids)[source]
 Delete a 3D object.
- Parameters:
 ids (
intorlist) – ID or list of ID’s to delete.
- astra.data3d.dimensions(i)[source]
 Get dimensions of a 3D object.
- Parameters:
 i (
int) – ID of object.- Returns:
 tuple– dimensions of object with IDi.
- astra.data3d.get(i)[source]
 Get a 3D object.
- Parameters:
 i (
int) – ID of object to get. Linked GPU arrays are not supported.- Returns:
 numpy.ndarray– The object data.
- astra.data3d.get_geometry(i)[source]
 Get the geometry of a 3D object.
- Parameters:
 i (
int) – ID of object.- Returns:
 dict– The geometry of object with IDi.
Get a 3D object with memory shared between the ASTRA toolbox and numpy array.
- Parameters:
 i (
int) – ID of object to get. Linked GPU arrays are not supported.- Returns:
 numpy.ndarray– The object data.
- astra.data3d.get_single(i)[source]
 Get a 3D object in single precision.
- Parameters:
 i (
int) – ID of object to get. Linked GPU arrays are not supported.- Returns:
 numpy.ndarray– The object data.
- astra.data3d.link(datatype, geometry, data)[source]
 Link a 3D array with ASTRA from another library supporting dlpack, such as numpy or pytorch.
- Parameters:
 datatype (
string) – Data object type, ‘-vol’ or ‘-sino’.geometry (
dict) – Volume or projection geometry.data (
object) – Array to link. Needs to implement the dlpack protocol.
- Returns:
 int– the ID assigned to the linked object.
Added in version 2.2: Accept any 3D array supporting DLPack protocol. Before, only NumPy arrays were supported.
- astra.data3d.shepp_logan(geometry, modified=True, returnData=True)[source]
 Create a 3D data object with a Shepp-Logan phantom.
- Parameters:
 geometry – Volume geometry
modified – If False, generate the original Shepp-Logan phantom
returnData – If False, only return the ID of the new data object
- Returns:
 intor (int, :class`numpy.ndarray`)
Added in version 2.2.