acia.segm.open#
Format-agnostic lazy opener for multi-position acquisitions.
open_sequence() dispatches by filename suffix to a per-format backend and
returns a SequenceFile — a lazy handle that exposes unified metadata and
a per-position time series without loading pixels. A “position” is the ND2 P
axis and the CZI S (scene) axis, unified here so the notebook and dashboard
never branch on format.
A path that is a directory is opened as a folder of per-timepoint TIFFs (one
file per frame); a folder whose immediate subfolders hold the TIFFs exposes one
position per subfolder, so folder trees, ND2 and CZI all reach the notebook
through the same SequenceFile.position() surface.
Reading SequenceFile.metadata / SequenceFile.positions performs
no pixel reads for ND2/CZI; SequenceFile.thumbnail() reads exactly one
(downscaled) frame. (The TIFF backends read frame 0 to determine its shape — a
TIFF stack or a single per-timepoint file is small, unlike the hundred-gigabyte
ND2/CZI files this module is built for.)
- class acia.segm.open.SequenceMetadata[source]#
Bases:
objectFile-level metadata, unified across formats. JSON-safe via
to_dict().
- class acia.segm.open.PositionInfo[source]#
Bases:
objectLightweight per-position descriptor for the gallery (no pixel reads).
- class acia.segm.open.SequenceFile[source]#
Bases:
objectLazy handle over a multi-position acquisition (format-agnostic).
Construct via
open_sequence(). Reading metadata/positions performs no pixel reads for ND2/CZI. Per-position sources are created on demand and cached (one source per position).- position(index)[source]#
Return the per-position lazy
ImageSequenceSourceforindex.- Parameters:
index (int)
- property metadata: SequenceMetadata#
Unified file-level metadata (no pixel reads for ND2/CZI).
- property positions: list[PositionInfo]#
Per-position descriptors, lazily built (no pixel reads).
- thumbnail(index, *, downscale=8, frame=0)[source]#
A downscaled
(h, w, 3)uint8 preview of one frame (lazy).Reads exactly one frame of
index, takes the display channel (0), min-max normalizes, strides bydownscale, and returns an RGB preview.
- thumbnail_png(index, *, downscale=8, frame=0)[source]#
PNG-encoded bytes of
thumbnail()(for the widget’s byte channel).
- acia.segm.open.open_sequence(path, *, pixel_size=None, frame_interval=None, pattern=None)[source]#
Open an acquisition by filename suffix (ND2/CZI/TIFF) or as a folder.
A path that is a directory is opened as a folder of per-timepoint TIFFs – one file per frame, or one subfolder per position (see
acia.segm.folder_source.resolve_layout()). ND2/CZI dispatch purely on suffix and stay strictly IO-free, so opening a hundred-gigabyte acquisition costs nothing until metadata or a position is touched; only an unknown or TIFF-like name is probed with a stat.Returns a lazy
SequenceFile. Userpixel_size/frame_intervaloverride any file metadata and propagate to every per-position source.- Parameters:
path – file to open, or a directory of per-timepoint TIFFs.
pixel_size – physical pixel size overriding the file’s own metadata.
frame_interval – scalar time between frames, likewise overriding.
pattern – frame-filename glob, folders only (
None->.tif/.tiff).
- Raises:
ValueError – If the suffix maps to no supported reader and the path is not a directory, or if
patternis given for a non-folder path.- Return type: