pulseclient


Namepulseclient JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/INFN-MRI/pulseclient
SummaryA Python client for communication between Pulseq interpreter and Pulseq design server.
upload_time2024-10-06 01:01:44
maintainerNone
docs_urlNone
authorMatteo Cencini
requires_python>=2.6
licenseNone
keywords pulseq mri sequence-design pulse-sequences mri-sequences
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
PulseClient
===========

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.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/INFN-MRI/pulseclient",
    "name": "pulseclient",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=2.6",
    "maintainer_email": null,
    "keywords": "pulseq, mri, sequence-design, pulse-sequences, mri-sequences",
    "author": "Matteo Cencini",
    "author_email": "Matteo Cencini <matteo.cencini@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/70/f8/b394cbc937dde79215b55bc2de59df51e00f950f0fb05bff8665f2d3e9f4/pulseclient-0.1.0.tar.gz",
    "platform": null,
    "description": "\nPulseClient\n===========\n\nPulseClient is a Python library designed to facilitate the communication between an Pulseq interpreter process running\non a MRI scanner and an external Pulseq sequence design server. \n\nIt 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. \n\nFeatures\n--------\n- Checks if a remote Pulseq design server process is running.\n- Starts the Pulseq design server on a remote machine via SSH if it is not running.\n- Monitors the creation of a sequence parameters (e.g., FOV, matrix size, etc) by the Pulseq interpreter and sends it to a designated server.\n- Configuration management through a `.ini` file for easy customization.\n- Fallback to default values if no configuration file is found.\n\nInstallation\n------------\nPulseClient can be installed via pip::\n\n  pip install pulseclient\n\nAs an alternative, you can incorporate this library in your Pulseq interpreter code as::\n\n  git submodule add -b plugin https://github.com/INFN-MRI/pulseclient.git bin\n\nDevelopment\n-----------\nIf you want to modifiy the PulseClient code base::\n\n  git clone https://github.com/INFN-MRI/pulseclient.git\n  pip install -e ./pulseclient\n\nConfiguration\n-------------\nPulseClient uses a configuration file named ``pulseclient.ini``. You can specify the location of this file using the ``PULSECLIENT_CONFIG`` environment variable. \nIf not set, the library will search for the configuration file in the default location::\n\n  /srv/psd/usr/psd/pulseq/config/pulseclient.ini\n\nThe configuration file should contain the following sections::\n\n  [settings]\n  SERVER_IP = 192.168.1.100\n  SERVER_PORT = 8000\n  CHECK_INTERVAL = 0.1\n  REMOTE_SERVER_USER = user\n  REMOTE_SERVER_HOST = remote-server-address.com\n  REMOTE_SERVER_COMMAND = external_server.py &\n  SERVER_PROCESS_NAME = external_server.py\n  file_path_simulation = /path/to/simulation/params.dat\n  file_path_hardware = /path/to/production/params.dat\n\n\nwhere ``file_path_simulation`` and ``file_path_hardware`` are the path to the `params.dat` file created\nby the Pulseq interpreter either in simulation or actual hardware execution, which can be toggled at runtime\nby the Pulseq interpreter itself.\n\nUsage\n-----\nYou can run the PulseClient from the command line, providing a simulation flag (``0`` for hardware, ``1`` for simulation, default is ``1``)::\n\n  start_client.py [simulate]\n\nReplace ``[simulate]`` with ``1`` for simulation or `0` for hardware mode.\n\nTesting\n-------\nTo run the tests, execute the following command in the terminal::\n\n   python -m unittest discover -s tests\n\nLicense\n-------\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE.txt) file for details.\n\nContributing\n------------\nContributions are welcome! Please fork the repository and submit a pull request.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A Python client for communication between Pulseq interpreter and Pulseq design server.",
    "version": "0.1.0",
    "project_urls": {
        "Bug Reports": "https://github.com/INFN-MRI/pulseclient/issues",
        "Homepage": "https://github.com/INFN-MRI/pulseclient",
        "Source": "https://github.com/INFN-MRI/pulseclient"
    },
    "split_keywords": [
        "pulseq",
        " mri",
        " sequence-design",
        " pulse-sequences",
        " mri-sequences"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "523bd49913827eb42a6cf0e11309461a4fad0e8be585a2131730f20455153d37",
                "md5": "6dbdf63079c73eb654d1ec20d6a95b8d",
                "sha256": "6cab752c18e1c99c38abe7c5d11d6854c5081fa136dc33fbdf0c2420058d064d"
            },
            "downloads": -1,
            "filename": "pulseclient-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6dbdf63079c73eb654d1ec20d6a95b8d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=2.6",
            "size": 6921,
            "upload_time": "2024-10-06T01:01:43",
            "upload_time_iso_8601": "2024-10-06T01:01:43.081914Z",
            "url": "https://files.pythonhosted.org/packages/52/3b/d49913827eb42a6cf0e11309461a4fad0e8be585a2131730f20455153d37/pulseclient-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "70f8b394cbc937dde79215b55bc2de59df51e00f950f0fb05bff8665f2d3e9f4",
                "md5": "8244cae9afe90cec146cf1054b66bcfb",
                "sha256": "688a7cff174ce612e1617acc6eb52ba1b690e0eb3abeffe5069b25dfe5bd9a1b"
            },
            "downloads": -1,
            "filename": "pulseclient-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "8244cae9afe90cec146cf1054b66bcfb",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=2.6",
            "size": 8891,
            "upload_time": "2024-10-06T01:01:44",
            "upload_time_iso_8601": "2024-10-06T01:01:44.240913Z",
            "url": "https://files.pythonhosted.org/packages/70/f8/b394cbc937dde79215b55bc2de59df51e00f950f0fb05bff8665f2d3e9f4/pulseclient-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-06 01:01:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "INFN-MRI",
    "github_project": "pulseclient",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pulseclient"
}
        
Elapsed time: 0.38234s