acia.segm.tiff_metadata#

Best-effort calibration reader for OME-TIFF / ImageJ-hyperstack metadata.

This is the inverse of acia.segm.tiff_export’s calibration tags: it reads back the PhysicalSizeX/TimeIncrement (OME) or unit/finterval (ImageJ) tags that module writes, so acia’s own OME/ImageJ TIFF exports round -trip through it, and any scope-native OME-TIFF or ImageJ hyperstack benefits too. Reads headers only – never the pixel array. Missing calibration is simply omitted, never fabricated (same discipline as the writer side).

class acia.segm.tiff_metadata.TiffCalibration[source]#

Bases: object

Best-effort physical calibration read from a TIFF’s own metadata.

pixel_size: object | None#
frame_interval: object | None#
timepoints: object | None#
source: str | None#
__init__(pixel_size, frame_interval, timepoints, source)#
Parameters:
  • pixel_size (object | None)

  • frame_interval (object | None)

  • timepoints (object | None)

  • source (str | None)

Return type:

None

acia.segm.tiff_metadata.read_tiff_calibration(path, storage_options=None)[source]#

Read pixel size / frame timing from a TIFF’s OME-XML or ImageJ metadata.

Reads only the file’s headers/metadata (no pixel array). OME-XML is tried first; if the file is not an OME-TIFF (or nothing usable is found there), ImageJ hyperstack tags are tried next. If neither is present, every field is None.

Parameters:
  • path (str | PathLike) – Path to the .tif/.tiff file. May be a plain local path or any fsspec-supported URL (e.g. smb://).

  • storage_options (dict | None) – extra fsspec storage options (e.g. credentials), resolved the same way as LocalSequenceSource.

Returns:

TiffCalibration – best-effort calibration; missing values are None.

Return type:

TiffCalibration