Python tools to write Pulseq files for GEHC scanners (i.e., TOPPE interpreter).
The PyPulCeq
package can be installed from source using pip:
- Clone the repo
git clone git@github.com:INFN-PREDATOR/pypulceq.git
- Navigate to the repository root folder and install using pip:
pip install .
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):
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 .
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.
pypulceq
was created by Matteo Cencini. It is licensed under the terms of the MIT license.
pypulceq
was created with cookiecutter
and the py-pkgs-cookiecutter
template. Code is based on the original MATLAB version from HarmonizedMRI.