Skip to content

Repository files navigation

pypulseqpp

Pulseq sequence design and analysis with a C++ core and a PyPulseq-compatible Python interface.

Tests codecov PyPI License: MIT

pypulseqpp combines compiled event storage, block registration and analysis with PyPulseq event factories. It also provides RF and gradient design, sampling patterns, and composable excitation, preparation and readout modules.

Scope

  • Pulseq text and binary reading/writing, signatures and event deduplication.
  • Waveform expansion, k-space trajectories, sequence reports and structural repetition detection.
  • Timing, gradient amplitude, slew and boundary-continuity checks.
  • Logical-frame FOV scaling, rotation and translation.
  • Pulse, trajectory and sampling design, with reusable sequence modules.

This is an alpha package, not a complete replacement for every PyPulseq feature. PNS, SAR and mechanical resonance assessment are not provided by the core checks; passing them does not establish scanner or patient safety.

Scanner execution, protocol orchestration and reconstruction integration belong to Pulserver.

Install

Requires Python 3.10 or later. Runtime dependencies are NumPy, SciPy and PyPulseq; the native core is included in platform wheels.

pip install pypulseqpp

The optional viewer is a separate GPL-licensed package:

pip install 'pypulseqpp[plot]'

Basic use

import pypulseqpp as pp

system = pp.Opts(max_grad=40, grad_unit="mT/m", max_slew=150, slew_unit="T/m/s")
seq = pp.Sequence(system)
gx = pp.make_trapezoid("x", area=100, system=system)
seq.add_block(gx)
ok, errors = seq.check_timing()
seq.write("example.seq")

Sequence-module classes are available from pypulseqpp.sequences. The API reference groups sequence operations, event design, sampling, modules and checks.

Development and documentation

See the contribution guide for installation and checks. Build the local Markdown/Sphinx documentation with:

pip install -e '.[doc]'
make -C docs html

Open docs/build/html/index.html. The API reference is populated; the user guide, developer guide and examples sections are scaffolds.

About

Fast drop-in PyPulseq replacement over a C++ sequence core, with hardware safety checks.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages