A Python package for generating GMSH meshes from SCANCO HR-pQCT images
Project description
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
About The Project
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.
Built With
📝 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.
💡 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
Getting Started
To get a local copy up and running follow these simple example steps.
🔧 Installation
-
Clone the repo
git clone https://github.com/artorg-unibe-ch/spline_mesher.git
-
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
-
For developers: install the package in editable mode and install requirements for testing
pip install -e . pip install -r requirements-dev.txt
🛣️ 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).
🤝 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!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
📜 License
Distributed under the MIT License. See LICENSE.txt for more information.
📧 Contact
Simone Poncioni - simone.poncioni@unibe.ch
🙏 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyhexspline-1.0.2rc15.tar.gz.
File metadata
- Download URL: pyhexspline-1.0.2rc15.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
893495b52b0d4d445ef06b3dd09e43e80a96a72838a82b225586ab66a882cf25
|
|
| MD5 |
6c6ab5c3a4c7a91c8f29c5847a6c3223
|
|
| BLAKE2b-256 |
2c96ea19ee91e153653bfbc7d2e1ffe66edcc6e7ba90de7c501b5d05ac6c2897
|
Provenance
The following attestation bundles were made for pyhexspline-1.0.2rc15.tar.gz:
Publisher:
release.yaml on artorg-unibe-ch/spline_mesher
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyhexspline-1.0.2rc15.tar.gz -
Subject digest:
893495b52b0d4d445ef06b3dd09e43e80a96a72838a82b225586ab66a882cf25 - Sigstore transparency entry: 1255064539
- Sigstore integration time:
-
Permalink:
artorg-unibe-ch/spline_mesher@81acf792d8e7bc3f980d3785132e056d0c1ef73f -
Branch / Tag:
refs/tags/1.0.2rc15 - Owner: https://github.com/artorg-unibe-ch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@81acf792d8e7bc3f980d3785132e056d0c1ef73f -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyhexspline-1.0.2rc15-cp312-cp312-musllinux_1_1_x86_64.whl.
File metadata
- Download URL: pyhexspline-1.0.2rc15-cp312-cp312-musllinux_1_1_x86_64.whl
- Upload date:
- Size: 281.8 kB
- Tags: CPython 3.12, musllinux: musl 1.1+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b92162b4ec672a58948cd8de38af56001e2a2e2ec0e48eda6b0311b8177c516
|
|
| MD5 |
5d9ae8aceb9c3bb75dae52326e3dde98
|
|
| BLAKE2b-256 |
cf5236270c6eecbc18127ca11e2f2d75bff7aa60d28cca2a80f9906fc179ca09
|
Provenance
The following attestation bundles were made for pyhexspline-1.0.2rc15-cp312-cp312-musllinux_1_1_x86_64.whl:
Publisher:
release.yaml on artorg-unibe-ch/spline_mesher
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyhexspline-1.0.2rc15-cp312-cp312-musllinux_1_1_x86_64.whl -
Subject digest:
0b92162b4ec672a58948cd8de38af56001e2a2e2ec0e48eda6b0311b8177c516 - Sigstore transparency entry: 1255065416
- Sigstore integration time:
-
Permalink:
artorg-unibe-ch/spline_mesher@81acf792d8e7bc3f980d3785132e056d0c1ef73f -
Branch / Tag:
refs/tags/1.0.2rc15 - Owner: https://github.com/artorg-unibe-ch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@81acf792d8e7bc3f980d3785132e056d0c1ef73f -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyhexspline-1.0.2rc15-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: pyhexspline-1.0.2rc15-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 277.5 kB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66cf66d580bb71cac98ec0a506be84166b46c56c16e31860554de1064fa55e7e
|
|
| MD5 |
bd582534f92ad8d840508be82f5e0696
|
|
| BLAKE2b-256 |
8e2bce0decfb21f517e1510f409a89c09f1fb5d4d69366ebe89a674368ddf3a0
|
Provenance
The following attestation bundles were made for pyhexspline-1.0.2rc15-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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyhexspline-1.0.2rc15-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
66cf66d580bb71cac98ec0a506be84166b46c56c16e31860554de1064fa55e7e - Sigstore transparency entry: 1255066019
- Sigstore integration time:
-
Permalink:
artorg-unibe-ch/spline_mesher@81acf792d8e7bc3f980d3785132e056d0c1ef73f -
Branch / Tag:
refs/tags/1.0.2rc15 - Owner: https://github.com/artorg-unibe-ch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@81acf792d8e7bc3f980d3785132e056d0c1ef73f -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyhexspline-1.0.2rc15-cp311-cp311-musllinux_1_1_x86_64.whl.
File metadata
- Download URL: pyhexspline-1.0.2rc15-cp311-cp311-musllinux_1_1_x86_64.whl
- Upload date:
- Size: 268.7 kB
- Tags: CPython 3.11, musllinux: musl 1.1+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
613c65041d5306df9db757fd6c0fe93e437a0b13f06ba034289520aa6b4c22e8
|
|
| MD5 |
a561075c3105d29db275bd609b388dd8
|
|
| BLAKE2b-256 |
b2543fedc1829b2fe9b0f359c2cbbfe70ba2b3b6246e8da9e755645312ce1363
|
Provenance
The following attestation bundles were made for pyhexspline-1.0.2rc15-cp311-cp311-musllinux_1_1_x86_64.whl:
Publisher:
release.yaml on artorg-unibe-ch/spline_mesher
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyhexspline-1.0.2rc15-cp311-cp311-musllinux_1_1_x86_64.whl -
Subject digest:
613c65041d5306df9db757fd6c0fe93e437a0b13f06ba034289520aa6b4c22e8 - Sigstore transparency entry: 1255065123
- Sigstore integration time:
-
Permalink:
artorg-unibe-ch/spline_mesher@81acf792d8e7bc3f980d3785132e056d0c1ef73f -
Branch / Tag:
refs/tags/1.0.2rc15 - Owner: https://github.com/artorg-unibe-ch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@81acf792d8e7bc3f980d3785132e056d0c1ef73f -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyhexspline-1.0.2rc15-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: pyhexspline-1.0.2rc15-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 259.4 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c062d5c5e5b57f48c5aa59516043a6193e53fa2950371a74a25cdd96c0123a9
|
|
| MD5 |
9ec198d8e5181fbcbbccbbde8251ccd7
|
|
| BLAKE2b-256 |
ef298f2e904afaef34043b5bb7e2efc1adcaec5cbaa907a1fc7899a440ce7a20
|
Provenance
The following attestation bundles were made for pyhexspline-1.0.2rc15-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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyhexspline-1.0.2rc15-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
6c062d5c5e5b57f48c5aa59516043a6193e53fa2950371a74a25cdd96c0123a9 - Sigstore transparency entry: 1255066198
- Sigstore integration time:
-
Permalink:
artorg-unibe-ch/spline_mesher@81acf792d8e7bc3f980d3785132e056d0c1ef73f -
Branch / Tag:
refs/tags/1.0.2rc15 - Owner: https://github.com/artorg-unibe-ch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@81acf792d8e7bc3f980d3785132e056d0c1ef73f -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyhexspline-1.0.2rc15-cp310-cp310-musllinux_1_1_x86_64.whl.
File metadata
- Download URL: pyhexspline-1.0.2rc15-cp310-cp310-musllinux_1_1_x86_64.whl
- Upload date:
- Size: 259.2 kB
- Tags: CPython 3.10, musllinux: musl 1.1+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ffc7acf901da8b270288d9d0a35b5c2ffafaf51a1ec23f6725da568ab285f4d
|
|
| MD5 |
ac61bfe82986c4f969f93500f485ce8d
|
|
| BLAKE2b-256 |
2ebd1dfe09b0fb61a69244fc3b896cc70a656735316ac6ffd5b3526b14a6385b
|
Provenance
The following attestation bundles were made for pyhexspline-1.0.2rc15-cp310-cp310-musllinux_1_1_x86_64.whl:
Publisher:
release.yaml on artorg-unibe-ch/spline_mesher
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyhexspline-1.0.2rc15-cp310-cp310-musllinux_1_1_x86_64.whl -
Subject digest:
1ffc7acf901da8b270288d9d0a35b5c2ffafaf51a1ec23f6725da568ab285f4d - Sigstore transparency entry: 1255065651
- Sigstore integration time:
-
Permalink:
artorg-unibe-ch/spline_mesher@81acf792d8e7bc3f980d3785132e056d0c1ef73f -
Branch / Tag:
refs/tags/1.0.2rc15 - Owner: https://github.com/artorg-unibe-ch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@81acf792d8e7bc3f980d3785132e056d0c1ef73f -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyhexspline-1.0.2rc15-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: pyhexspline-1.0.2rc15-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 248.6 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe5e0a5c8628b3e84ee18d1875bb4055c3d0d26d6e00909b6e20d7a9b273f06a
|
|
| MD5 |
a5dcaa3cf90666d7d04e2a0daa068bdb
|
|
| BLAKE2b-256 |
34b7a98fd16f8498cdeb9b257a2dcdc8cab6544d728a8234e8c4aaf20e15f889
|
Provenance
The following attestation bundles were made for pyhexspline-1.0.2rc15-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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyhexspline-1.0.2rc15-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
fe5e0a5c8628b3e84ee18d1875bb4055c3d0d26d6e00909b6e20d7a9b273f06a - Sigstore transparency entry: 1255064866
- Sigstore integration time:
-
Permalink:
artorg-unibe-ch/spline_mesher@81acf792d8e7bc3f980d3785132e056d0c1ef73f -
Branch / Tag:
refs/tags/1.0.2rc15 - Owner: https://github.com/artorg-unibe-ch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@81acf792d8e7bc3f980d3785132e056d0c1ef73f -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyhexspline-1.0.2rc15-cp39-cp39-musllinux_1_1_x86_64.whl.
File metadata
- Download URL: pyhexspline-1.0.2rc15-cp39-cp39-musllinux_1_1_x86_64.whl
- Upload date:
- Size: 257.7 kB
- Tags: CPython 3.9, musllinux: musl 1.1+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7562d241af903ca36cdd205a74651091b7f9fe7c14e2fa7f19c1eeda2830e9e
|
|
| MD5 |
d067857626887f876941660169b1e957
|
|
| BLAKE2b-256 |
fd3f2127e05b791b9e819fe9d925f1da469ed776dae810f3856cd8c3578f2874
|
Provenance
The following attestation bundles were made for pyhexspline-1.0.2rc15-cp39-cp39-musllinux_1_1_x86_64.whl:
Publisher:
release.yaml on artorg-unibe-ch/spline_mesher
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyhexspline-1.0.2rc15-cp39-cp39-musllinux_1_1_x86_64.whl -
Subject digest:
d7562d241af903ca36cdd205a74651091b7f9fe7c14e2fa7f19c1eeda2830e9e - Sigstore transparency entry: 1255065827
- Sigstore integration time:
-
Permalink:
artorg-unibe-ch/spline_mesher@81acf792d8e7bc3f980d3785132e056d0c1ef73f -
Branch / Tag:
refs/tags/1.0.2rc15 - Owner: https://github.com/artorg-unibe-ch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@81acf792d8e7bc3f980d3785132e056d0c1ef73f -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyhexspline-1.0.2rc15-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: pyhexspline-1.0.2rc15-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 247.2 kB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be3e021c23f9f29ea3e325bd7c5c3a94669d94b23af1f5d24166bc551826f80a
|
|
| MD5 |
fd28885f24649967848b98b0e731158a
|
|
| BLAKE2b-256 |
1d558717133e202656b18eb61e74918b192c5ceafcf3e975b9f546acd8bcfc4b
|
Provenance
The following attestation bundles were made for pyhexspline-1.0.2rc15-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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyhexspline-1.0.2rc15-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
be3e021c23f9f29ea3e325bd7c5c3a94669d94b23af1f5d24166bc551826f80a - Sigstore transparency entry: 1255064671
- Sigstore integration time:
-
Permalink:
artorg-unibe-ch/spline_mesher@81acf792d8e7bc3f980d3785132e056d0c1ef73f -
Branch / Tag:
refs/tags/1.0.2rc15 - Owner: https://github.com/artorg-unibe-ch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@81acf792d8e7bc3f980d3785132e056d0c1ef73f -
Trigger Event:
push
-
Statement type: