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.2rc14.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.2rc14-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.2rc14-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.2rc14-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.2rc14-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.2rc14-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.2rc14-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.2rc14-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.2rc14-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.2rc14.tar.gz.

File metadata

  • Download URL: pyhexspline-1.0.2rc14.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.2rc14.tar.gz
Algorithm Hash digest
SHA256 abe54d728d5b4e6044571869723e67c526379291e0b6a2c9ad3a69bb00104039
MD5 ead35a55e063db84e51379865f2f4213
BLAKE2b-256 7e0c14d344fc8440cb88d2fe163bf0d91d9107949536e8b902278982614f4d54

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyhexspline-1.0.2rc14-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 3bdf9cd134512385136bc69e0cc57e96a65e546b3f3087a874bdb2f9ffce662a
MD5 11c2aa4426fec34230bda5a8cd367899
BLAKE2b-256 98474bf5c0332be9271eb91854b2236b92f9061b8481c5ccd989fce0c8d5bdd4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhexspline-1.0.2rc14-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.2rc14-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.2rc14-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8cefd3e9e605fd71c02e1bf06db2355f8ac1226815b63dc5c0fc89acafdfb1fd
MD5 632ac4457fe4bfd6f7251c8991697da2
BLAKE2b-256 e45886705e82d1e1e5ee06cbe2ee145b822140cb90b25f6bfd5db84affeafcb2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyhexspline-1.0.2rc14-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 0aecab76a0652c8dc9b4238dc06c12dbbb6177305c18d7ae417571381150835f
MD5 213718c70e5945c8690954e065b03b0e
BLAKE2b-256 7cc30cbe3414780881442753dd8b18992ee25d50877d888496c3cb158a928574

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhexspline-1.0.2rc14-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.2rc14-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.2rc14-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 367830748173db01f02d67e458158d3691ba684d01d6980048883b5244616ef1
MD5 7701139e2754f6ace485d02cabe63f2d
BLAKE2b-256 dab281d64ad066a3611444c3185bae055a78d285d0cdaf2a8add8c2455088798

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyhexspline-1.0.2rc14-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 09fe9bb6f6158dbda1b641f177bbbfc8aeb3597a4ae85d9c3817d590f6e68e9b
MD5 1704402b833d70f6d06896c90bb8d5ab
BLAKE2b-256 ceb204db4dde77d014287de6aab5068b336f0b9258f87770c161c12ed906614d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhexspline-1.0.2rc14-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.2rc14-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.2rc14-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a14715d548a97fd2e2b48692ab9090451f88c0622c2d127f8893a3d9792555fb
MD5 588f80b6b078730c30892c04bc575125
BLAKE2b-256 b7333cb80a92763588dea8c9aea233ffd3e301ca4e89dbeb5f17113473e6d421

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyhexspline-1.0.2rc14-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 78d2840dc4e76776f8b3cc159003cdf108891842e753ec9b32e8b969e8f6c5ac
MD5 0fac7479572d9e21d0e5f09cd91aae77
BLAKE2b-256 1077235bd761b345b3560c44cbdfb5da63f87a128bf732edfa99d27281391273

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhexspline-1.0.2rc14-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.2rc14-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.2rc14-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 642c7a5dadb4c0360aa1c7d2cdb1f3ce086a4d2b3a25bd745d4fc0862ad2b62f
MD5 4851b9ac46c74ef9464611573a88c7d4
BLAKE2b-256 500f41b523694ff4bdad106c85140f23d17e878457ab6bcb9236964980288dd1

See more details on using hashes here.

Provenance

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