Skip to main content

A Python package for generating GMSH meshes from SCANCO HR-pQCT images

Project description

DOI

Python application Documentation

Spline-based structured conformal hexahedral meshing

A Python package for generating GMSH meshes from SCANCO HR-pQCT images.
Explore the docs »

View Demo · Report Bug · Request Feature

👷🏼 Simone Poncioni
🦴 Musculoskeletal Biomechanics Group
🎓 ARTORG Center for Biomedical Engineering Research, University of Bern

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

Spline-mesher01 Spline-mesher02

Import a voxel-based model and convert it to a geometrical simplified representation through the use of splines for each slice in the transverse plane.

(back to top)

Built With

Python GMSH

(back to top)

📝 Introduction

A Python package for generating GMSH meshes from SCANCO HR-pQCT images. Import a voxel-based model and convert it to a geometrical simplified representation through the use of splines for each slice in the transverse plane.

(back to top)

💡 Method

  • Structured Mesh: Provides greater simplicity, efficiency, and lower memory usage due to implicit connectivity with neighboring elements. Ensures topologically identical models for easy comparison between patients or across longitudinal studies.
  • Contour Extraction & Smoothing: Utilizes scikit-image for periosteal and endosteal contour extraction, followed by Douglas-Ramer-Peucker simplification and 3rd order periodic BSplines for smooth geometry representation.
  • Sanity Check: Ensures a minimum cortical thickness of 0.5 mm, allowing space for at least three elements and continuity in thin structures.
  • Mesh Generation: The simplified geometry is imported into GMSH via the OpenCASCADE kernel. Transfinite techniques and the Winslow untangler are used for optimal mesh quality.
  • Quality Assessment: Mesh quality is evaluated using the Dice similarity coefficient (DSC) with a minimum value of 95%, and the (signed-) inverse conditioning number ((S-) ICN) to ensure matrix conditioning and simulation stability.

For more examples, please refer to the Documentation

(back to top)

Getting Started

To get a local copy up and running follow these simple example steps.

🔧 Installation

  1. Clone the repo

    git clone https://github.com/artorg-unibe-ch/spline_mesher.git
    
  2. Install dependencies

    conda create -n meshenv python=3.9 --file requirements.txt
    conda activate meshenv
    python setup.py build_ext --inplace
    python setup.py install
    
  3. For developers: install the package in editable mode and install requirements for testing

    pip install -e .
    pip install -r requirements-dev.txt
    

(back to top)

🛣️ Roadmap

  • v0.0.1: single execution of radius and tibia mesher
  • v0.0.2:
    • Faster implementation of sorting algorithm
    • Faster implementation of cortical sanity check
    • Implement test robustness over different models
  • v1.1.0: add phase discrimination in order to mesh single phase models (e.g. vertebrae)

See the open issues for a full list of proposed features (and known issues).

(back to top)

🤝 Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

📜 License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

📧 Contact

Simone Poncioni - simone.poncioni@unibe.ch

(back to top)

🙏 Acknowledgements

This work was funded internally by the ARTORG Center for Biomedical Engineering Research and by the Department of Osteoporosis of the University of Bern. Calculations were performed on UBELIX, the HPC cluster at the University of Bern.

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

pyhexspline-1.0.2rc11.tar.gz (151.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyhexspline-1.0.2rc11-cp312-cp312-musllinux_1_1_x86_64.whl (281.8 kB view details)

Uploaded CPython 3.12musllinux: musl 1.1+ x86-64

pyhexspline-1.0.2rc11-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (277.4 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

pyhexspline-1.0.2rc11-cp311-cp311-musllinux_1_1_x86_64.whl (268.6 kB view details)

Uploaded CPython 3.11musllinux: musl 1.1+ x86-64

pyhexspline-1.0.2rc11-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (259.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

pyhexspline-1.0.2rc11-cp310-cp310-musllinux_1_1_x86_64.whl (259.1 kB view details)

Uploaded CPython 3.10musllinux: musl 1.1+ x86-64

pyhexspline-1.0.2rc11-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (248.6 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

pyhexspline-1.0.2rc11-cp39-cp39-musllinux_1_1_x86_64.whl (257.7 kB view details)

Uploaded CPython 3.9musllinux: musl 1.1+ x86-64

pyhexspline-1.0.2rc11-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (247.2 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

File details

Details for the file pyhexspline-1.0.2rc11.tar.gz.

File metadata

  • Download URL: pyhexspline-1.0.2rc11.tar.gz
  • Upload date:
  • Size: 151.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyhexspline-1.0.2rc11.tar.gz
Algorithm Hash digest
SHA256 fb26a53fbacd72922bfc9cd1b0ebe2a67a8834a8b3c386e964922788100efdf5
MD5 791fd8f18a204cb49f1e1fa8edaa93b0
BLAKE2b-256 22580b02cbbdb809a49552ffab28211271f5b0f1cff6b1df4a34bf776b710eec

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhexspline-1.0.2rc11.tar.gz:

Publisher: release.yaml on artorg-unibe-ch/spline_mesher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyhexspline-1.0.2rc11-cp312-cp312-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for pyhexspline-1.0.2rc11-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 8e10bc91d79cedcbcde76e6f730683aa78262e7aa6322f12bac1e8bbf386d98f
MD5 2b103b2ec65f61d1ac40b4832ad7f0ec
BLAKE2b-256 2706297cb6704e85e964ae8f8b143b52cbeaf0e8098831603e4f1ba6ad5ece44

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhexspline-1.0.2rc11-cp312-cp312-musllinux_1_1_x86_64.whl:

Publisher: release.yaml on artorg-unibe-ch/spline_mesher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyhexspline-1.0.2rc11-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyhexspline-1.0.2rc11-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4b964f6b28f1b0de2ebde005f51707b30b246e843a15255e369a5014c4ffca1d
MD5 6ef2da3abf76efa35cd80480ed306048
BLAKE2b-256 11b17316a8911f28898d12690008afeaf8fc2c3185fce0fc6f9693e8c8dc880f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhexspline-1.0.2rc11-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yaml on artorg-unibe-ch/spline_mesher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyhexspline-1.0.2rc11-cp311-cp311-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for pyhexspline-1.0.2rc11-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 98a34827a93bafa90fb1376a7cd7013e992b452802f3746c4a5e51134fc05c54
MD5 bb6f5335f375a6bdfa72e6fb44683d64
BLAKE2b-256 49e5760f974a2e8deba23262a92f0995e592a8a11d38e86061236fbbb2c15d3b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhexspline-1.0.2rc11-cp311-cp311-musllinux_1_1_x86_64.whl:

Publisher: release.yaml on artorg-unibe-ch/spline_mesher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyhexspline-1.0.2rc11-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyhexspline-1.0.2rc11-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 41ca02a550727652417df4baad9f8f72546f0a2fc9133658de88c726ea6e123b
MD5 0bff6c90345b8c585f7e165db2ca3ae1
BLAKE2b-256 5464d0608e330cefa1ab4a8c1f54b7fd626c774a08f57a28a398632a60d76a29

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhexspline-1.0.2rc11-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yaml on artorg-unibe-ch/spline_mesher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyhexspline-1.0.2rc11-cp310-cp310-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for pyhexspline-1.0.2rc11-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 ec4bb692f02d6ea47484a0932af15efb527ceb399aa7eebcf79b62c236547932
MD5 b7d9a95ce2c905242305dc70a4906da9
BLAKE2b-256 01ecb3960ce115ce50af6f93f31ae2163361a21b69caa654caafb25f5f590b00

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhexspline-1.0.2rc11-cp310-cp310-musllinux_1_1_x86_64.whl:

Publisher: release.yaml on artorg-unibe-ch/spline_mesher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyhexspline-1.0.2rc11-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyhexspline-1.0.2rc11-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 286f5829602429f61087916e3736caf951570a401a9c2b617f0ad09f5045f29b
MD5 bcaaf89540a76531171f20ef6bf125f9
BLAKE2b-256 e72dbb62b9f641c0034081f702f6d134c06acda41c3206a3c4a1d9b7a2a7d713

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhexspline-1.0.2rc11-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yaml on artorg-unibe-ch/spline_mesher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyhexspline-1.0.2rc11-cp39-cp39-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for pyhexspline-1.0.2rc11-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 7f27496ac5d8955d8bd7ebf6181e41430d63a6c4ae94cfa3f75caeec4c03d6cb
MD5 c3d6e9aeb4a4166e19e763a55a1156fb
BLAKE2b-256 404a83370090557b2dc32ca43a3e9ec5b6f468ec42c05b8fbd1e940a79d283b3

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhexspline-1.0.2rc11-cp39-cp39-musllinux_1_1_x86_64.whl:

Publisher: release.yaml on artorg-unibe-ch/spline_mesher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyhexspline-1.0.2rc11-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyhexspline-1.0.2rc11-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8eaa548338b28b006bd253efdc73851f51c21163cf54c5c9677f717ba794e2f0
MD5 f38bac6b40b32f7e7ba52769743f84a9
BLAKE2b-256 62173a7db00204fcb39fea4ade4ff1c670709639c88ae4a58f4501b7008f2494

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhexspline-1.0.2rc11-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yaml on artorg-unibe-ch/spline_mesher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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