A fast, simple, and extensible Python library for transforming Finite Element simulations into MR Images
FEelMRI is an open-source, cross-platform library designed to generate synthetic magnetic resonance (MR) images from finite element (FE) simulations. It can handle complex physical phenomena governed by partial differential equations (PDEs) and supports arbitrary cell geometries and discrete function spaces.
![]() Orthogonal-CSPAMM |
![]() 4D Flow |
![]() Abdominal FFE |
![]() Free Running |
- Installation
- Quick Start Example
- First Run
- Docker Setup (Cross-Platform)
- How to Contribute
- Citation
- License
These steps were tested primarily on Linux systems. For Windows and macOS, please refer to Docker Setup.
You’ll need some basic system libraries and build tools. On Ubuntu/Debian:
sudo apt-get update && sudo apt-get install -y --no-install-recommends \
build-essential \
python3 python3-dev python3-pip python3-tk \
cmake ninja-build git libopenmpi-devgit clone https://github.com/hernanmella/feelmri.git
cd feelmripip install .Verify installation ✅:
python3 -c "import feelmri; print(feelmri.__version__)"7z x examples/phantoms/phantoms_compressed.zip -oexamples/phantoms/Example scripts are provided in the examples/ directory.
To run an example using multiple cores:
cd examples/
mpirun -n <nb_cores> python3 <example_script>.pyReplace <nb_cores> with the number of CPU cores to use.
To plan and position the FOV position and orientation, you are referred to examples/planning/ directory.
If you prefer an isolated or multi-platform setup, you can use Docker.
docker build \
--build-arg UID=$(id -u) \
--build-arg GID=$(id -g) \
-f docker/Dockerfile \
-t feelmri:latest .docker run --name feelmri_container \
--shm-size 256m -ti \
-v $(pwd):/home/feelmri/ \
feelmri:latestIf you want to visualize plots (e.g., matplotlib):
xhost +local:root
docker run -it \
--env="DISPLAY" \
--volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
-v $(pwd):/home/feelmri/ \
feelmri:latestWe welcome community contributions! To get started:
- Fork the repository
- Create a new branch (
git checkout -b feature-name) - Make your changes
- Submit a pull request 🎉
More details are in CONTRIBUTING.md.
The related research article is currently under review. Citation details will be added soon.
This project is distributed under the MIT License. See the LICENSE file for details.
© 2025 Hernán Mella — FEelMRI Project




