PYME.IO.DataSources.BaseDataSource module

class PYME.IO.DataSources.BaseDataSource.BaseDataSource

Bases: object

property dtype
getEvents()

Return any events which are ascociated with this DataSource

getNumSlices()

Return the number of 2D slices. This is the product of the dimensions > 2

getSlice(ind)

Return the nth 2D slice of the DataSource where the higher dimensions have been flattened.

equivalent to indexing contiguous 4D data with data[:,:,ind%data.shape[2], ind/data.shape[3]]

e.g. for a 100x100x50x2 DataSource, getSlice(20) would return data[:,:,20,0].squeeze() whereas getSlice(75) would return data[:,:,25, 1].squeeze()

getSliceShape()

Return the 2D shape of a slice

property is_complete

For datasources which may be opened before spooling is finished.

Over-ridden in derived classes (currently only ClusterPZFDataSource)

Returns
is_completebool

has spooling of this series finished

property nbytes
property ndim
property shape

The 4D shape of the datasource

class PYME.IO.DataSources.BaseDataSource.DefaultList(*args)

Bases: list

List which returns a default value for items not in the list

class PYME.IO.DataSources.BaseDataSource.XYTCDataSource

Bases: BaseDataSource

Old style data source base

additionalDims = 'T'
property nTrueDims

The number of dimensions which are truely present within the data, rather than just faked

property ndim
oldData = None
oldSlice = None
property shape

The 4D shape of the datasource

sizeC = 1
class PYME.IO.DataSources.BaseDataSource.XYTCWrapper(datasource)

Bases: XYTCDataSource

Wrapper to turn an XYZTC Datasource into an XYTC DataSource by remapping the slicing.

Flattens Z & T dimensions into one Z/T dimension. Generally only interesting for backwards compatibility

getEvents()

Return any events which are ascociated with this DataSource

getNumSlices()

Return the number of 2D slices. This is the product of the dimensions > 2

getSlice(ind)

Return the nth 2D slice of the DataSource where the higher dimensions have been flattened.

equivalent to indexing contiguous 4D data with data[:,:,ind%data.shape[2], ind/data.shape[3]]

e.g. for a 100x100x50x2 DataSource, getSlice(20) would return data[:,:,20,0].squeeze() whereas getSlice(75) would return data[:,:,25, 1].squeeze()

getSliceShape()

Return the 2D shape of a slice

property is_complete

For datasources which may be opened before spooling is finished.

Over-ridden in derived classes (currently only ClusterPZFDataSource)

Returns
is_completebool

has spooling of this series finished

class PYME.IO.DataSources.BaseDataSource.XYZSubvolume(datasource, t=0, c=0)

Bases: object

property shape
class PYME.IO.DataSources.BaseDataSource.XYZTCDataSource(input_order='XYZTC', size_z=1, size_t=1, size_c=1)

Bases: BaseDataSource

Datasource to use as a base class for datasources which are natively 5D (and can be used in isinstance checks to Test the above.

property ndim
set_dim_order_and_size(input_order=None, size_z=None, size_t=None, size_c=None)
property shape

The 4D shape of the datasource

class PYME.IO.DataSources.BaseDataSource.XYZTCWrapper(datasource, input_order='XYZTC', size_z=1, size_t=1, size_c=1)

Bases: XYZTCDataSource

Wrapper to turn an XYTC Datasource into an XYZTC DataSource by remapping the slicing.

classmethod auto_promote(data)

Try to automatically promote a datasource, guessing what dimensionality it should have

currently assume series with > 100 frames along z/t dimension are time series, series with <= 100 frames are s-stacks

getEvents()

Return any events which are ascociated with this DataSource

getNumSlices()

Return the number of 2D slices. This is the product of the dimensions > 2

getSlice(ind)

Return the nth 2D slice of the DataSource where the higher dimensions have been flattened.

equivalent to indexing contiguous 4D data with data[:,:,ind%data.shape[2], ind/data.shape[3]]

e.g. for a 100x100x50x2 DataSource, getSlice(20) would return data[:,:,20,0].squeeze() whereas getSlice(75) would return data[:,:,25, 1].squeeze()

getSliceShape()

Return the 2D shape of a slice

property is_complete

For datasources which may be opened before spooling is finished.

Over-ridden in derived classes (currently only ClusterPZFDataSource)

Returns
is_completebool

has spooling of this series finished