Pulseq-compatible, high-performance MRI simulation in Python, powered by KomaMRI.jl.
Project description
komamripy
Pulseq-compatible, high-performance MRI simulation in Python.
komamripy is a thin Python interface to
KomaMRI.jl, a high-performance
Julia framework for MRI simulation. It exposes KomaMRI to Python through
juliacall, so
Python users can run fast CPU/GPU MRI simulations without writing any Julia.
Installation
Install by using uv (recommended) or pip (remove uv):
uv pip install git+https://github.com/JuliaHealth/komamripy
You do not need to install Julia yourself: juliacall provisions a suitable
Julia automatically, and KomaMRI is installed on first import.
Quick start
The first import downloads Julia and precompiles KomaMRI, which can take a few minutes. Subsequent runs are fast.
import komamripy as km
import numpy as np
sys = km.Scanner() # scanner hardware
obj = km.brain_phantom2D() # 2D brain phantom
seq = km.PulseDesigner.EPI_example() # example EPI sequence
sim_params = km.KomaMRICore.default_sim_params()
sim_params["return_type"] = "mat" # return the raw signal matrix
raw = km.simulate(obj, seq, sys, sim_params=sim_params)
signal = np.asarray(raw)
print(signal.shape)
A runnable version lives in examples/.
How it works
komamripy mirrors the KomaMRI Julia namespace: any function or type that
KomaMRI exposes is available as an attribute of komamripy. Julia code
therefore translates to Python almost line for line.
Simulation results are returned as Julia objects; convert array-like results to
NumPy with numpy.asarray.
Status
komamripy is under active development as a Google Summer of Code project.
Currently supported: the core simulation pipeline and reading Pulseq files.
Planned: PyPI releases, GPU backend selection, tighter pypulseq integration, and differentiable workflows.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file komamripy-0.0.2.tar.gz.
File metadata
- Download URL: komamripy-0.0.2.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
392a7114f84c22049952ce2f67a8dcff8cc768a56e861262cb813555398ace75
|
|
| MD5 |
53d6f1891043fd395bf7602817cb8f0a
|
|
| BLAKE2b-256 |
afea6372b5dada2d2e0ba1ebeb3694e351be56fcfc21e57fd536b3dfc8ca806a
|
Provenance
The following attestation bundles were made for komamripy-0.0.2.tar.gz:
Publisher:
publish.yml on JuliaHealth/komamripy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
komamripy-0.0.2.tar.gz -
Subject digest:
392a7114f84c22049952ce2f67a8dcff8cc768a56e861262cb813555398ace75 - Sigstore transparency entry: 2031402426
- Sigstore integration time:
-
Permalink:
JuliaHealth/komamripy@1dbb080e373532a09d9365db237990a1fe791517 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/JuliaHealth
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1dbb080e373532a09d9365db237990a1fe791517 -
Trigger Event:
push
-
Statement type:
File details
Details for the file komamripy-0.0.2-py3-none-any.whl.
File metadata
- Download URL: komamripy-0.0.2-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
911862f4381747e0bd645305b970b4ab755636b8934aa72a0868d19f3846b633
|
|
| MD5 |
ddc3619cc9684e3b42e2738a17bec79d
|
|
| BLAKE2b-256 |
86df4e1cb7700ecda2e0a2895c9438ef705e293c57f9974e3098c54695377862
|
Provenance
The following attestation bundles were made for komamripy-0.0.2-py3-none-any.whl:
Publisher:
publish.yml on JuliaHealth/komamripy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
komamripy-0.0.2-py3-none-any.whl -
Subject digest:
911862f4381747e0bd645305b970b4ab755636b8934aa72a0868d19f3846b633 - Sigstore transparency entry: 2031402507
- Sigstore integration time:
-
Permalink:
JuliaHealth/komamripy@1dbb080e373532a09d9365db237990a1fe791517 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/JuliaHealth
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1dbb080e373532a09d9365db237990a1fe791517 -
Trigger Event:
push
-
Statement type: