Skip to main content

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

Release files for fractal-tree 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fractal-tree 0.2.1
File Size Uploaded
fractal-tree-0.2.1.tar.gz 13.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fractal-tree 0.2.1
File Interpreter ABI Platform
fractal_tree-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 27.0 kB

Release files / fractal-tree-0.2.1.tar.gz

Download URL fractal-tree-0.2.1.tar.gz
Size 13.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b8a2ae1aca1aa7d0d6551536bf1da4d441e35b80f3e3128458012be5fff01d65
BLAKE2b-256 checksum
How to use checksums
624b55610c83d29a618793cc39419081e496a19d3db0a5b90fa7f6223d174144
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.3

Release files / fractal_tree-0.2.1-py3-none-any.whl

Download URL fractal_tree-0.2.1-py3-none-any.whl
Size 13.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
80f018211d2c9d34a91b99ccf96661afca8991ba163a9e9b19e05679114138ab
BLAKE2b-256 checksum
How to use checksums
15999d55b9bbd643bc45976ca99ba19645f35e758c045270f15d6fb221b0b50f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.3

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page