Metadata-Version: 2.5
Name: stitchmeta
Version: 0.2.0
Summary: Extract metadata from microscopy images and provide mosaic information in feabas-ready format.
Project-URL: repository, https://github.com/thomasisensee/stitchmeta
Project-URL: documentation, https://stitchmeta.readthedocs.io
Maintainer-email: Thomas Isensee <thomas.isensee@iwr.uni-heidelberg.de>
License-Expression: MIT
License-File: LICENSE.md
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Requires-Python: >=3.10
Requires-Dist: click
Requires-Dist: tifffile
Provides-Extra: docs
Requires-Dist: myst-parser; extra == 'docs'
Requires-Dist: sphinx; extra == 'docs'
Requires-Dist: sphinx-rtd-theme; extra == 'docs'
Provides-Extra: tests
Requires-Dist: pytest; extra == 'tests'
Requires-Dist: pytest-cov; extra == 'tests'
Description-Content-Type: text/markdown

# stitchmeta

[![License](https://img.shields.io/pypi/l/stitchmeta?label=License)](https://opensource.org/licenses/MIT)
[![Build](https://github.com/thomasisensee/stitchmeta/actions/workflows/ci.yml/badge.svg)](https://github.com/thomasisensee/stitchmeta/actions)
[![Documentation](https://readthedocs.org/projects/stitchmeta/badge/)](https://stitchmeta.readthedocs.io/)
[![codecov](https://codecov.io/gh/thomasisensee/stitchmeta/graph/badge.svg?token=GPDL61KZDU)](https://codecov.io/gh/thomasisensee/stitchmeta)
[![pre-commit.ci](https://results.pre-commit.ci/badge/github/thomasisensee/stitchmeta/main.svg)](https://results.pre-commit.ci/latest/github/thomasisensee/stitchmeta/main)
[![PyPI](https://img.shields.io/pypi/v/stitchmeta?logo=pypi&logoColor=gold&label=PyPI)](https://pypi.org/project/stitchmeta)
[![Python](https://img.shields.io/pypi/pyversions/stitchmeta?logo=python&logoColor=gold&label=Python)](https://pypi.org/project/stitchmeta)

Extract metadata from microscopy image tiles and write FEABAS-compatible
coordinate files for stitching pipelines.

## Installing stitchmeta

The preferred way of installing `stitchmeta` is using `pip`.

### Installing the release version using pip

`stitchmeta` can be installed using `pip` to obtain the [current release](https://pypi.org/project/stitchmeta/):

```
python -m pip install stitchmeta
```

### Installation from source

Clone this repository and install from the local source tree:

```bash
git clone https://github.com/thomasisensee/stitchmeta.git
cd stitchmeta
python -m pip install .
```

### Development installation

For development, it is recommended to use an editable install:

```bash
python -m pip install --editable .[tests]
```

Having done so, the test suite can be run using `pytest`:

```
python -m pytest
```

## Quick start

Expected input layout:

```text
dataset_root/
  001/
    tile_a.tif
    tile_b.tif
  002/
    ...
```

Run extraction:

```bash
stitchmeta extract \
  -i dataset_root \
  -o feabas_coords
```

The command writes one [FEABAS](https://github.com/YuelongWu/feabas) text file per section (`001.txt`, `002.txt`, ...).

## Python API

```python
from stitchmeta import extract

summary = extract(
    input_root="dataset_root",
    output_dir="feabas_coords",
    reader_name="fibics_tiff",
    invert_y=True,
    error_policy="partial",
)
```

## Extending to other datasets

Register a new reader class implementing the `TileReader` interface and use it
through `reader_name` in the API or CLI.

## Acknowledgments

This repository was set up using the [SSC Cookiecutter for Python Packages](https://github.com/ssciwr/cookiecutter-python-package).
