dsv2pulseq


Namedsv2pulseq JSON
Version 0.1.1 PyPI version JSON
download
home_pageNone
SummaryCreate Pulseq sequences from dsv.
upload_time2025-07-08 13:43:24
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseMIT License
keywords pulseq dsv siemens mri
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # dsv2pulseq

Create Pulseq sequence files from Siemens dsv simulation files. The converter was only tested with VE/VX dsv file layouts.
VB/VD files are not supported, as the simulator can not output RF phase data.  
RF values might be differing slightly compared to the original sequence, as the dsv files contain RF values only on a 5us raster.

## Installation

The package can be install with `pip install dsv2pulseq`.

Alternatively, a Python environment with the package installed can be created with the provided yml file: `conda env create -f dsv2pulseq.yml`.

Unittests can be run with `python -m unittest discover test/`. This includes testing, whether the conversion is successful for each dsv dataset in the folder "test/test_data".

This package only depends on numpy and PyPulseq [1].

Merging data to the original Siemens raw data file for retrospective reconstruction (see "Reconstruction of Pulseq data") requires the twixtools package (https://github.com/pehses/twixtools).

## Sequence simulation

Simulate the sequence with the following settings:  
- Transversal orientation with phase-encode direction A->P and no FOV shift (which is the default)
- Simulate with RF phase output (sim /RFP+). 
- Mandatory dsv files are "_INF", "_RFD", "_RFP", "_GRX", "_GRY" and "_GRZ".

Example data "MiniFLASH.dsv" can be found in the test/test_data folder. These simulation files are from the Siemens MiniFLASH demo sequence.

## Create Pulseq output

The conversion can be started by running:  
```
dsv_to_pulseq -o OUT_FILE -r REF_VOLT IN_FILE_PREFIX
```
from the shell.

The IN_FILE_PREFIX is the prefix of the dsv files, e.g. "gre" for "gre_XXX.dsv". The OUT_FILE is the Pulseq output sequence file (default: "external.seq"). The reference voltage is the voltage the sequence was simulated with (Siemens default: 223.529007 V).

The conversion can also be done in Python by running:
```
from dsv2pulseq import read_dsv
seq = read_dsv('/path/to/dsv/dsv_prefix')
seq_pulseq = seq.make_pulseq_sequence('external.seq')
```

There is an experimental function to check the shapes of RF waveforms and gradients that plots the difference between the original and converted waveforms:
```
from dsv2pulseq import check_dsv
check_dsv('/path_to_dsv/dsv_prefix_original', 'path_to_dsv/dsv_prefix_pulseq')
```

Note that:  
- Only single transmit channel RF pulses are currently supported.
- The Pulseq sequence has the same orientation as the original sequence in the physical/scanner coordinate system, when running the Pulseq interpreter in "XYZ in TRA" mode.
- The Pulseq interpreter version 1.5.0 should be used, as the versions before contain a bug in setting the RF raster time correctly. 
- RF and gradient waveforms might be slightly different compared to the original sequence due to limited numerical accuracy of the DSV files.
- RF pulse values are on a 5us raster in the dsv files, which might be insufficient for pulses with rapidly varying phase

## Reconstruction of Pulseq data

Data acquired with the converted Pulseq sequence cannot be easily reconstructed, as the scan headers containing the meta information are missing.
The data from the Pulseq sequence (IN_FILE_2) can be inserted into a raw data file acquired with the original sequence (IN_FILE_1) using twixtools (see dependencies). If twixtools is installed, the following command will insert the data:
```
insert_twix_data IN_FILE_1 IN_FILE_2 -o OUT_FILE
```
The merged output file (OUT_FILE) can be used for rectrospective reconstruction at the scanner. Alternatively the Pulseq data file can also be in the MRD format (requires ISMRMRD python package)

## References

[1] Ravi, Keerthi, Sairam Geethanath, and John Vaughan. "PyPulseq: A Python Package for MRI Pulse Sequence Design." Journal of Open Source Software 4.42 (2019): 1725., https://github.com/imr-framework/pypulseq

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "dsv2pulseq",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "pulseq, dsv, siemens, mri",
    "author": null,
    "author_email": "Marten Veldmann <marten.veldmann@dzne.de>",
    "download_url": "https://files.pythonhosted.org/packages/f3/80/b3032f62c3f492be76c11e0a4885b716bf2672b7ec1192919933e9fdcf80/dsv2pulseq-0.1.1.tar.gz",
    "platform": null,
    "description": "# dsv2pulseq\n\nCreate Pulseq sequence files from Siemens dsv simulation files. The converter was only tested with VE/VX dsv file layouts.\nVB/VD files are not supported, as the simulator can not output RF phase data.  \nRF values might be differing slightly compared to the original sequence, as the dsv files contain RF values only on a 5us raster.\n\n## Installation\n\nThe package can be install with `pip install dsv2pulseq`.\n\nAlternatively, a Python environment with the package installed can be created with the provided yml file: `conda env create -f dsv2pulseq.yml`.\n\nUnittests can be run with `python -m unittest discover test/`. This includes testing, whether the conversion is successful for each dsv dataset in the folder \"test/test_data\".\n\nThis package only depends on numpy and PyPulseq [1].\n\nMerging data to the original Siemens raw data file for retrospective reconstruction (see \"Reconstruction of Pulseq data\") requires the twixtools package (https://github.com/pehses/twixtools).\n\n## Sequence simulation\n\nSimulate the sequence with the following settings:  \n- Transversal orientation with phase-encode direction A->P and no FOV shift (which is the default)\n- Simulate with RF phase output (sim /RFP+). \n- Mandatory dsv files are \"_INF\", \"_RFD\", \"_RFP\", \"_GRX\", \"_GRY\" and \"_GRZ\".\n\nExample data \"MiniFLASH.dsv\" can be found in the test/test_data folder. These simulation files are from the Siemens MiniFLASH demo sequence.\n\n## Create Pulseq output\n\nThe conversion can be started by running:  \n```\ndsv_to_pulseq -o OUT_FILE -r REF_VOLT IN_FILE_PREFIX\n```\nfrom the shell.\n\nThe IN_FILE_PREFIX is the prefix of the dsv files, e.g. \"gre\" for \"gre_XXX.dsv\". The OUT_FILE is the Pulseq output sequence file (default: \"external.seq\"). The reference voltage is the voltage the sequence was simulated with (Siemens default: 223.529007 V).\n\nThe conversion can also be done in Python by running:\n```\nfrom dsv2pulseq import read_dsv\nseq = read_dsv('/path/to/dsv/dsv_prefix')\nseq_pulseq = seq.make_pulseq_sequence('external.seq')\n```\n\nThere is an experimental function to check the shapes of RF waveforms and gradients that plots the difference between the original and converted waveforms:\n```\nfrom dsv2pulseq import check_dsv\ncheck_dsv('/path_to_dsv/dsv_prefix_original', 'path_to_dsv/dsv_prefix_pulseq')\n```\n\nNote that:  \n- Only single transmit channel RF pulses are currently supported.\n- The Pulseq sequence has the same orientation as the original sequence in the physical/scanner coordinate system, when running the Pulseq interpreter in \"XYZ in TRA\" mode.\n- The Pulseq interpreter version 1.5.0 should be used, as the versions before contain a bug in setting the RF raster time correctly. \n- RF and gradient waveforms might be slightly different compared to the original sequence due to limited numerical accuracy of the DSV files.\n- RF pulse values are on a 5us raster in the dsv files, which might be insufficient for pulses with rapidly varying phase\n\n## Reconstruction of Pulseq data\n\nData acquired with the converted Pulseq sequence cannot be easily reconstructed, as the scan headers containing the meta information are missing.\nThe data from the Pulseq sequence (IN_FILE_2) can be inserted into a raw data file acquired with the original sequence (IN_FILE_1) using twixtools (see dependencies). If twixtools is installed, the following command will insert the data:\n```\ninsert_twix_data IN_FILE_1 IN_FILE_2 -o OUT_FILE\n```\nThe merged output file (OUT_FILE) can be used for rectrospective reconstruction at the scanner. Alternatively the Pulseq data file can also be in the MRD format (requires ISMRMRD python package)\n\n## References\n\n[1] Ravi, Keerthi, Sairam Geethanath, and John Vaughan. \"PyPulseq: A Python Package for MRI Pulse Sequence Design.\" Journal of Open Source Software 4.42 (2019): 1725., https://github.com/imr-framework/pypulseq\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Create Pulseq sequences from dsv.",
    "version": "0.1.1",
    "project_urls": {
        "Homepage": "https://github.com/mavel101/dsv2pulseq"
    },
    "split_keywords": [
        "pulseq",
        " dsv",
        " siemens",
        " mri"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "3b8d5a59d59e9c4e9d8a910dc89c5ca95a151fe8c08747b282117af7708b9df7",
                "md5": "cf22b49c5e985fee4795d19e6b6b58b4",
                "sha256": "5c4ba84d5d84c2d787b3ff3bb95d0b50bec45d0da2c516a11670bab216891c21"
            },
            "downloads": -1,
            "filename": "dsv2pulseq-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cf22b49c5e985fee4795d19e6b6b58b4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 17977,
            "upload_time": "2025-07-08T13:43:22",
            "upload_time_iso_8601": "2025-07-08T13:43:22.746324Z",
            "url": "https://files.pythonhosted.org/packages/3b/8d/5a59d59e9c4e9d8a910dc89c5ca95a151fe8c08747b282117af7708b9df7/dsv2pulseq-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "f380b3032f62c3f492be76c11e0a4885b716bf2672b7ec1192919933e9fdcf80",
                "md5": "a5ec180bb698bddc81f7b777eb5f9251",
                "sha256": "3371891fdbc0251017b9fcbf6ab1155dbaa6ddace118407ca0c2be0cc2103a72"
            },
            "downloads": -1,
            "filename": "dsv2pulseq-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "a5ec180bb698bddc81f7b777eb5f9251",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 473302,
            "upload_time": "2025-07-08T13:43:24",
            "upload_time_iso_8601": "2025-07-08T13:43:24.204837Z",
            "url": "https://files.pythonhosted.org/packages/f3/80/b3032f62c3f492be76c11e0a4885b716bf2672b7ec1192919933e9fdcf80/dsv2pulseq-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-08 13:43:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mavel101",
    "github_project": "dsv2pulseq",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "dsv2pulseq"
}
        
Elapsed time: 0.42006s