2D data objects: the data2d module
- astra.data2d.change_geometry(i, geom)[source]
Change the geometry of a 2D object.
- Parameters:
i (
int) – ID of object.geom (
dict) – new geometry.
- astra.data2d.create(datatype, geometry, data=None)[source]
Create a 2D 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.data2d.delete(ids)[source]
Delete a 2D object.
- Parameters:
ids (
intorlist) – ID or list of ID’s to delete.
- astra.data2d.get(i)[source]
Get a 2D object.
- Parameters:
i (
int) – ID of object to get.- Returns:
numpy.ndarray– The object data.
- astra.data2d.get_geometry(i)[source]
Get the geometry of a 2D object.
- Parameters:
i (
int) – ID of object.- Returns:
dict– The geometry of object with IDi.
Get a 2D object with memory shared between the ASTRA toolbox and numpy array.
- Parameters:
i (
int) – ID of object to get.- Returns:
numpy.ndarray– The object data.
- astra.data2d.get_single(i)[source]
Get a 2D object in single precision.
- Parameters:
i (
int) – ID of object to get.- Returns:
numpy.ndarray– The object data.
- astra.data2d.link(datatype, geometry, data)[source]
Link a 2D numpy array with the toolbox.
- Parameters:
datatype (
string) – Data object type, ‘-vol’ or ‘-sino’.geometry (
dict) – Volume or projection geometry.data (
numpy.ndarray) – Numpy array to link
- Returns:
int– the ID of the constructed object.
- astra.data2d.shepp_logan(geometry, modified=True, returnData=True)[source]
Create a 2D 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.