Skip to main content

Tests PyPI Docs: stable Virtual scanner: try it License: MIT

pulserver

pulserver lets you run your own sequence on a clinical scanner as if it were a product sequence: the operator edits it in the scanner UI, and the images come back to the console. Sequences are exchanged as Pulseq, so any tool that writes a .seq file (pypulseqpp, MATLAB Pulseq, BART's seq...) can provide one; pypulseqpp is the one pulserver uses natively.

You write two Python plugins, one that designs the sequence and one that reconstructs it. pulserver does everything in between: it answers the scanner UI, checks the sequence, converts it into the form the scanner plays, and routes the raw data back to your reconstruction.

pulserver architecture

The scanner side is a vendor interpreter, a small program on the scanner that calls pulserver. pulserver itself never touches the hardware.

How it works

  1. The operator opens your sequence. The scanner asks pulserver which parameters to show (TE, TR, flip angle, matrix...), and pulserver reads them from your sequence plugin.
  2. Every time the operator changes a value, pulserver asks your plugin whether the protocol is feasible and what it achieves (the TE, the TR, the scan time), and sends that back to the scanner. How your plugin answers is up to you: design one TR, or compute the times from the block durations. If the value is impossible, the scanner shows your error message instead.
  3. When the operator presses Scan, pulserver designs the whole sequence, runs the checks (timing, gradient and slew limits, PNS, mechanical resonance, acoustic noise) and converts it into the cache the interpreter plays, shifted to the prescribed field of view.
  4. The scanner plays it and streams the raw data to pulserver.
  5. pulserver fills in everything the sequence knows and the scanner does not: the MRD header (encoding spaces, matrix, field of view), and on every readout its acquisition header, flags, encoding counters from the sequence's labels, and trajectory. Your recon plugin receives these enriched readouts, sorts them into k-space and reconstructs as soon as a slice or volume is complete.
  6. Your plugin returns images; pulserver turns them into DICOM and sends them back to the console.

The sequence plugin

A sequence plugin takes a pypulseqpp sequence function, a function that returns a Sequence, and tells the scanner which of its arguments the operator can edit:

# sequences/gre.py
from pypulseqpp.sequences.sequence.gre2D_sequence import gre2d
from pulserver.design import Evaluation, FloatParam, SequencePlugin, TimeParam, UIParam


class Gre(SequencePlugin):
    app = gre2d
    protocol = {
        # ms on the scanner UI, µs on the wire, s for gre2d
        UIParam.TE: TimeParam("te", range_min=2000, range_max=20000),
        UIParam.FLIP: FloatParam(
            "flip_angle_deg", unit="deg", range_min=1, range_max=90
        ),
    }

    def evaluate(self, system, protocol):
        arguments = protocol.arguments  # SI units, as gre2d takes them
        one_line = arguments | {"ry": 128, "n_acs_y": 0, "n_dummy": 0}  # one TR
        seq = self.app(system, **one_line)
        return Evaluation(protocol.replace({UIParam.TE: seq.definitions["TE"][0]}))
  • protocol maps each scanner UI button (a UIParam key) to the argument of your function it sets, with its unit and range (a *Param value). Arguments you leave out keep the function's defaults.
  • evaluate runs on every edit, so keep it fast. Here it designs one line and reads back the TE; it could equally compute the TR from block durations, or accept the requested TR when it is feasible. To refuse a value, raise; the message goes to the operator.
  • The whole scan is built only when the operator starts it, by calling your function with the final protocol.

pulserver ships a plugin for each of pypulseqpp's 28 built-in sequences (Cartesian, radial, spiral, PROPELLER, EPI, FSE, MPRAGE, bSSFP, ZTE), so --plugin gre2d works without writing anything.

The recon plugin

The reconstruction side follows Gadgetron and ISMRMRD: the data arrive as an MRD stream (a header, then one acquisition per readout), and a recon plugin handles them as they arrive, much like a Gadgetron gadget chain. Any framework can do the maths; this one uses bartorch:

# recon/pics.py
import torch
import bartorch.tools as bt

from bartorch import apps, priors
from pulserver import recon


class Pics(recon.ReconPlugin):
    def recon(self, context, branch, data):
        kspace = torch.from_numpy(data.data.kspace)[:, None]  # (coils, z, y, x)
        maps = bt.ecalib(kspace, maps=1)
        image = apps.pics(kspace, maps, regularizers=priors.Wavelet((-1, -2), 0.005))
        return recon.ReconResult(image.abs().squeeze(0).numpy())


PLUGIN = Pics()
  • The plugin places each readout in k-space as it arrives, by its encoding counters, and recon is called once per slice or volume, when the flag that closes it arrives. By default that is the end of the scan; pass triggers={"imaging": AcquisitionFlag.LAST_IN_SLICE} to reconstruct slice by slice.
  • The flags and counters come from the labels in your sequence (pp.make_label, as in PyPulseq), so a correctly labelled sequence needs no sorting code in the reconstruction.
  • Return a ReconResult; pulserver writes the image header (position, orientation, field of view) from the sequence and the scanner.

The scanner chooses the recon by name, independently of the sequence, so one recon can serve many sequences.

Try it without a scanner

The virtual scanner plays your sequence on a phantom and streams the data to your recon, through exactly the path a real scan takes:

pip install pulserver bartorch
printf '[Limits]\nB0: 3.0\n[Limits End]\n' > system.txt
pulserver proxy --store designs --port 9002 --plugins recon &
pulserver scan --plugins sequences --plugin gre --reconstruction pics \
  --limits system.txt --store designs --recon 127.0.0.1:9002 --output images

Or skip the install and try it in your browser: https://pulserver.github.io/MaRGE/.

On a real scanner

You need the vendor interpreter for your scanner, which calls pulserver design for steps 1 to 3 and streams the raw data to pulserver proxy for steps 4 to 6. Running the services explains how to set both up.

pulserver's checks compute estimates. Passing them does not establish scanner or patient safety: SAR and RF and gradient heating are checked by the scanner's own routines.

Learn more

  • Course: six lessons from a protocol to an image.
  • Documentation, for every option and API detail.

How to cite

If you use pulserver in your work, please cite:

@inproceedings{cencini2025pulserver,
  title     = {Pulserver: an open-source Pulseq-based client-server framework for vendor agnostic, interactive {MR} sequence design},
  author    = {Cencini, Matteo and Wang, Kang and Huang, Sherry and Schulte, Rolf F. and Sprenger, Tim
               and Noll, Douglas C. and Tosetti, Michela and Nielsen, Jon-Fredrik},
  booktitle = {Proceedings of the International Society for Magnetic Resonance in Medicine},
  pages     = {1275},
  year      = {2025}
}

pulserver builds on Pulseq (Layton et al., 2017) and the ISMRM raw data format (Inati et al., 2017); please cite those too.

License

MIT, see LICENSE.

Metadata

Release files for pulserver 0.0.4

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

Source distribution (sdist)

Source distribution for pulserver 0.0.4
File Size Uploaded
pulserver-0.0.4.tar.gz 1.1 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for pulserver 0.0.4
File
pulserver-0.0.4-cp314-cp314-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.26+ x86-64, Linux glibc 2.28+ x86-64 Details
pulserver-0.0.4-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details
pulserver-0.0.4-cp313-cp313-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.26+ x86-64, Linux glibc 2.28+ x86-64 Details
pulserver-0.0.4-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
pulserver-0.0.4-cp312-cp312-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64, Linux glibc 2.26+ x86-64 Details
pulserver-0.0.4-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
pulserver-0.0.4-cp311-cp311-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.26+ x86-64 Details
pulserver-0.0.4-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
pulserver-0.0.4-cp310-cp310-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64, Linux glibc 2.26+ x86-64 Details
pulserver-0.0.4-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details

Total release size: 11.0 MB

Release files / pulserver-0.0.4.tar.gz

Download URL pulserver-0.0.4.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
8f069a4e321b8bd9f0e0cf1c876314c6fdd6daabaaf4f1361b0c4bbea4a63870
BLAKE2b-256 checksum
How to use checksums
2669d4e08e18f6cd7c8f9716572fbc0e2c0c17e219e4996d0beeb0f30b206015
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 14, 2026.

Transparency log

Release files / pulserver-0.0.4-cp314-cp314-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl

Download URL pulserver-0.0.4-cp314-cp314-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl
Size 1.3 MB
Tags CPython 3.14 Linux glibc 2.26+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
ba8484c8e9415d03533dd9becd664648972b257659ab71135932406389159e52
BLAKE2b-256 checksum
How to use checksums
2a6abc83659503184f6fe986fda1d57ab0c5b31b2f75909a695d823df424565e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 14, 2026.

Transparency log

Release files / pulserver-0.0.4-cp314-cp314-macosx_11_0_arm64.whl

Download URL pulserver-0.0.4-cp314-cp314-macosx_11_0_arm64.whl
Size 711.3 kB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
b8aef59c9e27b971e9be8d1b0e6d054e38011e49e6d740c11d090808eeba2702
BLAKE2b-256 checksum
How to use checksums
cf4d7b45dc18f147eff100b7687c1d1ec23e620c9e1f1e57a29a0ed520e3396b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 14, 2026.

Transparency log

Release files / pulserver-0.0.4-cp313-cp313-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl

Download URL pulserver-0.0.4-cp313-cp313-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl
Size 1.3 MB
Tags CPython 3.13 Linux glibc 2.26+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
da4d3bb717f385e426d9227ba53233051cb7a94cf059a83571be2559a3af494f
BLAKE2b-256 checksum
How to use checksums
fd133d7932b2310af222eb8a82f7d6823b3ea3c0f13932dc57c9a7ff388a4afb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 14, 2026.

Transparency log

Release files / pulserver-0.0.4-cp313-cp313-macosx_11_0_arm64.whl

Download URL pulserver-0.0.4-cp313-cp313-macosx_11_0_arm64.whl
Size 710.5 kB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ba27c6486d938ff5f9189147c68e646d03e3835904548d8d8b5f182886ea7546
BLAKE2b-256 checksum
How to use checksums
6710ea46ccdcc59ad99373d91a44dcd024abdfff46d0a7c495bfe8ae3761ef8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 14, 2026.

Transparency log

Release files / pulserver-0.0.4-cp312-cp312-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl

Download URL pulserver-0.0.4-cp312-cp312-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl
Size 1.3 MB
Tags CPython 3.12 Linux glibc 2.26+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
70d0fdfe3b1b97e64e4235b670e4fab0c5013daae770f028b106840ba6b90b6e
BLAKE2b-256 checksum
How to use checksums
335eeb11214f671c0e6cd2352a6181216d1b62de3eac6daf63f40636e35b70f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 14, 2026.

Transparency log

Release files / pulserver-0.0.4-cp312-cp312-macosx_11_0_arm64.whl

Download URL pulserver-0.0.4-cp312-cp312-macosx_11_0_arm64.whl
Size 710.5 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
8645f8499d5213a97246fa0e46214d0489ce47d6aadd087a8a16f06f29531aab
BLAKE2b-256 checksum
How to use checksums
313d27e1c0216eb568a3aa2d741581be5abc5483efbc32dd7ecd514c329469a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 14, 2026.

Transparency log

Release files / pulserver-0.0.4-cp311-cp311-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl

Download URL pulserver-0.0.4-cp311-cp311-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl
Size 1.3 MB
Tags CPython 3.11 Linux glibc 2.26+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
d8f4034877e09fc294df1013e939e38ea86c614db3cf29b1b7b7e9953c4cba24
BLAKE2b-256 checksum
How to use checksums
4f6d608962abb032114577f48962d42c2d344af65ea70a918391590890a666d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 14, 2026.

Transparency log

Release files / pulserver-0.0.4-cp311-cp311-macosx_11_0_arm64.whl

Download URL pulserver-0.0.4-cp311-cp311-macosx_11_0_arm64.whl
Size 708.4 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
db0ccf186f0ff0240225320fe6896d8e27543cf38e8f25eeeec5834924ead05f
BLAKE2b-256 checksum
How to use checksums
7d6718766bde403059460509a4979c99591f915204772a27bac93c25534027bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 14, 2026.

Transparency log

Release files / pulserver-0.0.4-cp310-cp310-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl

Download URL pulserver-0.0.4-cp310-cp310-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl
Size 1.3 MB
Tags CPython 3.10 Linux glibc 2.26+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
abf4e7963778fd96a5c34a16d91f24dc0975135b347d21e9e33912e8103d7a11
BLAKE2b-256 checksum
How to use checksums
e758b9f0273b798ec0abe83646e69a1c743d5d486c2edc35ef19f9e77829a8a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 14, 2026.

Transparency log

Release files / pulserver-0.0.4-cp310-cp310-macosx_11_0_arm64.whl

Download URL pulserver-0.0.4-cp310-cp310-macosx_11_0_arm64.whl
Size 707.2 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3668bf75f8380c3aefa7fe93ef819884d039ed1cef8f21a500683cdc578fce96
BLAKE2b-256 checksum
How to use checksums
1fb8bf15bc675498b843a7578a8be492cce79c7d823219864bdefe838b256a74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 14, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.1

11 release files

0.4.0

11 release files

0.3.0

11 release files

0.2.2

11 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

This release

0.0.4 This release

11 release files

0.0.2

11 release files

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