Skip to main content

Create a fractal tree over a surface discretized by triangles

Project description

fractal-tree

This code is to create a fractal tree over a surface discretized by triangles. It was developed to create a representation of the Purkinje network in the ventricles of the human heart.

Note that this is a rewrite of the original code found at https://github.com/fsahli/fractal-tree

The details of the algorithm are presented in this article. If you are going to use this code, please cite:

Generating Purkinje networks in the human heart. F. Sahli Costabal, D. Hurtado and E. Kuhl. Journal of Biomechanics, doi:10.1016/j.jbiomech.2015.12.025

Install

You can install the library with pip

python3 -m pip install fractal-tree

Note that you also need a way to load the mesh from e.g gmsh or another meshing tool. For this we recommend to use meshio as it support the most common formats.

Getting started

The following illustrates a minimal example, assuming that you have surface mesh called sphere.obj in your current directory.

import meshio
import numpy as np
from fractal_tree import generate_fractal_tree, FractalTreeParameters, Mesh

msh = meshio.read("sphere.obj")
mesh = Mesh(verts=msh.points, connectivity=msh.cells[0].data)
param = FractalTreeParameters(
    filename="sphere-line",
    N_it=10,
)
results = generate_fractal_tree(mesh, param)

For a more elaborate example you can checkout the gmsh example.

License

MIT

Need help or having issues

Please submit an issue

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

fractal-tree-0.2.1.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

fractal_tree-0.2.1-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file fractal-tree-0.2.1.tar.gz.

File metadata

  • Download URL: fractal-tree-0.2.1.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for fractal-tree-0.2.1.tar.gz
Algorithm Hash digest
SHA256 b8a2ae1aca1aa7d0d6551536bf1da4d441e35b80f3e3128458012be5fff01d65
MD5 73418834ede2b5559a6cf7f9798924e5
BLAKE2b-256 624b55610c83d29a618793cc39419081e496a19d3db0a5b90fa7f6223d174144

See more details on using hashes here.

File details

Details for the file fractal_tree-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: fractal_tree-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for fractal_tree-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 80f018211d2c9d34a91b99ccf96661afca8991ba163a9e9b19e05679114138ab
MD5 5d95e616725978bb7c9b159798d82e61
BLAKE2b-256 15999d55b9bbd643bc45976ca99ba19645f35e758c045270f15d6fb221b0b50f

See more details on using hashes here.

Supported by

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