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

File metadata

  • Download URL: pyhexspline-1.0.2rc12.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.2rc12.tar.gz
Algorithm Hash digest
SHA256 75b465a2ee4ba8a0d2c4b561fbe517c64b33c50d0fcc67537cb8266b38cad542
MD5 7c3fe7162d283d7434551bd7c86b7033
BLAKE2b-256 72800373f1c5340ea120c83c597b9d288eb5ec4e85c0a5e7fb644b22c43299a3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyhexspline-1.0.2rc12-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 59a29dcbcea72518bc12c15ec41f36b8eb74727f38005d6624e4a9df94984e21
MD5 6fd9044bb930218376be14dfe4311416
BLAKE2b-256 9f158691f4841524383c36ce955b3396f880513114fa5d3564d039a8648c7443

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhexspline-1.0.2rc12-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.2rc12-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.2rc12-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 08f2777a55c873a69f57b61e7156ef6d7b26e7fa3f7105c9ff4acac3eb725f00
MD5 147a3413d03dec58311a4173048ec826
BLAKE2b-256 ff7b7f3c1ddc8c720df7a2fa97a0952dea7edc274417063e9b64296e5bb83a37

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyhexspline-1.0.2rc12-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 6a447749f9b65c81367c1d8afdc06b16baa8b76a691c857bffa2b5feb1d43328
MD5 dd8812e2b9849540d6f5a03e9bffb2f0
BLAKE2b-256 247255a7bcb0bb1f57f0473a16fc03b76a9f1455381336cb755c9fef789d2481

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhexspline-1.0.2rc12-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.2rc12-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.2rc12-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c7267783c6a137976642a4959effdbdc6755a7bc852edab67fb62721c039e639
MD5 a8b43852a31a9ce820a37dc6f51aa781
BLAKE2b-256 33b13bdd0e0496fc29c2d9cfced6a343d48dba637f1a2d21f70203435c22386c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyhexspline-1.0.2rc12-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 136064e3415244e673944cb87cfdd8051a27a6c3480efc1063386e1c80e459e2
MD5 baf038716981d8df69f12499140d648d
BLAKE2b-256 c0de095dc5398e92f9a39fc0e67488cdf4fd135dfcd5b88884a8ee0bde89c3c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhexspline-1.0.2rc12-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.2rc12-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.2rc12-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e599ce94bb31916f26c804cfa725ea6f429a3421a48890915eb6420457c887d1
MD5 92f7467caf0d6ba8f298ebfb06083cdc
BLAKE2b-256 07069b51d90c0707636f238ee22b5edb25aff0cca892c52f4bf3d6adf5f23b3a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyhexspline-1.0.2rc12-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 6a862b91a20ad6f133a0d91aa2c054c11324c6124ea83481c7218b6d3a326b0d
MD5 c8564e125adcd1c5a05bf3421638c1cb
BLAKE2b-256 7a260c2a31ba94b006e17607a682b85da27a90cad8bea919f4167a8391154e32

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhexspline-1.0.2rc12-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.2rc12-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.2rc12-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 17edeebb56e1be1d8296a9ed79290de502a5a414523a7e378facc5f41458ce12
MD5 b390a9f11f1dd63428e1266b2fb2b6d4
BLAKE2b-256 cc19f752bcd77d8b846adcd87fe8049a9ed659f20f0697de61a90a82250b6b3a

See more details on using hashes here.

Provenance

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