acia.segm.tiff_export#
Optional lazy TIFF export of a (cropped) image sequence.
save_tiff_stack() streams any ImageSequenceSource
(e.g. a crop returned by acia.selection.load_selection()) to a TIFF stack
one frame at a time, so peak memory stays at a single frame regardless of
sequence length. Physical calibration (pixel size, frame interval) is written into
the TIFF resolution + ImageJ metadata so downstream tools keep µm/px and timing.
This is the optional export leg of the curation workflow — the manifest is the primary output, not a materialized TIFF.
- acia.segm.tiff_export.save_tiff_stack(source, path, *, imagej=True, ome=False, dtype=None, compression=None, channel_names=None)[source]#
Write
sourceto a TIFF stack lazily (one frame at a time).- Parameters:
source – A lazy
ImageSequenceSource; iterated frame-by-frame.path (str | PathLike) – Output
.tifpath (parent dirs are created).imagej (bool) – Write an ImageJ hyperstack (default) — matches how
acia-workflowsconsumes TIFFs. Calibration goes into ImageJ metadata + TIFF resolution tags. Ignored whenome=True.ome (bool) – Write an OME-TIFF instead of an ImageJ hyperstack — carries richer, standard-schema metadata (
PhysicalSizeX/Y,TimeIncrement, channel names) that a cropped/registered export would otherwise lose. Takes precedence overimagejwhen both are set. As with the ImageJ path, missing calibration is simply omitted, never fabricated.dtype – Optional numpy dtype to cast each frame to (default: keep source dtype).
compression (str | int | None) – Optional codec name/level forwarded to
tifffile(e.g."zlib","lzw");None(default) writes uncompressed, matching prior behavior.channel_names (list[str] | None) – Optional per-channel names to embed (OME
Channel/Name); ignored whenome=False. Crops don’t carry channel metadata themselves, so callers pass this through explicitly (e.g. from a selection manifest’s baked-insource["channels"]).
- Returns:
The written path.
- Return type: