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.2rc13.tar.gz (151.3 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.2rc13-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.2rc13-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (277.5 kB view details)

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

pyhexspline-1.0.2rc13-cp311-cp311-musllinux_1_1_x86_64.whl (268.7 kB view details)

Uploaded CPython 3.11musllinux: musl 1.1+ x86-64

pyhexspline-1.0.2rc13-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (259.4 kB view details)

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

pyhexspline-1.0.2rc13-cp310-cp310-musllinux_1_1_x86_64.whl (259.2 kB view details)

Uploaded CPython 3.10musllinux: musl 1.1+ x86-64

pyhexspline-1.0.2rc13-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.2rc13-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.2rc13-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.2rc13.tar.gz.

File metadata

  • Download URL: pyhexspline-1.0.2rc13.tar.gz
  • Upload date:
  • Size: 151.3 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.2rc13.tar.gz
Algorithm Hash digest
SHA256 f5d8994272b09a58575dac0bde61f234f18f5a0df38710d6a0c0530568c8d375
MD5 99ff737a9c6e5cec75c65b992a1b2c34
BLAKE2b-256 8cea1fb89facd809b1c1cd7473f1529f9f75ad9742f2137e9f44b1b52f9235c6

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhexspline-1.0.2rc13.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.2rc13-cp312-cp312-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for pyhexspline-1.0.2rc13-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 8f5bb461ebbf5dcb48843d9d3d900cd844cce71994a13e770f658c69cae8fa0e
MD5 5ca232b717d6e5acd6017659b48b9a02
BLAKE2b-256 803ad66736d3694c5a66d6e921bda834f9d52df8cd254af39d1f7e3a9f8e0c65

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhexspline-1.0.2rc13-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.2rc13-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.2rc13-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e69939a116a02e203b63fe8eb16e97fe09c0b766681e649783b32b9d4833950d
MD5 0bd7bad5388d06babc8cd6e06848664c
BLAKE2b-256 7587cb7653b12046fbe5288ed9d9ebc7ffb45506052e0b6388c56ead9686828a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhexspline-1.0.2rc13-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.2rc13-cp311-cp311-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for pyhexspline-1.0.2rc13-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 d1628f4a01411c49a53205a0da66186df01a6ce88cda67df7b007c802576c83b
MD5 c02ec5d47d594a73bc9dc36c40598c91
BLAKE2b-256 0dd014c1a200df647e00bd78fb40d4998dc44cf5f31e1a2f7ca08de05d686414

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhexspline-1.0.2rc13-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.2rc13-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.2rc13-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d074288784b84fc33f2c0e2c23d7bd59af1d37b5a6ec0a84dd3b2a7373449493
MD5 956bcc172bdff759db4171bf780f6a2b
BLAKE2b-256 a4a3d251c4c475e4b24f53985e09084854e42e66e90776d59aa30e494023f847

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhexspline-1.0.2rc13-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.2rc13-cp310-cp310-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for pyhexspline-1.0.2rc13-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 ac5bf132185c6f10353d16169e7abe68407cfda74fd89f653ce801982d2fc8a0
MD5 b22f13a5311a64e77f75b6e8b6a30e68
BLAKE2b-256 e6d269951ee7bb66ea2773e9643e2e1a1707f4d3891f3c0eb5a9a1b67335b1cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhexspline-1.0.2rc13-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.2rc13-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.2rc13-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c17dfc265442dcefa8ab586290871bb650b50fd9ff622091b2d7947b7a9d3699
MD5 78c24c305760b196b0edf4faca717aad
BLAKE2b-256 35659d9788bdd94355d706cfdcdc510c7b3b0457dc8da0ed074495ab73865e81

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhexspline-1.0.2rc13-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.2rc13-cp39-cp39-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for pyhexspline-1.0.2rc13-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 5fa19e822ccf54aec84c8da11400252538f73a2a2f9fd6ec0d469eb4effe418d
MD5 356bc161b9bba0c7001205cc7ba88f71
BLAKE2b-256 8e8d58e6a19e406982f1423db82e0e1b99e1d542914656b901e5a05540dc3659

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhexspline-1.0.2rc13-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.2rc13-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.2rc13-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2664cfa74502d4771730e004c67139ba1df3ffd89281c78c8a1aebfac72664d4
MD5 3e592bbc69b1767b3fa0eca296960845
BLAKE2b-256 27a5eaa2481d92291b478095a89a3d32e90a4927a6205eef46fe4656bb478c55

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhexspline-1.0.2rc13-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