|
| 1 | +# pycemrg-image-analysis |
| 2 | + |
| 3 | +A high-level framework for cardiac image segmentation post-processing and model creation, built on SimpleITK. Maintained by the [Cardiac Electromechanics Research Group (CEMRG)](https://www.cemrg.com/) at Imperial College London. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## Installation |
| 8 | + |
| 9 | +This library depends on [`pycemrg`](https://pypi.org/project/pycemrg/), which provides the core label management and configuration scaffolding utilities. Both packages should be installed together. |
| 10 | + |
| 11 | +### 1. Clone both repositories |
| 12 | + |
| 13 | +```bash |
| 14 | +git clone https://github.com/OpenHeartDevelopers/pycemrg.git |
| 15 | +git clone https://github.com/OpenHeartDevelopers/pycemrg-image-analysis.git |
| 16 | +``` |
| 17 | + |
| 18 | +### 2. Create and activate a virtual environment |
| 19 | + |
| 20 | +**Preferred:** Conda |
| 21 | +```bash |
| 22 | +conda create -n pycemrg-image-analysis python=3.10 -y |
| 23 | +conda activate pycemrg-image-analysis |
| 24 | +``` |
| 25 | + |
| 26 | +Or via python's venv |
| 27 | +```bash |
| 28 | +python -m venv .venv |
| 29 | +source .venv/bin/activate # on Windows: .venv\Scripts\activate |
| 30 | +``` |
| 31 | + |
| 32 | +### 3. Install both packages in editable mode |
| 33 | + |
| 34 | +Install `pycemrg` first, then `pycemrg-image-analysis`: |
| 35 | + |
| 36 | +```bash |
| 37 | +pip install -e pycemrg/ |
| 38 | +pip install -e pycemrg-image-analysis/ |
| 39 | +``` |
| 40 | + |
| 41 | +> **Why editable (`-e`)?** Editable installs link directly to the source tree so changes to either package take effect immediately without reinstalling. |
| 42 | +
|
| 43 | +--- |
| 44 | + |
| 45 | +## Running the tests |
| 46 | + |
| 47 | +```bash |
| 48 | +# Unit tests (no data required) |
| 49 | +pytest pycemrg-image-analysis/tests/unit/ |
| 50 | + |
| 51 | +# Integration tests (requires segmentation data) |
| 52 | +PYCEMRG_TEST_DATA_ROOT=/path/to/your/data pytest pycemrg-image-analysis/tests/integration/ |
| 53 | + |
| 54 | +# All tests |
| 55 | +pytest pycemrg-image-analysis/ |
| 56 | +``` |
| 57 | + |
| 58 | +Integration tests are skipped automatically when `PYCEMRG_TEST_DATA_ROOT` is not set. |
| 59 | + |
| 60 | +--- |
| 61 | + |
| 62 | +## Requirements |
| 63 | + |
| 64 | +- Python ≥ 3.10 |
| 65 | +- SimpleITK ≥ 2.4.0 |
| 66 | +- `pycemrg` ≥ 0.1.0 (see above) |
| 67 | + |
| 68 | +All other dependencies are declared in `pyproject.toml` and installed automatically by `pip`. |
0 commit comments