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.2rc6.tar.gz (146.0 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.2rc6-cp312-cp312-musllinux_1_1_x86_64.whl (281.7 kB view details)

Uploaded CPython 3.12musllinux: musl 1.1+ x86-64

pyhexspline-1.0.2rc6-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (277.3 kB view details)

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

pyhexspline-1.0.2rc6-cp311-cp311-musllinux_1_1_x86_64.whl (268.5 kB view details)

Uploaded CPython 3.11musllinux: musl 1.1+ x86-64

pyhexspline-1.0.2rc6-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (259.2 kB view details)

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

pyhexspline-1.0.2rc6-cp310-cp310-musllinux_1_1_x86_64.whl (259.0 kB view details)

Uploaded CPython 3.10musllinux: musl 1.1+ x86-64

pyhexspline-1.0.2rc6-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (248.4 kB view details)

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

pyhexspline-1.0.2rc6-cp39-cp39-musllinux_1_1_x86_64.whl (257.5 kB view details)

Uploaded CPython 3.9musllinux: musl 1.1+ x86-64

pyhexspline-1.0.2rc6-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (247.1 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.2rc6.tar.gz.

File metadata

  • Download URL: pyhexspline-1.0.2rc6.tar.gz
  • Upload date:
  • Size: 146.0 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.2rc6.tar.gz
Algorithm Hash digest
SHA256 1fb3dfb2103243b799b748272d65d16c2f4df794cc9b38367a5b90182562de98
MD5 c478da1dbaf0308a5bc72925e6b13eed
BLAKE2b-256 286d8905898be3ad105dba8805511efb21a5084a2656bd9295f09337768d2869

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyhexspline-1.0.2rc6-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 0ea46fa2231171cea08d73f40d9553b7ff58b2fb28b3d280c84829d2f78f59e0
MD5 32283d29813854d5cf6770c9bc8f76c5
BLAKE2b-256 f78ea0dc0d0fe8331c4ee501b52da9673e46a545a090b24890fa13248bcfa16b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhexspline-1.0.2rc6-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.2rc6-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.2rc6-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d241f2d2342abd68dd988d532f3045633c3c678d99e52262da61fe8d7bbbe2d6
MD5 753f9359f20b4a42e02f161a7a76d832
BLAKE2b-256 e90a4180e7b52015be170d215268ab4269a543d238ec518dedaf20da704296ac

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyhexspline-1.0.2rc6-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 90af6d33c4705d701b268ea1a41d385da0ca4bec85e7c7cf86494dd0eb45d64e
MD5 2b9a791f9daaf726b1dabbc29d3271e6
BLAKE2b-256 5ea74eb7a311681fa10ecd8f8e81785fb300b3fcb2e645d49fe65799bcc7e071

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhexspline-1.0.2rc6-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.2rc6-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.2rc6-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 81ba08f0573c8b6ebdbd98c927ef3c08ec427b6bdfc2a2cb1991d0066d79874a
MD5 ce8aa7cfd9a69fe25e3ca2e9c2eabaff
BLAKE2b-256 3a242c8de7c664adbe8e5acabd3e0b93218560e0ce46bd0ee5451acd3e148919

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyhexspline-1.0.2rc6-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 e7c43ec925da429fd0ad9020e4ab235baeee6fef0a084314a35939c2af8d5081
MD5 c49a382708a97958640e776b17a96b28
BLAKE2b-256 d10bbfc703e82eeefa314b494b5617ec0b69ca549eb2a39134ea10f1a4daad78

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhexspline-1.0.2rc6-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.2rc6-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.2rc6-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b4a220307696585be6baee44499f0afdc8acf14a41ed6829a46f7cd10b3826cc
MD5 5080493430075441eac1f7ec81f9670d
BLAKE2b-256 6c010897c9640146df6534ec05f08348d328654eb8b73b606d62583efd714cc7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyhexspline-1.0.2rc6-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 06996598aae1ae30cbbe6fcc83fc4d6dcb3621b6d575f84fc0493030c95b4768
MD5 d42945223cd05d9420fbac9d937a8610
BLAKE2b-256 67963eefc28c28d122090be882abf95a5a19ca32289c50ef37b9e7e757f2b759

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhexspline-1.0.2rc6-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.2rc6-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.2rc6-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a66cc5b574383d9d8e20ccaa78758c16621fa1ce638fcfdb54d37199f4eb66af
MD5 5b0b7b76f41e0332cd78e1c304ad775a
BLAKE2b-256 145ec70c06687c45d88f5eda289297af0fa2b9dcae66b5283763fc550efe1a3c

See more details on using hashes here.

Provenance

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