User API

This is an example function:

Public package interface for stitchmeta.

class stitchmeta.ErrorPolicy(*values)

Tile-parse error handling mode.

partial: skip invalid tiles and keep writing valid ones. section: skip the entire section if any tile fails. abort: stop extraction immediately on the first tile failure.

classmethod from_value(value: ErrorPolicy | str) ErrorPolicy

Normalize user input into a supported error policy enum.

class stitchmeta.RunSummary(section_results: list[SectionResult] = <factory>, aborted: bool = False, abort_reason: str | None = None)

Aggregate extraction result over all discovered sections.

property errors: list[str]

Flattened list of section-scoped error messages.

property sections_seen: int

Number of sections that contained candidate tile files.

property sections_written: int

Number of sections for which FEABAS files were written.

property tiles_skipped: int

Total number of skipped tiles across sections.

property tiles_written: int

Total number of written tile rows across sections.

class stitchmeta.SectionResult(section_name: str, section_dir: Path, output_path: Path | None, files_seen: int, tiles_written: int, tiles_skipped: int, errors: list[str] = <factory>)

Per-section extraction result.

property wrote_output: bool

Whether a FEABAS file was written for this section.

class stitchmeta.TileMetadata(name: str, width_px: int, height_px: int, fov_x_um: float, fov_y_um: float, x_um: float, y_um: float)

Metadata extracted from one source tile image.

stitchmeta.extract(input_root: Path | str, output_dir: Path | str, *, reader_name: str = 'fibics_tiff', invert_y: bool = True, error_policy: ErrorPolicy | str = ErrorPolicy.PARTIAL) RunSummary

Extract section tile layout and write FEABAS files.

Parameters

input_root:

Directory containing section subdirectories (001, 002, …).

output_dir:

Directory where one output file per section will be written.

reader_name:

Registered reader used to parse source images.

invert_y:

Whether to invert Y coordinates before normalization.

error_policy:

partial: skip invalid tiles and write remaining valid ones. section: skip entire section if any tile fails. abort: stop extraction on first tile failure.

stitchmeta.get_reader(name: str) type[TileReader]

Return a registered reader class by name.

stitchmeta.list_readers() tuple[str, ...]

Return available reader names in sorted order.

stitchmeta.register_reader(name: str, reader_class: type[TileReader], *, overwrite: bool = False) None

Register a reader class under a stable lookup name.