ldrb


Nameldrb JSON
Version 2023.5.0 PyPI version JSON
download
home_pagehttps://github.com/finsberg/ldrb
SummaryLaplace-Dirichlet Rule-based algorithm for assigning myocardial fiber orientations.
upload_time2023-11-21 21:30:04
maintainer
docs_urlNone
authorHenrik Finsberg
requires_python>=3.8
licenseLGPL-3.0
keywords cardiac modeling fiber orientations
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![CI](https://github.com/finsberg/ldrb/actions/workflows/main.yml/badge.svg)](https://github.com/finsberg/ldrb/actions/workflows/main.yml)
[![github pages](https://github.com/finsberg/ldrb/actions/workflows/github-pages.yml/badge.svg)](https://github.com/finsberg/ldrb/actions/workflows/github-pages.yml)


# Laplace-Dirichlet Rule-Based (LDRB) algorithm for assigning myocardial fiber orientations


A software for assigning myocardial fiber orientations based on the Laplace Dirichlet Ruled-Based algorithm.

> Bayer, J.D., Blake, R.C., Plank, G. and Trayanova, N.A., 2012.
> A novel rule-based algorithm for assigning myocardial fiber orientation
>to computational heart models. Annals of biomedical engineering, 40(10),
pp.2243-2254.(https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3518842/)

```python
# Generate an example geometry using https://github.com/ComputationalPhysiology/cardiac_geometries
import cardiac_geometries  # pip install cardiac-geometries
import ldrb

geo = cardiac_geometries.mesh.create_biv_ellipsoid(char_length=0.2)

# Decide on the angles you want to use
angles = dict(
    alpha_endo_lv=30,  # Fiber angle on the LV endocardium
    alpha_epi_lv=-30,  # Fiber angle on the LV epicardium
    beta_endo_lv=0,  # Sheet angle on the LV endocardium
    beta_epi_lv=0,  # Sheet angle on the LV epicardium
    alpha_endo_sept=60,  # Fiber angle on the Septum endocardium
    alpha_epi_sept=-60,  # Fiber angle on the Septum epicardium
    beta_endo_sept=0,  # Sheet angle on the Septum endocardium
    beta_epi_sept=0,  # Sheet angle on the Septum epicardium
    alpha_endo_rv=80,  # Fiber angle on the RV endocardium
    alpha_epi_rv=-80,  # Fiber angle on the RV epicardium
    beta_endo_rv=0,  # Sheet angle on the RV endocardium
    beta_epi_rv=0,  # Sheet angle on the RV epicardium
)

# Convert markers to correct format
markers = {
    "base": geo.markers["BASE"][0],
    "lv": geo.markers["ENDO_LV"][0],
    "rv": geo.markers["ENDO_RV"][0],
    "epi": geo.markers["EPI"][0],
}

# Choose space for the fiber fields
# This is a string on the form {family}_{degree}
fiber_space = "P_2"

# Compute the microstructure
fiber, sheet, sheet_normal = ldrb.dolfin_ldrb(
    mesh=geo.mesh, fiber_space=fiber_space, ffun=geo.ffun, markers=markers, **angles
)
# Store files using a built in xdmf viewer that also works for functions
# defined in quadrature spaces
ldrb.fiber_to_xdmf(fiber, "fiber")
# And visualize it in Paraview
```

![_](https://github.com/finsberg/ldrb/raw/main/docs/_static/figures/biv_fiber.png)

# Installation

## pip
In order to install the software you need to have
installed [FEniCS](https://fenicsproject.org) (versions older than 2016
are not supported)

The package can be installed with pip.
```
python -m pip install ldrb
```
or if you need the most recent version you can install the source
```
python -m pip install git+https://github.com/finsberg/ldrb.git
```

## Conda
`ldrb` is also available on `conda`
```
conda install -c conda-forge ldrb
```

## Docker
If you don't already have FEniCS installed you can use one of the provided [docker images](https://github.com/finsberg/ldrb/pkgs/container/ldrb), e.g
```
docker pull ghcr.io/finsberg/ldrb:latest
```
to pull the image and use the following command to start a container and sharing your current directory
```
docker run --rm -v $PWD:/home/shared -w /home/shared -it ghcr.io/finsberg/ldrb:latest
```

# Documentation
Documentation is hosted at http://finsberg.github.io/ldrb

# Getting started
Check out the [demos](http://finsberg.github.io/ldrb/demo_lv.html)

# License
`ldrb` is licensed under the GNU LGPL, version 3 or (at your option) any later version.
`ldrb` is Copyright (2011-2019) by the authors and Simula Research Laboratory.

# Contributors
Henrik Finsberg (henriknf@simula.no)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/finsberg/ldrb",
    "name": "ldrb",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "cardiac modeling,fiber orientations",
    "author": "Henrik Finsberg",
    "author_email": "henriknf@simula.no",
    "download_url": "https://files.pythonhosted.org/packages/a9/03/484393ed8cc7e51d662d42cd935c2cf72a18192bccbdcd6e2d62cbfb6776/ldrb-2023.5.0.tar.gz",
    "platform": null,
    "description": "[![CI](https://github.com/finsberg/ldrb/actions/workflows/main.yml/badge.svg)](https://github.com/finsberg/ldrb/actions/workflows/main.yml)\n[![github pages](https://github.com/finsberg/ldrb/actions/workflows/github-pages.yml/badge.svg)](https://github.com/finsberg/ldrb/actions/workflows/github-pages.yml)\n\n\n# Laplace-Dirichlet Rule-Based (LDRB) algorithm for assigning myocardial fiber orientations\n\n\nA software for assigning myocardial fiber orientations based on the Laplace Dirichlet Ruled-Based algorithm.\n\n> Bayer, J.D., Blake, R.C., Plank, G. and Trayanova, N.A., 2012.\n> A novel rule-based algorithm for assigning myocardial fiber orientation\n>to computational heart models. Annals of biomedical engineering, 40(10),\npp.2243-2254.(https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3518842/)\n\n```python\n# Generate an example geometry using https://github.com/ComputationalPhysiology/cardiac_geometries\nimport cardiac_geometries  # pip install cardiac-geometries\nimport ldrb\n\ngeo = cardiac_geometries.mesh.create_biv_ellipsoid(char_length=0.2)\n\n# Decide on the angles you want to use\nangles = dict(\n    alpha_endo_lv=30,  # Fiber angle on the LV endocardium\n    alpha_epi_lv=-30,  # Fiber angle on the LV epicardium\n    beta_endo_lv=0,  # Sheet angle on the LV endocardium\n    beta_epi_lv=0,  # Sheet angle on the LV epicardium\n    alpha_endo_sept=60,  # Fiber angle on the Septum endocardium\n    alpha_epi_sept=-60,  # Fiber angle on the Septum epicardium\n    beta_endo_sept=0,  # Sheet angle on the Septum endocardium\n    beta_epi_sept=0,  # Sheet angle on the Septum epicardium\n    alpha_endo_rv=80,  # Fiber angle on the RV endocardium\n    alpha_epi_rv=-80,  # Fiber angle on the RV epicardium\n    beta_endo_rv=0,  # Sheet angle on the RV endocardium\n    beta_epi_rv=0,  # Sheet angle on the RV epicardium\n)\n\n# Convert markers to correct format\nmarkers = {\n    \"base\": geo.markers[\"BASE\"][0],\n    \"lv\": geo.markers[\"ENDO_LV\"][0],\n    \"rv\": geo.markers[\"ENDO_RV\"][0],\n    \"epi\": geo.markers[\"EPI\"][0],\n}\n\n# Choose space for the fiber fields\n# This is a string on the form {family}_{degree}\nfiber_space = \"P_2\"\n\n# Compute the microstructure\nfiber, sheet, sheet_normal = ldrb.dolfin_ldrb(\n    mesh=geo.mesh, fiber_space=fiber_space, ffun=geo.ffun, markers=markers, **angles\n)\n# Store files using a built in xdmf viewer that also works for functions\n# defined in quadrature spaces\nldrb.fiber_to_xdmf(fiber, \"fiber\")\n# And visualize it in Paraview\n```\n\n![_](https://github.com/finsberg/ldrb/raw/main/docs/_static/figures/biv_fiber.png)\n\n# Installation\n\n## pip\nIn order to install the software you need to have\ninstalled [FEniCS](https://fenicsproject.org) (versions older than 2016\nare not supported)\n\nThe package can be installed with pip.\n```\npython -m pip install ldrb\n```\nor if you need the most recent version you can install the source\n```\npython -m pip install git+https://github.com/finsberg/ldrb.git\n```\n\n## Conda\n`ldrb` is also available on `conda`\n```\nconda install -c conda-forge ldrb\n```\n\n## Docker\nIf you don't already have FEniCS installed you can use one of the provided [docker images](https://github.com/finsberg/ldrb/pkgs/container/ldrb), e.g\n```\ndocker pull ghcr.io/finsberg/ldrb:latest\n```\nto pull the image and use the following command to start a container and sharing your current directory\n```\ndocker run --rm -v $PWD:/home/shared -w /home/shared -it ghcr.io/finsberg/ldrb:latest\n```\n\n# Documentation\nDocumentation is hosted at http://finsberg.github.io/ldrb\n\n# Getting started\nCheck out the [demos](http://finsberg.github.io/ldrb/demo_lv.html)\n\n# License\n`ldrb` is licensed under the GNU LGPL, version 3 or (at your option) any later version.\n`ldrb` is Copyright (2011-2019) by the authors and Simula Research Laboratory.\n\n# Contributors\nHenrik Finsberg (henriknf@simula.no)\n",
    "bugtrack_url": null,
    "license": "LGPL-3.0",
    "summary": "Laplace-Dirichlet Rule-based algorithm for assigning myocardial fiber orientations.",
    "version": "2023.5.0",
    "project_urls": {
        "Homepage": "https://github.com/finsberg/ldrb"
    },
    "split_keywords": [
        "cardiac modeling",
        "fiber orientations"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "70f05820e78f9c31b7315eebae93fd690b40012050cef7c930d7e8d4f1abb7b2",
                "md5": "e22acb504579889a084ae039209e56b0",
                "sha256": "e612d57484f59ea9c4730354cba656d4c124f8e794802877a30da99d4dc6b112"
            },
            "downloads": -1,
            "filename": "ldrb-2023.5.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e22acb504579889a084ae039209e56b0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 19717,
            "upload_time": "2023-11-21T21:30:02",
            "upload_time_iso_8601": "2023-11-21T21:30:02.218714Z",
            "url": "https://files.pythonhosted.org/packages/70/f0/5820e78f9c31b7315eebae93fd690b40012050cef7c930d7e8d4f1abb7b2/ldrb-2023.5.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a903484393ed8cc7e51d662d42cd935c2cf72a18192bccbdcd6e2d62cbfb6776",
                "md5": "5762b5688096da63b3f66a22418826f2",
                "sha256": "456420da56eb43ca2537742662aab55346e58734ab6e006484ae2fcc96413118"
            },
            "downloads": -1,
            "filename": "ldrb-2023.5.0.tar.gz",
            "has_sig": false,
            "md5_digest": "5762b5688096da63b3f66a22418826f2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 22396,
            "upload_time": "2023-11-21T21:30:04",
            "upload_time_iso_8601": "2023-11-21T21:30:04.577998Z",
            "url": "https://files.pythonhosted.org/packages/a9/03/484393ed8cc7e51d662d42cd935c2cf72a18192bccbdcd6e2d62cbfb6776/ldrb-2023.5.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-21 21:30:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "finsberg",
    "github_project": "ldrb",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "ldrb"
}
        
Elapsed time: 0.14651s