tomosipo.Data module

class tomosipo.Data.Data(geometry, initial_value=None)[source]

Bases: object

Data: a data manager for Astra

clone()[source]

Clone Data object

Creates a new data object with the same (but copied) data and new associated astra geometry.

Returns:

a fresh Data object

Return type:

Data

property data

Returns the underlying data.

Changes to the return value will be reflected in the astra data.

If you want to avoid this, consider copying the data immediately, using np.copy for instance.

NOTE: if this data encapsulates projection data, the order of the axes is (V, num_angles, U).

Returns:

The underlying data object. This can be a numpy array or some other type of data.

Return type:

np.array

is_projection()[source]
is_volume()[source]
property link
to_astra()[source]

Returns astra data id associated with current object

Returns:

Return type:

tomosipo.Data.data(geometry, initial_value=None)[source]

Create a managed Astra Data3d object

Parameters:
  • geometryVolumeGeometry or ProjectionGeometry A geometry associated with this dataset.

  • initial_valuefloat or np.array An initial value for the data. The default is zero. If a numpy array is provided, the array is linked to the astra toolbox, i.e. they share the same underlying memory.

Returns:

An initialized dataset.

Return type:

Data