Skip to main content

A Python client for communication between Pulseq interpreter and Pulseq design server.

Project description

PulseClient is a Python library designed to facilitate the communication between an Pulseq interpreter process running on a MRI scanner and an external Pulseq sequence design server.

It provides functionality to check if a remote Pulseq design server is running, start the server if it isn’t, and monitor sequence parameter files for transfer readiness.

Features

  • Checks if a remote Pulseq design server process is running.

  • Starts the Pulseq design server on a remote machine via SSH if it is not running.

  • Monitors the creation of a sequence parameters (e.g., FOV, matrix size, etc) by the Pulseq interpreter and sends it to a designated server.

  • Configuration management through a .ini file for easy customization.

  • Fallback to default values if no configuration file is found.

Installation

PulseClient can be installed via pip:

pip install pulseclient

As an alternative, you can incorporate this library in your Pulseq interpreter code as:

git submodule add -b plugin https://github.com/INFN-MRI/pulseclient.git bin

Development

If you want to modifiy the PulseClient code base:

git clone https://github.com/INFN-MRI/pulseclient.git
pip install -e ./pulseclient

Configuration

PulseClient uses a configuration file named pulseclient.ini. You can specify the location of this file using the PULSECLIENT_CONFIG environment variable. If not set, the library will search for the configuration file in the default location:

/srv/psd/usr/psd/pulseq/config/pulseclient.ini

The configuration file should contain the following sections:

[settings]
SERVER_IP = 192.168.1.100
SERVER_PORT = 8000
CHECK_INTERVAL = 0.1
REMOTE_SERVER_USER = user
REMOTE_SERVER_HOST = remote-server-address.com
REMOTE_SERVER_COMMAND = external_server.py &
SERVER_PROCESS_NAME = external_server.py
file_path_simulation = /path/to/simulation/params.dat
file_path_hardware = /path/to/production/params.dat

where file_path_simulation and file_path_hardware are the path to the params.dat file created by the Pulseq interpreter either in simulation or actual hardware execution, which can be toggled at runtime by the Pulseq interpreter itself.

Usage

You can run the PulseClient from the command line, providing a simulation flag (0 for hardware, 1 for simulation, default is 1):

start_client.py [simulate]

Replace [simulate] with 1 for simulation or 0 for hardware mode.

Testing

To run the tests, execute the following command in the terminal:

python -m unittest discover -s tests

License

This project is licensed under the MIT License - see the [LICENSE](LICENSE.txt) file for details.

Contributing

Contributions are welcome! Please fork the repository and submit a pull request.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pulseclient-0.1.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

pulseclient-0.1.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file pulseclient-0.1.0.tar.gz.

File metadata

  • Download URL: pulseclient-0.1.0.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pulseclient-0.1.0.tar.gz
Algorithm Hash digest
SHA256 688a7cff174ce612e1617acc6eb52ba1b690e0eb3abeffe5069b25dfe5bd9a1b
MD5 8244cae9afe90cec146cf1054b66bcfb
BLAKE2b-256 70f8b394cbc937dde79215b55bc2de59df51e00f950f0fb05bff8665f2d3e9f4

See more details on using hashes here.

File details

Details for the file pulseclient-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pulseclient-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pulseclient-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6cab752c18e1c99c38abe7c5d11d6854c5081fa136dc33fbdf0c2420058d064d
MD5 6dbdf63079c73eb654d1ec20d6a95b8d
BLAKE2b-256 523bd49913827eb42a6cf0e11309461a4fad0e8be585a2131730f20455153d37

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page