mrtwin


Namemrtwin JSON
Version 0.1.3 PyPI version JSON
download
home_pageNone
SummaryCollection of virtual objects for numerical MR experiments.
upload_time2024-09-12 09:08:01
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords brainweb mri download data
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            MRTwin
======

MRTwin is a collection of virtual objects for numerical MR experiments.

|Coverage| |CI| |CD| |License| |Codefactor| |Sphinx| |PyPi| |Black| |PythonVersion|

.. |Coverage| image:: https://infn-mri.github.io/mrtwin/_static/coverage_badge.svg
   :target: https://infn-mri.github.io/mrtwin

.. |CI| image:: https://github.com/INFN-MRI/mrtwin/workflows/CI/badge.svg
   :target: https://github.com/INFN-MRI/mrtwin

.. |CD| image:: https://github.com/INFN-MRI/mrtwin/workflows/CD/badge.svg
   :target: https://github.com/INFN-MRI/mrtwin

.. |License| image:: https://img.shields.io/github/license/INFN-MRI/mrtwin
   :target: https://github.com/INFN-MRI/mrtwin/blob/main/LICENSE.txt

.. |Codefactor| image:: https://www.codefactor.io/repository/github/INFN-MRI/mrtwin/badge
   :target: https://www.codefactor.io/repository/github/INFN-MRI/mrtwin

.. |Sphinx| image:: https://img.shields.io/badge/docs-Sphinx-blue
   :target: https://infn-mri.github.io/mrtwin

.. |PyPi| image:: https://img.shields.io/pypi/v/mrtwin
   :target: https://pypi.org/project/mrtwin

.. |Black| image:: https://img.shields.io/badge/style-black-black

.. |PythonVersion| image:: https://img.shields.io/badge/Python-%3E=3.10-blue?logo=python&logoColor=white
   :target: https://python.org

Features
--------

- **Virtual Phantoms:** A collection of sparse (fuzzy and crisp) and dense phantoms for quantitative MRI based on different anatomical models (Shepp-Logan, Brainweb database, Open Science CBS Neuroimaging Repository database) and different tissue representations (single pool, two- and three-pools).
- **Field Maps:** Routines for generation of realistic field maps, including B0 (based on input phantom susceptibility), B1 (including multiple RF modes) and coil sensitivities.
- **Motion patterns:** Markov chain generated rigid motion patterns (both for 2D and 3D imaging) to simulate the effect of motion on MR image quality.
- **Gradient System Response:** Generate Gaussian-shaped gradient response function with linear phase components to simulate k-space trajectory shift and deformation due to non-ideal gradient systems.

Installation
------------

MRTwin can be installed via pip as:

.. code-block:: bash

    pip install mrtwin

Basic Usage
-----------

Using MRTwin, we can quickly create a Shepp-Logan phantom,
the corresponding static field inhomogeneity map and a set 
of coil sensitivity maps as follows

.. code-block:: python

    import mrtwin

    # 2D Shepp-Logan phantom
    phantom = mrtwin.shepplogan_phantom(ndim=2, shape=256).as_numeric()

    # B0 map
    b0_map = mrtwin.b0field(phantom.Chi)

    # Coil sensitivity maps
    smaps = mrtwin.sensmap(shape=(8, 256, 256))

This allow us to quickly simulate, e.g., a fully-sampled multi-coil Cartesian GRE experiment
as:

.. code-block:: python

    import numpy as np 

    TE = 10.0 # ms
    rate_map = 1e3 / phantom.T2s + 1j * 2 * np.pi * b0_map
    gre = smaps * phantom.M0 * np.exp(-rate_map * TE * 1e-3)

This can be coupled with other libraries (e.g., `MRI-NUFFT <https://github.com/mind-inria/mri-nufft>`_)
to simulate more complex MR sequences (e.g., Non-Cartesian and sub-Nyquist imaging).



Development
~~~~~~~~~~~

If you are interested in improving this project, install MRTwin in editable mode:

.. code-block:: bash

    git clone git@github.com:INFN-MRI/mrtwin
    cd mrtwin
    pip install -e .[dev,test,doc]


Related projects
----------------

This package is inspired by the following excellent projects:

- Brainweb-dl <http://github.com/paquiteau/brainweb-dl>
- Phantominator <https://github.com/mckib2/phantominator>
- SigPy <https://github.com/mikgroup/sigpy>


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "mrtwin",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "brainweb, mri, download, data",
    "author": null,
    "author_email": "Matteo Cencini <matteo.cencini@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/90/da/6708a1c3aa2a8d72e37c88de33a6583f74333b1ad585945d3aa046e2b2bd/mrtwin-0.1.3.tar.gz",
    "platform": null,
    "description": "MRTwin\n======\n\nMRTwin is a collection of virtual objects for numerical MR experiments.\n\n|Coverage| |CI| |CD| |License| |Codefactor| |Sphinx| |PyPi| |Black| |PythonVersion|\n\n.. |Coverage| image:: https://infn-mri.github.io/mrtwin/_static/coverage_badge.svg\n   :target: https://infn-mri.github.io/mrtwin\n\n.. |CI| image:: https://github.com/INFN-MRI/mrtwin/workflows/CI/badge.svg\n   :target: https://github.com/INFN-MRI/mrtwin\n\n.. |CD| image:: https://github.com/INFN-MRI/mrtwin/workflows/CD/badge.svg\n   :target: https://github.com/INFN-MRI/mrtwin\n\n.. |License| image:: https://img.shields.io/github/license/INFN-MRI/mrtwin\n   :target: https://github.com/INFN-MRI/mrtwin/blob/main/LICENSE.txt\n\n.. |Codefactor| image:: https://www.codefactor.io/repository/github/INFN-MRI/mrtwin/badge\n   :target: https://www.codefactor.io/repository/github/INFN-MRI/mrtwin\n\n.. |Sphinx| image:: https://img.shields.io/badge/docs-Sphinx-blue\n   :target: https://infn-mri.github.io/mrtwin\n\n.. |PyPi| image:: https://img.shields.io/pypi/v/mrtwin\n   :target: https://pypi.org/project/mrtwin\n\n.. |Black| image:: https://img.shields.io/badge/style-black-black\n\n.. |PythonVersion| image:: https://img.shields.io/badge/Python-%3E=3.10-blue?logo=python&logoColor=white\n   :target: https://python.org\n\nFeatures\n--------\n\n- **Virtual Phantoms:** A collection of sparse (fuzzy and crisp) and dense phantoms for quantitative MRI based on different anatomical models (Shepp-Logan, Brainweb database, Open Science CBS Neuroimaging Repository database) and different tissue representations (single pool, two- and three-pools).\n- **Field Maps:** Routines for generation of realistic field maps, including B0 (based on input phantom susceptibility), B1 (including multiple RF modes) and coil sensitivities.\n- **Motion patterns:** Markov chain generated rigid motion patterns (both for 2D and 3D imaging) to simulate the effect of motion on MR image quality.\n- **Gradient System Response:** Generate Gaussian-shaped gradient response function with linear phase components to simulate k-space trajectory shift and deformation due to non-ideal gradient systems.\n\nInstallation\n------------\n\nMRTwin can be installed via pip as:\n\n.. code-block:: bash\n\n    pip install mrtwin\n\nBasic Usage\n-----------\n\nUsing MRTwin, we can quickly create a Shepp-Logan phantom,\nthe corresponding static field inhomogeneity map and a set \nof coil sensitivity maps as follows\n\n.. code-block:: python\n\n    import mrtwin\n\n    # 2D Shepp-Logan phantom\n    phantom = mrtwin.shepplogan_phantom(ndim=2, shape=256).as_numeric()\n\n    # B0 map\n    b0_map = mrtwin.b0field(phantom.Chi)\n\n    # Coil sensitivity maps\n    smaps = mrtwin.sensmap(shape=(8, 256, 256))\n\nThis allow us to quickly simulate, e.g., a fully-sampled multi-coil Cartesian GRE experiment\nas:\n\n.. code-block:: python\n\n    import numpy as np \n\n    TE = 10.0 # ms\n    rate_map = 1e3 / phantom.T2s + 1j * 2 * np.pi * b0_map\n    gre = smaps * phantom.M0 * np.exp(-rate_map * TE * 1e-3)\n\nThis can be coupled with other libraries (e.g., `MRI-NUFFT <https://github.com/mind-inria/mri-nufft>`_)\nto simulate more complex MR sequences (e.g., Non-Cartesian and sub-Nyquist imaging).\n\n\n\nDevelopment\n~~~~~~~~~~~\n\nIf you are interested in improving this project, install MRTwin in editable mode:\n\n.. code-block:: bash\n\n    git clone git@github.com:INFN-MRI/mrtwin\n    cd mrtwin\n    pip install -e .[dev,test,doc]\n\n\nRelated projects\n----------------\n\nThis package is inspired by the following excellent projects:\n\n- Brainweb-dl <http://github.com/paquiteau/brainweb-dl>\n- Phantominator <https://github.com/mckib2/phantominator>\n- SigPy <https://github.com/mikgroup/sigpy>\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Collection of virtual objects for numerical MR experiments.",
    "version": "0.1.3",
    "project_urls": {
        "Bug Reports": "https://github.com/INFN-MRI/mrtwin/issues",
        "Homepage": "https://github.com/INFN-MRI/mrtwin",
        "Source": "https://github.com/INFN-MRI/mrtwin"
    },
    "split_keywords": [
        "brainweb",
        " mri",
        " download",
        " data"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "922503e0328c5190c60decf19a0818afcf8bee1be49c67c4b0c6867e1137861c",
                "md5": "5a2436e10ec4a27abb2a8d887f1e441b",
                "sha256": "55a0e786621562e54826de76e40c1d12f9926a0f82a0f0af28092b5db72ff120"
            },
            "downloads": -1,
            "filename": "mrtwin-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5a2436e10ec4a27abb2a8d887f1e441b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 49798,
            "upload_time": "2024-09-12T09:07:59",
            "upload_time_iso_8601": "2024-09-12T09:07:59.541142Z",
            "url": "https://files.pythonhosted.org/packages/92/25/03e0328c5190c60decf19a0818afcf8bee1be49c67c4b0c6867e1137861c/mrtwin-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "90da6708a1c3aa2a8d72e37c88de33a6583f74333b1ad585945d3aa046e2b2bd",
                "md5": "6bd898405ab499b5715014666d1db715",
                "sha256": "b1ced4c16589dd350cc959ef619ddb3ffba1b28ad56f743cdf4be1b998bcfaae"
            },
            "downloads": -1,
            "filename": "mrtwin-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "6bd898405ab499b5715014666d1db715",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 60815,
            "upload_time": "2024-09-12T09:08:01",
            "upload_time_iso_8601": "2024-09-12T09:08:01.667605Z",
            "url": "https://files.pythonhosted.org/packages/90/da/6708a1c3aa2a8d72e37c88de33a6583f74333b1ad585945d3aa046e2b2bd/mrtwin-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-12 09:08:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "INFN-MRI",
    "github_project": "mrtwin",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "mrtwin"
}
        
Elapsed time: 0.30803s