Skip to content

Python tools to write Pulseq files for GEHC scanners (i.e., TOPPE interpreter).

License

Notifications You must be signed in to change notification settings

INFN-MRI/pypulceq

Repository files navigation

PyPulCeq

Python tools to write Pulseq files for GEHC scanners (i.e., TOPPE interpreter).

Installation

The PyPulCeq package can be installed from source using pip:

  1. Clone the repo
git clone git@github.com:INFN-PREDATOR/pypulceq.git
  1. Navigate to the repository root folder and install using pip:
 pip install .

Usage

PyPulCeq can be used as a library in Pypulseq -based sequence design routines as follows:

import pypulceq
seq = my_design_routine() # replace with your design

# create GEHC system specs 
# if not provided, parse from pypulseq.Opts in seq.system,
# and use default nslices=2048, nviews=600 for frame indexing
sys = pypulceq.SystemSpecs()

# perform actual conversion
pypulceq.seq2files("myseq", seq, sys) # TOPPE files format
buffer = pypulceq.seq2buffer(seq, sys) # TOPPE binary format (i.e., for IOstream to scanner)

In addition, we provide a Command Line Interface for conversion of pre-generated .seq files:

seq2ge --output-name "myseq" --input-file "pypulseq_file.seq" --nviews NPHASEENC --nslices NSLICES

An in-browser executable example can be found in the examples folder. You can try it in Colab (use a GPU-enabled runtime for SigPy; not required in local installation): Open In Colab

Developers

Developers can install PyPulCeq in editable mode and include the additional dependencies (black, pytest):

pip install -e .[dev]

Tests can be executed from PyPulCeq root folder using pytest:

pytest .

Contributing

Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

License

pypulceq was created by Matteo Cencini. It is licensed under the terms of the MIT license.

Credits

pypulceq was created with cookiecutter and the py-pkgs-cookiecutter template. Code is based on the original MATLAB version from HarmonizedMRI.

About

Python tools to write Pulseq files for GEHC scanners (i.e., TOPPE interpreter).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages