Metadata-Version: 2.5
Name: he-dapi
Version: 0.1.0
Summary: H&E <-> DAPI virtual staining: inference library + CLI
Project-URL: Homepage, https://github.com/urbiologicalpa/he-dapi-translator
Project-URL: Repository, https://github.com/urbiologicalpa/he-dapi-translator
Project-URL: Bug Tracker, https://github.com/urbiologicalpa/he-dapi-translator/issues
Project-URL: HuggingFace, https://huggingface.co/urbiologicalpa/he-dapi-translator
Author: urbiologicalpa
License: MIT
Keywords: computational-pathology,dapi,he,histopathology,pix2pix,virtual-staining,wsi
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Image Processing
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
Requires-Python: >=3.10
Requires-Dist: huggingface-hub>=0.20
Requires-Dist: numpy>=1.24
Requires-Dist: pillow>=10.0
Requires-Dist: torch>=2.0
Provides-Extra: dev
Requires-Dist: build; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Provides-Extra: onnx
Requires-Dist: onnxruntime>=1.16; extra == 'onnx'
Provides-Extra: wsi
Requires-Dist: openslide-python; extra == 'wsi'
Requires-Dist: tifffile; extra == 'wsi'
Description-Content-Type: text/markdown

# he-dapi

**H&E ↔ DAPI virtual staining — inference library + CLI.**

Predicts a virtual **DAPI** fluorescence image from a brightfield **H&E** patch
(paired Pix2Pix). Weights are downloaded automatically from the
[Hugging Face model repo](https://huggingface.co/urbiologicalpa/he-dapi-translator).

## Install
```bash
pip install he-dapi
# optional extras
pip install "he-dapi[wsi]"     # .svs/.tiff support
pip install "he-dapi[onnx]"    # ONNX Runtime
```

## CLI
```bash
he-dapi info
he-dapi translate -i he.png -o dapi.png -d he2dapi
```

## Python
```python
from he_dapi import translate, load_generator

pred = translate("he.png", direction="he2dapi")   # -> uint8 HxW numpy array
# or reuse a loaded model across calls:
model = load_generator("he2dapi")
pred  = translate("he.png", model=model)
```

Large images are processed in 512px tiles (stride 256) with overlap averaging.
Input is normalized to `[-1, 1]` (`uint8 / 127.5 - 1`); output is `[0, 1]`.

## Status
- `he2dapi` (paired Pix2Pix): **available**.
- `dapi2he` (unpaired CycleGAN): added when unpaired training completes.

## License
MIT. Research demonstration only — not validated for clinical use.
