Pulseq in Python
Project description
PyPulseq: A Python Package for MRI Pulse Sequence Design
PyPulseq (v1.5.0) is compatible with all Pulseq interpreter sequences with version >= 1.5.0. The new features introduced with Pulseq 1.5.1 are not yet supported, but will be added in the near future.
Table of contents 🧾
- 📃 General Information
- 🔨 Installation
- ⚡ Lightning-start - PyPulseq in your browser!
- 🏃♂ Quickstart - example scripts
- 🤿 Deep dive - custom pulse sequences
- 👥 Contributing and Community guidelines
- 📖 References
1. General Information
Pulse sequence design is a significant component of MRI research. However, multi-vendor studies require researchers to be acquainted with each hardware platform's programming environment.
PyPulseq enables vendor-neutral pulse sequence design in Python [1,2]. The pulse sequences can be
exported as a .seq file to be run on Siemens, GE, Bruker and now also Philips hardware by leveraging their respective Pulseq interpreters. This tool is targeted at MRI pulse sequence designers, researchers, students and other interested
users. It is a translation of the Pulseq framework originally written in Matlab [3].
👉 Currently, PyPulseq is compatible with Pulseq >= 1.5.0. The new features introduced with Pulseq 1.5.1 are not yet supported, but will be added in the near future. 👈
It is strongly recommended to first read the Pulseq specification before proceeding. The specification document defines the concepts required for pulse sequence design using PyPulseq.
If you use PyPulseq in your work, please cite the publications listed under References.
2. 🔨 Installation
PyPulseq is available on the python Package Index PyPi and can be installed using the command
pip install pypulseq
To use the sigpy functionality of make_sigpy_pulse.py run pip install pypulseq[sigpy] to install the required dependencies and enable this functionality.
The latest features and minor bug fixes might not be included in the latest release version. If you want to use the bleeding edge version of PyPulseq, you can install it directly from the development branch of this repository using the command
pip install git+https://github.com/imr-framework/pypulseq@master
👉 PyPulseq is now available on conda. It can be installed using the command
conda install conda-forge::pypulseq
3. ⚡ Lightning-start - PyPulseq in your browser
- Create a new notebook on Google Colab
- Install PyPulseq using
pip install pypulseq - Get going!
4. 🏃♂ Example scripts
The PyPulseq repository contains several example sequences in the examples folder. Every example script or example notebook creates a pulse sequence, plots the pulse timing diagram and finally saves the sequence as a .seq file to disk.
5. 🤿 Deep dive - custom pulse sequences
Getting started with pulse sequence design using PyPulseq is simple:
-
First, define system limits in
Optsand then create aSequenceobject with it:import pypulseq as pp system = pp.Opts(max_grad=32, grad_unit='mT/m', max_slew=130, slew_unit='mT/m/ms') seq = pp.Sequence(system=system)
-
Then, design gradient, RF or ADC pulse sequence events:
Nx, Ny = 256, 256 # matrix size fov = 220e-3 # field of view delta_k = fov / Nx # RF sinc pulse with a 90 degree flip angle rf90 = pp.make_sinc_pulse(flip_angle=90, duration=2e-3, system=system, slice_thickness=5e-3, apodization=0.5,time_bw_product=4, use='excitation') # Frequency encode, trapezoidal event gx = pp.make_trapezoid(channel='x', flat_area=Nx * delta_k, flat_time=6.4e-3, system=system) # ADC readout adc = pp.make_adc(num_samples=Nx, duration=gx.flat_time, delay=gx.rise_time, system=system)
-
Add these pulse sequence events to the
Sequenceobject. One or more events can be executed simultaneously, simply pass them all to theadd_block()method. For example, thegxandadcpulse sequence events need to be executed simultaneously:seq.add_block(rf90) seq.add_block(gx, adc)
-
Visualize plots:
seq.plot()
-
Generate a
.seqfile to be executed on a real MR scanner:seq.write('demo.seq')
6. 👥 Contributing and Community guidelines
PyPulseq adheres to a code of conduct adapted from the Contributor Covenant code of conduct.
Contributing guidelines can be found here.
7. 📖 References
- Ravi, Keerthi, Sairam Geethanath, and John Vaughan. "PyPulseq: A Python Package for MRI Pulse Sequence Design." Journal of Open Source Software 4.42 (2019): 1725.
- Ravi, Keerthi Sravan, et al. "Pulseq-Graphical Programming Interface: Open source visual environment for prototyping pulse sequences and integrated magnetic resonance imaging algorithm development." Magnetic resonance imaging 52 (2018): 9-15.
- Layton, Kelvin J., et al. "Pulseq: a rapid and hardware‐independent pulse sequence prototyping framework." Magnetic resonance in medicine 77.4 (2017): 1544-1552.
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 pypulseq-1.5.0.post1.tar.gz.
File metadata
- Download URL: pypulseq-1.5.0.post1.tar.gz
- Upload date:
- Size: 134.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b7f84906b7ca95fc602159b16af73973ca5e1e251b7e5070fa094ada3ec1059
|
|
| MD5 |
cc36ceaa461903ac02b1623f59330374
|
|
| BLAKE2b-256 |
bb2ca8cd72c6ae8f38d93c01e1cfc624fa827e6fafcf55446ef6d2573c8b362a
|
Provenance
The following attestation bundles were made for pypulseq-1.5.0.post1.tar.gz:
Publisher:
publish-to-pypi.yml on imr-framework/pypulseq
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pypulseq-1.5.0.post1.tar.gz -
Subject digest:
4b7f84906b7ca95fc602159b16af73973ca5e1e251b7e5070fa094ada3ec1059 - Sigstore transparency entry: 870057764
- Sigstore integration time:
-
Permalink:
imr-framework/pypulseq@9acd4f02fc7fcb2277721a49186bd5628dddbb6a -
Branch / Tag:
refs/tags/v1.5.0.post1 - Owner: https://github.com/imr-framework
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@9acd4f02fc7fcb2277721a49186bd5628dddbb6a -
Trigger Event:
push
-
Statement type:
File details
Details for the file pypulseq-1.5.0.post1-py3-none-any.whl.
File metadata
- Download URL: pypulseq-1.5.0.post1-py3-none-any.whl
- Upload date:
- Size: 138.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
235bd463530153db3fd00cd759315db87148c9c3cadb1dca1fc16347039fecdf
|
|
| MD5 |
513951d68f790a471d75b4ff83e243cf
|
|
| BLAKE2b-256 |
5c12554c847fbffd9841e70c23d1736a610aba8208d575036d71f904b7ed005d
|
Provenance
The following attestation bundles were made for pypulseq-1.5.0.post1-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on imr-framework/pypulseq
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pypulseq-1.5.0.post1-py3-none-any.whl -
Subject digest:
235bd463530153db3fd00cd759315db87148c9c3cadb1dca1fc16347039fecdf - Sigstore transparency entry: 870057777
- Sigstore integration time:
-
Permalink:
imr-framework/pypulseq@9acd4f02fc7fcb2277721a49186bd5628dddbb6a -
Branch / Tag:
refs/tags/v1.5.0.post1 - Owner: https://github.com/imr-framework
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@9acd4f02fc7fcb2277721a49186bd5628dddbb6a -
Trigger Event:
push
-
Statement type: