Metadata-Version: 2.4
Name: stitchmeta
Version: 0.1.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
Requires-Python: >=3.10
Requires-Dist: click
Requires-Dist: tifffile
Provides-Extra: docs
Requires-Dist: sphinx; extra == 'docs'
Requires-Dist: sphinx-mdinclude; 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: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Build](https://github.com/thomasisensee/stitchmeta/actions/workflows/ci.yml/badge.svg)](https://github.com/thomasisensee/stitchmeta/actions)
[![Documentation Status](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)
[![PyPI](https://img.shields.io/pypi/v/stitchmeta)](https://pypi.org/project/stitchmeta)
![Python](https://img.shields.io/badge/python-3.10%20|%203.11%20|%203.12%20|%203.13%20|%203.14-blue)

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).
