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.4.2

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.4.2
File Size Uploaded Provenance Actions
pulserver-0.4.2.tar.gz 1.2 MB With provenance Details for pulserver-0.4.2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for pulserver 0.4.2
File Actions
pulserver-0.4.2-cp314-cp314-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64, Linux glibc 2.26+ x86-64 Details for pulserver-0.4.2-cp314-cp314-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl
pulserver-0.4.2-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details for pulserver-0.4.2-cp314-cp314-macosx_11_0_arm64.whl
pulserver-0.4.2-cp313-cp313-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64, Linux glibc 2.26+ x86-64 Details for pulserver-0.4.2-cp313-cp313-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl
pulserver-0.4.2-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for pulserver-0.4.2-cp313-cp313-macosx_11_0_arm64.whl
pulserver-0.4.2-cp312-cp312-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.26+ x86-64, Linux glibc 2.28+ x86-64 Details for pulserver-0.4.2-cp312-cp312-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl
pulserver-0.4.2-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for pulserver-0.4.2-cp312-cp312-macosx_11_0_arm64.whl
pulserver-0.4.2-cp311-cp311-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.26+ x86-64, Linux glibc 2.28+ x86-64 Details for pulserver-0.4.2-cp311-cp311-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl
pulserver-0.4.2-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for pulserver-0.4.2-cp311-cp311-macosx_11_0_arm64.whl
pulserver-0.4.2-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 for pulserver-0.4.2-cp310-cp310-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl
pulserver-0.4.2-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details for pulserver-0.4.2-cp310-cp310-macosx_11_0_arm64.whl

Total release size: 11.1 MB

Release files / pulserver-0.4.2.tar.gz

Download URL pulserver-0.4.2.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
cc34c1842755018db67d33285fea9ef88d6c2ceafc676ac611dcd6bba090b806
BLAKE2b-256 checksum
How to use checksums
ff1feda9d9c4d38ca5b29c16f889d206f8ee72b93ee11883de0e2437e75d1261
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 Oct 22, 2026.

Transparency log

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

Download URL pulserver-0.4.2-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
696b3b7bdfa7ced9292a8783094cf32ae2202bdebb468e234ab92e202b31f660
BLAKE2b-256 checksum
How to use checksums
659cd2ef3011b3ac3f89a0fcb88d9f5160b09d365eec9022246336d5be4ce63f
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 Oct 22, 2026.

Transparency log

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

Download URL pulserver-0.4.2-cp314-cp314-macosx_11_0_arm64.whl
Size 719.8 kB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
244913fb1fbcaa07524adc7a26841c429fa83db898aecd13074d2f3a1fe8d125
BLAKE2b-256 checksum
How to use checksums
029abb557bd478f9dcc19f7bf29b55ab9434a93efc35268563623e4b8fa960b9
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 Oct 22, 2026.

Transparency log

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

Download URL pulserver-0.4.2-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
f32593f180f88b1d24fd57a34128c41b60cfb8b16fd164318a036a738c4166a8
BLAKE2b-256 checksum
How to use checksums
6f182b11a3315dfac38364c3329abe6cd14621641f236337d02a551493e6e4b8
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 Oct 22, 2026.

Transparency log

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

Download URL pulserver-0.4.2-cp313-cp313-macosx_11_0_arm64.whl
Size 719.4 kB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ad0abc79578bffddb27341787a58fe003ce8da0d90acb7272a30ddf62a4c87fa
BLAKE2b-256 checksum
How to use checksums
a8224a681d76de64d9a68452569b594b38a88429bdd01d9119647b3e2acaa992
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 Oct 22, 2026.

Transparency log

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

Download URL pulserver-0.4.2-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
2702aa455b558f34a3185edb4f2bdb1795eb9af1ece6aa7be7f350859e1cd963
BLAKE2b-256 checksum
How to use checksums
c26e85df0e25c8e96c3649047eb48cba04279a04cca5b2cf481c2340acd7babd
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 Oct 22, 2026.

Transparency log

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

Download URL pulserver-0.4.2-cp312-cp312-macosx_11_0_arm64.whl
Size 719.4 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4b47c0f869e706ee2c4bb902d4c204e3817506a5cda24b88b241b3c171023245
BLAKE2b-256 checksum
How to use checksums
522c5d072b71644fc0209f75c063581b14421eeaa99708e8f33c9637c9b7731d
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 Oct 22, 2026.

Transparency log

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

Download URL pulserver-0.4.2-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
da6753de20380526bd67f49a4b32aea86994670fd097994365ec724db6d7cc67
BLAKE2b-256 checksum
How to use checksums
18e5c4e7f87ab6c469a2a092ca06833ab4e9b7af8d92b988ff3b3881a379e1ad
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 Oct 22, 2026.

Transparency log

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

Download URL pulserver-0.4.2-cp311-cp311-macosx_11_0_arm64.whl
Size 716.8 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
78aba70591894680605179aa90c5d7c90057d6cdd852339fbebe20ac35e88ed5
BLAKE2b-256 checksum
How to use checksums
44da2da17fdc40a6be0d45160f58dee9aadc46cf7054d14427efe6e2b8a02af1
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 Oct 22, 2026.

Transparency log

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

Download URL pulserver-0.4.2-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
bfa84a98ae0e15c117552d92e0e83895503bbec645ecf7a68b259011bc6553f2
BLAKE2b-256 checksum
How to use checksums
ebf5649426e886e6eaae0f68467c1b4526506a7fcd018cb1845463a2e72700ad
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 Oct 22, 2026.

Transparency log

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

Download URL pulserver-0.4.2-cp310-cp310-macosx_11_0_arm64.whl
Size 715.4 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3285b460548298f56c540b27d4b774a59e725596af9fdeacffb6bdb56430f924
BLAKE2b-256 checksum
How to use checksums
ae08dbc2b8ed99b419e75e6c03b4627c3e558d0a8e91e4867a9a321b3534b03c
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 Oct 22, 2026.

Transparency log

Security for pulserver 0.4.2

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

All 11 files in this release have been uploaded with provenance metadata.

Select from 11 files

Attestation for pulserver-0.4.2.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 Oct 22, 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.

Release history Release notifications | RSS feed

This release

0.4.2 This release

11 release files Full provenance

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