Metadata-Version: 2.5
Name: bioio-emd
Version: 0.1.0.dev1
Summary: A BioIO plugin for reading and writing EMD images.
Project-URL: Homepage, https://github.com/ksiller/bioio-emd
Project-URL: Bug Tracker, https://github.com/ksiller/bioio-emd/issues
Author-email: ksiller <khsiller@gmail.com>
License-Expression: GPL-3.0-or-later
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Requires-Dist: bioio-base>=3.5.0
Requires-Dist: rosettasciio[hdf5]
Description-Content-Type: text/markdown

# bioio-emd

A BioIO plugin for reading and writing `.emd` images. It follows the [BioIO](https://github.com/bioio-devs/bioio) reader and writer plugin APIs so files can be opened through `bioio.BioImage` alongside other format plugins.

## Reading .emd files

```python
from bioio import BioImage
import bioio_emd

img = BioImage("file.emd", reader=bioio_emd.Reader)
img.data
```

## Accessing metadata

Source axes are mapped onto `TCZYX`. Known names such as `x`, `y`, `z`, and `thickness` keep their spatial axes. A non-navigation axis, such as `complex`, becomes the channel axis. Remaining axes fill unused slots in the order `T`, `C`, `Z`, `Y`, `X`.

```python
img.dims.order  # "TCZYX"
img.dims.T, img.dims.C, img.dims.Z, img.dims.Y, img.dims.X
img.channel_names
img.physical_pixel_sizes  # Z, Y, X in micrometers
```

`img.metadata` is the file metadata dictionary. Classic Berkeley EMD files include the root version and the `microscope`, `sample`, and `user` groups:

```python
img.metadata["sample"]["material"]
img.metadata["microscope"]["voltage"]
```

# Writing .emd files

```python
from bioio.writers import EmdWriter

EmdWriter.save(image, "file.emd", dim_order="ZYX")
```
