PYME.IO.DataSources.MultiviewDataSource module¶
A DataSource which crops multiple separated (but equal sized) ROIs out of a larger frame and then recombines them.
Useful for situations such as multi-view imaging where there is blank space between the views - e.g. the Bewersdorf lab biplane setup.
Views are concatenated along the x-axis
- class PYME.IO.DataSources.MultiviewDataSource.DataSource(dataSource, croppingInfo)¶
Bases:
XYTCDataSource
Create a new Multiview data source in which multiple ROIs are cropped from an original image and concatenated. Used principally for cutting horizontally spaced ROIs out of a vertical band of the sCMOS chip, where there is dark space between the images and we want to avoid saving and transmitting this dark data.
- Parameters
- dataSourcePYME.IO.DataSources.X data source object
The DataSource to crop from
- croppingInfo“dictionary like” object
Information about how to crop the image. Can either be a dictionary, or something which behaves like a dictionary (e.g. a MetaDataHandler). The cropping info should define the keys defined in CROP_INFO_YU above.
- 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
- moduleName = 'MultiviewDataSource'¶
- release()¶
- reloadData()¶