Skip to main content

PyPulseq

License: MIT Python FAIR checklist badge

PyPulseq: A Python Package for MRI Pulse Sequence Design

PyPulseq (v1.5.0.post2) is compatible with all Pulseq interpreter sequences with version >= 1.5.0. The new features introduced with Pulseq 1.5.1 are not yet fully supported, but will be added in the near future with release 1.5.1.

Table of contents 🧾

  1. 📃 General Information
  2. 🔨 Installation
  3. ⚡ Lightning-start - PyPulseq in your browser!
  4. 🏃‍♂ Quickstart - example scripts
  5. 🤿 Deep dive - custom pulse sequences
  6. 👥 Contributing and Community guidelines
  7. 📖 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

  1. Create a new notebook on Google Colab
  2. Install PyPulseq using pip install pypulseq
  3. 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:

  1. First, define system limits in Opts and then create a Sequence object 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)
    
  2. 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)
    
  3. Add these pulse sequence events to the Sequence object. One or more events can be executed simultaneously, simply pass them all to the add_block() method. For example, the gx and adc pulse sequence events need to be executed simultaneously:

    seq.add_block(rf90)
    seq.add_block(gx, adc)
    
  4. Visualize plots:

    seq.plot()
    
  5. Generate a .seq file 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

  1. 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.
  2. 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.
  3. Layton, Kelvin J., et al. "Pulseq: a rapid and hardware‐independent pulse sequence prototyping framework." Magnetic resonance in medicine 77.4 (2017): 1544-1552.

Metadata

Release files for pypulseq 1.5.0.post2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pypulseq 1.5.0.post2
File Size Uploaded Provenance Actions
pypulseq-1.5.0.post2.tar.gz 165.2 kB With provenance Details for pypulseq-1.5.0.post2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pypulseq 1.5.0.post2
File Interpreter ABI Platform Actions
pypulseq-1.5.0.post2-py3-none-any.whl Python 3 none any Details for pypulseq-1.5.0.post2-py3-none-any.whl

Total release size: 320.0 kB

Release files / pypulseq-1.5.0.post2.tar.gz

Download URL pypulseq-1.5.0.post2.tar.gz
Size 165.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8854ff1d1057a11fd47b3a01a03b12f0c2aa80712e34da7c019dc47c15ab908b
BLAKE2b-256 checksum
How to use checksums
46c52ab6eb42d72fae5dfe2382b2ebc0a0ec47d73f87f61015ca6751e5277119
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / pypulseq-1.5.0.post2-py3-none-any.whl

Download URL pypulseq-1.5.0.post2-py3-none-any.whl
Size 154.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e88edcb98679f970de400126a2686dbde96ceb4ee797688226d217726bc74b99
BLAKE2b-256 checksum
How to use checksums
217b071e13f1f9143a99c8e81ff89a4350e662cd9c99b6361fbe516a9699154b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Security for pypulseq 1.5.0.post2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pypulseq-1.5.0.post2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page