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
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.
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.
- 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
To get a local copy up and running follow these simple example steps.
-
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
- 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).
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
Distributed under the MIT License. See LICENSE.txt
for more information.
Simone Poncioni - simone.poncioni@unibe.ch
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.