minhnhattrinh312/myopari

1

stars

26

commits

TeX

primary language

Aug 26, 2026

updated

Browse cluster: Research Paper Analysis and LLM Evaluation β†’

README

License MIT PyPI Python Version napari hub

πŸ«€ myopari

myopari: An Open-Source Edge AI Framework for Automated Quantitative Cardiac MRI Analysis.

πŸ’“ Introduction

myopari is a napari plugin for cardiac MRI segmentation and quantitative report generation. It brings ONNX-based AI inference to edge devices through an interactive interface that works with both 2D images and 3D volumes.

✨ Main features

  • 🧠 Built-in TIRAMISU_ACDC and TIRAMISU_EMIDEC segmentation models
  • πŸ–₯️ Local, edge-friendly ONNX inference
  • πŸ«€ Optional myocardium-only segmentation
  • πŸ“Š Per-class volume measurements and myocardium mass estimates
  • πŸ“„ Markdown report generation with optional patient information
  • πŸ€– Optional LLM-assisted report rewriting with llama-cpp-python

🎯 Model segmentation outputs

The output label groups for each model are defined as below:

ModelSegmentation outputLabel value(s)
TIRAMISU_ACDCRight ventricle1
TIRAMISU_ACDCMyocardium2
TIRAMISU_ACDCLeft ventricle3
TIRAMISU_EMIDECCavity1
TIRAMISU_EMIDECMyocardium2, 3, 4
TIRAMISU_EMIDECInfarction3, 4
TIRAMISU_EMIDECNo-reflow4

Some EMIDEC groups intentionally overlap: infarction and no-reflow are included in the broader myocardium group for quantitative reporting.

πŸš€ Usage

  1. Launch napari.
  2. Load a cardiac MRI image or volume.
  3. Open Plugins β†’ myopari β†’ myopari.
  4. Click Select image layer and choose the image to analyze.
  5. Select the edge device and segmentation model.
  6. Optionally enable Myocardium only.
  7. Click Segment. The result appears as a new labels layer named segmentation_<input_layer_name>_<count>.

πŸ“ Create a report

After segmentation:

  1. Optionally click Choose patient info files and select .cfg, .txt, or .md files.
  2. Optionally enable Use LLM for report.
  3. Click Create report.
  4. Click Save report to .md to export the result.

The report includes per-label volumes in mL and an estimated myocardium mass. If a logo is available in Resources, it is embedded in the report and copied beside the saved Markdown file.

⌨️ Installation Guide (Command Line)

The commands below create a dedicated Conda environment, install napari, automatically select the appropriate CPU or CUDA wheel for llama-cpp-python, and install myopari:

conda create -y -n myopari python=3.13
conda activate myopari
pip install "napari[all]==0.7.1"

# Check your CUDA version. If nvidia-smi is unavailable, use the CPU command.
# CPU:
pip install llama-cpp-python \
    --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
# CUDA (replace cu124 with your CUDA wheel tag, for example cu118 or cu121):
pip install llama-cpp-python \
    --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cu132
pip install myopari

napari

After napari opens, select Plugins β†’ myopari β†’ myopari.

This is the easiest installation method; no terminal or programming experience is required. πŸŽ‰

  1. Download and install the official napari bundled app:
  2. Before installing myopari, install llama-cpp-python using the installer for your operating system:
  3. Open napari after the llama-cpp-python installation finishes.
  4. Go to Plugins β†’ Install/Uninstall Plugins.
  5. Search for myopari.
  6. Click Install and restart napari when installation finishes.
  7. Open the plugin from Plugins β†’ myopari β†’ myopari. βœ…

The plugin is also listed on the napari hub.

πŸ› οΈ Troubleshooting

  • Segmentation runtime/provider issues: Check whether onnxruntime or onnxruntime-gpu is installed. For GPU inference, ensure that the CUDA and driver versions match the installed ONNX Runtime build.
  • LLM report generation fails: Install llama-cpp-python in napari's environment and ensure internet access is available for the first model download. Disable Use LLM for report to continue with standard report generation.
  • Plugin is missing after installation: Restart napari and check Plugins β†’ Install/Uninstall Plugins to confirm that myopari is installed and enabled.

πŸ“œ License

myopari is open-source software licensed under the MIT License.

Contributors

Copilot

3 commits

minhnhattrinh312/myopari

1

stars

26

commits

TeX

primary language

Aug 26, 2026

updated

Browse cluster: Research Paper Analysis and LLM Evaluation β†’

README

License MIT PyPI Python Version napari hub

πŸ«€ myopari

myopari: An Open-Source Edge AI Framework for Automated Quantitative Cardiac MRI Analysis.

πŸ’“ Introduction

myopari is a napari plugin for cardiac MRI segmentation and quantitative report generation. It brings ONNX-based AI inference to edge devices through an interactive interface that works with both 2D images and 3D volumes.

✨ Main features

  • 🧠 Built-in TIRAMISU_ACDC and TIRAMISU_EMIDEC segmentation models
  • πŸ–₯️ Local, edge-friendly ONNX inference
  • πŸ«€ Optional myocardium-only segmentation
  • πŸ“Š Per-class volume measurements and myocardium mass estimates
  • πŸ“„ Markdown report generation with optional patient information
  • πŸ€– Optional LLM-assisted report rewriting with llama-cpp-python

🎯 Model segmentation outputs

The output label groups for each model are defined as below:

ModelSegmentation outputLabel value(s)
TIRAMISU_ACDCRight ventricle1
TIRAMISU_ACDCMyocardium2
TIRAMISU_ACDCLeft ventricle3
TIRAMISU_EMIDECCavity1
TIRAMISU_EMIDECMyocardium2, 3, 4
TIRAMISU_EMIDECInfarction3, 4
TIRAMISU_EMIDECNo-reflow4

Some EMIDEC groups intentionally overlap: infarction and no-reflow are included in the broader myocardium group for quantitative reporting.

πŸš€ Usage

  1. Launch napari.
  2. Load a cardiac MRI image or volume.
  3. Open Plugins β†’ myopari β†’ myopari.
  4. Click Select image layer and choose the image to analyze.
  5. Select the edge device and segmentation model.
  6. Optionally enable Myocardium only.
  7. Click Segment. The result appears as a new labels layer named segmentation_<input_layer_name>_<count>.

πŸ“ Create a report

After segmentation:

  1. Optionally click Choose patient info files and select .cfg, .txt, or .md files.
  2. Optionally enable Use LLM for report.
  3. Click Create report.
  4. Click Save report to .md to export the result.

The report includes per-label volumes in mL and an estimated myocardium mass. If a logo is available in Resources, it is embedded in the report and copied beside the saved Markdown file.

⌨️ Installation Guide (Command Line)

The commands below create a dedicated Conda environment, install napari, automatically select the appropriate CPU or CUDA wheel for llama-cpp-python, and install myopari:

conda create -y -n myopari python=3.13
conda activate myopari
pip install "napari[all]==0.7.1"

# Check your CUDA version. If nvidia-smi is unavailable, use the CPU command.
# CPU:
pip install llama-cpp-python \
    --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
# CUDA (replace cu124 with your CUDA wheel tag, for example cu118 or cu121):
pip install llama-cpp-python \
    --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cu132
pip install myopari

napari

After napari opens, select Plugins β†’ myopari β†’ myopari.

This is the easiest installation method; no terminal or programming experience is required. πŸŽ‰

  1. Download and install the official napari bundled app:
  2. Before installing myopari, install llama-cpp-python using the installer for your operating system:
  3. Open napari after the llama-cpp-python installation finishes.
  4. Go to Plugins β†’ Install/Uninstall Plugins.
  5. Search for myopari.
  6. Click Install and restart napari when installation finishes.
  7. Open the plugin from Plugins β†’ myopari β†’ myopari. βœ…

The plugin is also listed on the napari hub.

πŸ› οΈ Troubleshooting

  • Segmentation runtime/provider issues: Check whether onnxruntime or onnxruntime-gpu is installed. For GPU inference, ensure that the CUDA and driver versions match the installed ONNX Runtime build.
  • LLM report generation fails: Install llama-cpp-python in napari's environment and ensure internet access is available for the first model download. Disable Use LLM for report to continue with standard report generation.
  • Plugin is missing after installation: Restart napari and check Plugins β†’ Install/Uninstall Plugins to confirm that myopari is installed and enabled.

πŸ“œ License

myopari is open-source software licensed under the MIT License.

Contributors

Copilot

3 commits

Languages

TeX

42.3%

Python

34.8%

BibTeX Style

16.9%

Batchfile

3.4%

Shell

2.6%