img2physiprop (Image to Physical Property) is a python package that maps medical image data to physical properties. This makes it possible to vary e.g. material parameters in FE simulations according to patient specific medical image data. The package includes the following features to ease the development process and ensure a high code quality:
- PyTest testing framework including an enforced minimum coverage check
- Automated Github CI/CD
- Exhaustive Pre-Commit framework to automatically check code formatting and code quality
- Automatically generated Documentation based on the included Python docstrings
The remaining parts of the README are structured as follows:
For a quick and easy start an Anaconda/Miniconda environment is highly recommended. Other ways to install img2physiprop are possible but here the installation procedure is explained based on a conda install. After installing Anaconda/Miniconda execute the following steps:
- Create a new Anaconda environment based on the
environment.ymlfile:
conda env create -f environment.yml
- Activate your newly created environment:
conda activate i2pp
- Initialize all submodules
git submodule update --init --recursive
- All necessary third party libraries for all submodules can be installed using:
git submodule --quiet foreach --recursive pip install -e .
- Install all img2physiprop requirements with:
pip install -e .
- Finally, install the pre-commit hook with:
pre-commit install
Now you are up and running 🎉
To execute img2physiprop run
i2pp --config path/to/config.yaml
with your custom configuration file. A template configuration file containing all possible input configurations can be found in the folder templates/config.
To locally execute the tests and create the html coverage report simply run
pytest
To locally create the documentation from the provided docstrings simply run
pdoc --html --output-dir docs src/i2pp
To ease the dependency update process pip-tools is utilized. To create the necessary requirements.txt file simply execute
pip-compile --all-extras --output-file=requirements.txt requirements.in
To upgrade the dependencies simply execute
pip-compile --all-extras --output-file=requirements.txt --upgrade requirements.in
Finally, perforfmance critical packages such as Numpy and Numba are installed via conda to utilize BLAS libraries.
All contributions are welcome. See CONTRIBUTING.md for more information.
This project is licensed under a MIT license. For further information check LICENSE.md.