Metadata-Version: 2.4
Name: pyezzi
Version: 1.0.0
Author-email: Nicolas Cedilnik <nicoco@nicoco.fr>
License-Expression: CECILL-C
Project-URL: Homepage, https://gitlab.inria.fr/ncedilni/pyezzi
Project-URL: Issues, https://gitlab.inria.fr/ncedilni/pyezzi/-/issues
Project-URL: Repository, https://gitlab.inria.fr/ncedilni/pyezzi
Project-URL: Documentation, https://ncedilni.gitlabpages.inria.fr/pyezzi
Keywords: medical image processing
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy<3,>=2
Requires-Dist: tiny-metaio~=0.1.1
Dynamic: license-file

# pYezzi

Compute the thickness of a solid using the method described
by Yezzi and Prince ([An Eulerian PDE Approach for Computing Tissue
Thickness](http://dx.doi.org/10.1109/tmi.2003.817775)), extended by
Cedilnik and Peyrat ([Weighted Tissue Thickness](https://hal.science/hal-04111276/)).

![](https://gitlab.inria.fr/ncedilni/pyezzi/-/raw/master/thickness.png)

## Usage

[![READ THE DOCUMENTATION HERE](https://gitlab.inria.fr/ncedilni/pyezzi/-/badges/custom.svg?key_text=docs&value_text=here&value_color=green)](https://ncedilni.gitlabpages.inria.fr/pyezzi)

### Requirements

On Linux and MacOS, pyezzi requires the OpenMP runtime,
available as the `libgomp` package on most linux distributions or via [homebrew](https://brew.sh/).

### Command line

This package provides a basic CLI. Example usage:

```bash
pyezzi /path/to/endo.mha /path/to/epi.mha /path/to/output.mha [--weights /path/to/thickness_weights.mha]
```

If can use the excellent [uvx](https://docs.astral.sh/uv/guides/tools/),
you can download and launch it in a single command:

```bash
uvx pyezzi[cli] --help
```

### Container

The command-line interface is also available as a container.

```bash
docker run \                                      # you can use podman too
    -v /path/to/endo.mha:/input/endo.mha \
    -v /path/to/epi.mha:/input/epi.mha \
    -v /path/to/weights.mha:/input/weights.mha \  # optional
    -v /path/to/output/:/output/ \                # thickness.mha will be created here
    registry.gitlab.inria.fr/ncedilni/pyezzi:latest
```

### Python API

Pyezzi is open-source and available [on PyPI.org](https://pypi.python.org/pypi/pyezzi): `pip install pyezzi`.
Full API documentation is available on
[gitlabpages.inria.fr](https://ncedilni.gitlabpages.inria.fr/pyezzi).

```python
from pyezzi import compute_thickness_cardiac
thickness = compute_thickness_cardiac(endo, epi)
```

`endo` and `epi` are numpy binary masks. `endo` represents the
"inside" boundary of the domain, e.g., the cardiac ventricular blood
pool. `epi` represents the "outside" boundary of the domain, e.g., the
cardiac ventricular epicardium.

A `spacing` parameter specifying the spacing between voxels along the
axes can optionally be specified.

A `weights` parameter can be added to account for "holes" in the wall.

## Contributions

We recommend using [uv](https://docs.astral.sh/uv/) for project
management and [pre-commit](https://pre-commit.com/) to ensure code
quality.

After cloning, use `uv sync --frozen --all-groups --all-extras` to
install dev dependencies. This will set up a virtualenv in `.venv` that
you can activate with `source .venv/bin/activate`. Tests can then be run
with `pytest test`.

To build the cython extension modules in place, use
`python setup.py develop`.

## License

This work is licensed under the French [CeCILL license](https://www.cecill.info/licences/Licence_CeCILL_V2.1-en.html).
You are free to use and modify the code, but please cite the original paper and me.
