photon_mosaic.extractors.suite2prois#
Suite2p ROI extractor.
Suite2pRois exposes suite2p detection output as a
BaseRois. It can be constructed two ways:
Suite2pRois(folder_path)— loadstat.npy(andiscell.npyif present) from a saved suite2p output folder.Suite2pRois.from_stat()— wrap the in-memorystatlist returned by suite2p detection, without touching disk.
To reload the registered movie from the same folder, pair with
Suite2pImaging.
Classes
|
Suite2p ROIs loaded from a folder or wrapped from in-memory stats. |
- class photon_mosaic.extractors.suite2prois.Suite2pRois(folder_path, sparse=True)[source]#
Suite2p ROIs loaded from a folder or wrapped from in-memory stats.
Methods
from_stat(stats, shape, sampling_frequency)Build ROIs directly from an in-memory suite2p
statlist.get_roi_image_masks([roi_ids])Return binary image masks shaped
(n_rois, H, W)or(n_rois, H, W, n_planes).- classmethod from_stat(stats, shape, sampling_frequency, plane_assignments=None, sparse=True)[source]#
Build ROIs directly from an in-memory suite2p
statlist.- Parameters:
stats (
Sequence[dict[str,Any]]) – Per-ROI stat dicts from suite2p detection. Each must containypix,xpix, andlam.shape (
tuple[int,int,int]) – Spatial shape(height, width, n_planes).sampling_frequency (
float) – Imaging sampling rate in Hz.plane_assignments (
NDArray[int64] |None) – Integer plane index for each ROI. Required whenn_planes > 1.sparse (
bool) – Return image masks as a sparsesparse.GCXSarray instead of a densenp.ndarray. See__init__().
- Return type:
- get_roi_image_masks(roi_ids=None)[source]#
Return binary image masks shaped
(n_rois, H, W)or(n_rois, H, W, n_planes).Returned as a sparse
sparse.GCXSarray by default, built directly from each ROI’sypix/xpixpixel coordinates – suite2p detections can number in the tens of thousands over large (e.g. volumetric) fields of view, where a dense array would be far larger than the raw movie itself (see photon-mosaic#103). Passsparse=Falseto the constructor for a plainnp.ndarrayinstead.- Return type:
GCXS|NDArray
- photon_mosaic.extractors.suite2prois.read_suite2p_rois#
alias of
Suite2pRois