ciclope


Nameciclope JSON
Version 2.0.0 PyPI version JSON
download
home_pageNone
SummaryComputed Tomography to Finite Elements
upload_time2024-12-20 15:20:28
maintainerNone
docs_urlNone
authorGigi Crimi
requires_python>=3.7
licenseMIT License Copyright (c) 2023 Gianluca Iori Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords computed tomography finite elements image processing engineering simulation biomechanics
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ciclope
Computed Tomography to Finite Elements.

[![GitHub license](https://img.shields.io/github/license/gianthk/ciclope)](https://github.com/gianthk/ciclope/blob/master/LICENSE)
[![PyPi Version](https://img.shields.io/pypi/v/ciclope.svg?style=flat-square)](https://pypi.org/project/ciclope/)
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/ciclope.svg?style=flat-square)](https://pypi.org/project/ciclope/)
[![Documentation Status](https://readthedocs.org/projects/ciclope/badge/?version=latest)](https://ciclope.readthedocs.io/en/latest/?badge=latest)
[![DOI](https://joss.theoj.org/papers/10.21105/joss.04952/status.svg)](https://doi.org/10.21105/joss.04952)

Micro Finite Element (microFE) models can be derived from micro Computed Tomography (microCT) 3D images to non-destructively assess mechanical properties of biological or artificial specimens. <br />
**ciclope** provides fully open-source pipelines from microCT data preprocessing to microFE model generation, solution and postprocessing. <br />

## Installation
For mesh generation, `ciclope` requires [pygalmesh](https://github.com/meshpro/pygalmesh), a Python frontend to [CGAL](https://www.cgal.org/).
Follow the [installation procedure](https://github.com/meshpro/pygalmesh#installation) for [CGAL](https://www.cgal.org/) and [Eigen](http://eigen.tuxfamily.org/index.php?title=Main_Page).
After that, install pygalmesh with pip or conda
```commandline
conda install -c conda-forge pygalmesh
```
After installing pygalmesh, you can install `ciclope` using pip. The flag `[all]` will install optional dependencies needed to run full pipelines and examples.
```commandline
pip install ciclope[all]
```

Some examples will require [DXchange](https://dxchange.readthedocs.io/en/latest/index.html). You can install it with
```shell
conda install -c conda-forge dxchange
```
### Testing
To verify your installation checkout this repository and run the tests with the command
```commandline
cd test
python -m unittest -v test_ciclope.run_tests
```
### How to contribute
If you want to contribute to this project, please install `ciclope` following the [development guide](development.md).

## Usage
**ciclope** pipelines can be run from the command line as a script. Scroll down and take a look at the [Examples](###Examples) folder for this type of use.
To view the command line script help run
```commandline
ciclope -h
```

To use **ciclope** within python, import the package with
```python
import ciclope
```
### Image pre-processing
`ciclope.utils` contains functions that help you read and pre-process 3D datasets for FE model generation.

Read 3D CT dataset stored as stack of TIFFs
```python
from ciclope.utils.recon_utils import read_tiff_stack

input_file = './test_data/LHDL/3155_D_4_bc/cropped/3155_D_4_bc_0000.tif'

data_3D = read_tiff_stack(input_file)
vs = np.ones(3) * 0.06  # voxelsize [mm]
```
`read_tiff_stack` reads all TIFF files (slices) contained in the `input_file` folder. The volume is stored in a 3D [`numpy.ndarray`](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html) with size `[slices, rows, columns]`.

---
Segment and remove unconnected voxels
```python
from skimage import morphology
from ciclope.utils.preprocess import remove_unconnected

BW = data_3D > 142 # fixed global threshold
BW = morphology.closing(BW, morphology.ball(2)) # optional step
L = remove_unconnected(BW)
```

### Mesh and FE model generation
If you already have a mesh file, you can skip the mesh generation steps and use `ciclope` with 3D [`meshio`](https://github.com/nschloe/meshio) objects.

#### voxel-FE
![](test_data/trabecular_bone/trab_sample_mini3_UD3.png)
Generate unstructured grid mesh of hexahedra (voxels)
```python
import ciclope
mesh = ciclope.core.voxelFE.vol2ugrid(data_3D, vs)
```

Generate CalculiX input file `.INP` for **voxel-FE** model of linear elastic compression test
```python
input_template = "./input_templates/tmp_example01_comp_static_bone.inp"
ciclope.core.voxelFE.mesh2voxelfe(mesh, input_template, 'foo.inp', keywords=['NSET', 'ELSET'])
```

#### tetrahedra-FE
![](test_data/steel_foam/B_matrix_tetraFE_mesh.png)
Generate mesh of tetrahedra. `ciclope` uses [`pygalmesh`](https://github.com/nschloe/pygalmesh) for tetrahedra mesh generation
```python
mesh = ciclope.core.tetraFE.cgal_mesh(L, vs, 'tetra', max_facet_distance=0.2, max_cell_circumradius=0.1)
```

Generate CalculiX input file `.INP` for **tetrahedra-FE** model of non-linear tensile test
```python
input_template = "./input_templates/tmp_example02_tens_static_steel.inp"
ciclope.core.tetraFE.mesh2tetrafe(mesh, input_template, 'foo.inp', keywords=['NSET', 'ELSET'])
```

### Postprocessing
`ciclope.utils.postprocess.paraviewplot` calls [`ParaView`](https://www.paraview.org/) to generate and save plots of a chosen model scalar field.
- Add path to your ParaView installation with
```python
import sys
sys.path.append('~/Applications/ParaView-5.9.0-RC1-MPI-Linux-Python3.8-64bit/lib/python3.8/site-packages')
```

- Plot midplanes of the vertical displacement field `UD3`
```python
ciclope.utils.postprocess.paraview_plot('test_data/tooth/results/Tooth_3_scaled_2.vtk', slicenormal="xyz",
                                        RepresentationType="Surface", Crinkle=True, ColorBy=['U', 'D2'], Roll=90,
                                        ImageResolution=[1024, 1024], TransparentBackground=True,
                                        colormap='Cool to Warm')
```
| | | |
|:-------------------------:|:-------------------------:|:-------------------------:|
|![](test_data/tooth/results/Tooth_3_scaled_2_UD3_XY.png) | ![](test_data/tooth/results/Tooth_3_scaled_2_UD3_XZ.png) | ![](test_data/tooth/results/Tooth_3_scaled_2_UD3_YZ.png) |

- Plot midplanes of the Von Mises stress `S_Mises`
```python
ciclope.utils.postprocess.paraview_plot("test_data/tooth/results/Tooth_3_scaled_2.vtk", slicenormal="xyz",
                                        RepresentationType="Surface", Crinkle=False, ColorBy="S_Mises", Roll=90,
                                        ImageResolution=[1024, 1024])
```
| | | |
|:-------------------------:|:-------------------------:|:-------------------------:|
|![](test_data/tooth/results/Tooth_3_scaled_2_S_Mises_XY.png) | ![](test_data/tooth/results/Tooth_3_scaled_2_S_Mises_XZ.png) | ![](test_data/tooth/results/Tooth_3_scaled_2_S_Mises_YZ.png) |


See the Jupyter Notebooks in the [examples section](https://github.com/gianthk/ciclope#examples) for more examples of 3D data and results visualization.

## ciclope pipeline 
The following table shows a general pipeline for FE model generation from CT data that can be executed from the command line with the `ciclope` script:

| # | Step | Description | command line script flag |
|:-:|:-|:-|:-|
| 1. | **Load CT data** | | |
| 2. | **Pre-processing** | Gaussian smooth | `--smooth` |
| | | Resize image | `-r` |
| | | Add embedding | (not implemented yet) |
| | | Add caps | `--caps` |
| 3. | **Segmentation** | Uses Otsu method if left empty | `-t` |
| | | Remove unconnected voxels | |
| 4. | **Meshing** | Outer shell mesh of triangles | `--shell_mesh` |
| | | Volume mesh of tetrahedra | `--vol_mesh` |
| 5. | **FE model generation** | Apply Boundary Conditions | |
| | | Material mapping | `-m`, `--mapping` |
| | | Voxel FE | `--voxelfe` |
| | | Tetrahedra FE | `--tetrafe` |


## Notes on ciclope
* Tetrahedra meshes are generated with [pygalmesh](https://github.com/nschloe/pygalmesh) (a Python frontend to [CGAL](https://www.cgal.org/))
* High-resolution surface meshes for visualization are generated with the [PyMCubes](https://github.com/pmneila/PyMCubes) module.
* All mesh exports are performed with the [meshio](https://github.com/nschloe/meshio) module.
* **ciclope** handles the definition of material properties and FE analysis parameters (e.g. boundary conditions, simulation steps..) through separate template files. The folders [material_properties](/material_properties) and [input_templates](/input_templates) contain a library of template files that can be used to generate FE simulations.
  * Additional libraries of [CalculiX](https://github.com/calculix) examples and template files can be found [here](https://github.com/calculix/examples) and [here](https://github.com/calculix/mkraska)

## Examples
### [Example 1: voxel-uFE model of trabecular bone; linear compression test](examples/ipynb/ciclope_ex01_voxeluFE_CalculiX.ipynb) [![Made withJupyter](https://img.shields.io/badge/Made%20with-Jupyter-orange?style=for-the-badge&logo=Jupyter)](examples/old/ciclope_ex01_voxelFE_trabecularbone_CalculiX.ipynb)
![](test_data/LHDL/3155_D_4_bc/results/LHDL_voxelFE_U3.png)

The pipeline can be executed from the command line with:
```commandline
ciclope test_data/LHDL/3155_D_4_bc/cropped/3155_D_4_bc_0000.tif test_data/LHDL/3155_D_4_bc/results/3155_D_4_bc_voxelFE.inp -vs 0.0195 0.0195 0.0195 -r 2 -t 63 --smooth 1 --voxelfe --template input_templates/tmp_example01_comp_static_bone.inp --verbose
```

The example shows how to:
- [x] Load and inspect microCT volume data
- [x] Apply Gaussian smooth
- [x] Resample the dataset
- [x] Segment the bone tissue
- [x] Remove unconnected clusters of voxels
- [x] Convert the 3D binary to a voxel-FE model for simulation in CalculX or Abaqus
  - [x] Linear, static analysis; displacement-driven
  - [X] Local material mapping (dataset Grey Values to bone Tissue Elastic Modulus)
- [x] Launch simulation in Calculix
- [x] Convert Calculix output to .VTK for visualization in Paraview
- [x] Visualize simulation results in Paraview
---
### [Example 2: tetrahedra-uFE model of trabecular bone; linear compression test](examples/ipynb/ciclope_ex02_tetrauFE_CalculiX.ipynb) [![Made withJupyter](https://img.shields.io/badge/Made%20with-Jupyter-orange?style=for-the-badge&logo=Jupyter)](examples/ipynb/ciclope_ex02_tetrauFE_CalculiX.ipynb)
![](test_data/LHDL/3155_D_4_bc/results/LHDL_tetraFE_U3.png)

The pipeline can be executed from the command line with:
```commandline
ciclope test_data/LHDL/3155_D_4_bc/cropped/3155_D_4_bc_0000.tif test_data/LHDL/3155_D_4_bc/results/3155_D_4_bc.inp -vs 0.0195 0.0195 0.0195 -r 2 -t 63 --smooth 1 --tetrafe --max_facet_distance 0.025 --max_cell_circumradius 0.05 --vol_mesh --template input_templates/tmp_example01_comp_static_bone.inp
```
---
### [Example #3 - tetrahedra-FE model of embedded tooth; compression test; heterogeneous materials](examples/ipynb/ciclope_ex03_tetraFE_tooth_CalculiX.ipynb) [![Made withJupyter](https://img.shields.io/badge/Made%20with-Jupyter-orange?style=for-the-badge&logo=Jupyter)](examples/ciclope_ex02_tetraFE_steelfoam_CalculiX.ipynb)
![](test_data/tooth/results/Tooth_3_scaled_2_Smises2.png)
---
### [Example #4 - non-linear tetrahedra-FE model of stainless steel foam](examples/ipynb/ciclope_ex04_tetraFE_steelfoam_nonlinear_CalculiX.ipynb) [![Made withJupyter](https://img.shields.io/badge/Made%20with-Jupyter-orange?style=for-the-badge&logo=Jupyter)](examples/ciclope_ex04_tetraFE_steelfoam_nonlinear_CalculiX.ipynb)
![](test_data/steel_foam/B_matrix_tetraFE_Nlgeom_results/PEEQ.gif)

The pipeline can be executed from the command line with:
```commandline
ciclope input.tif output.inp -vs 0.0065 0.0065 0.0065 --smooth -r 1.2 -t 90 --vol_mesh --tetrafe --template ./../input_templates/tmp_example02_tens_Nlgeom_steel.inp -v
```

The example shows how to:
- [x] Load and inspect synchrotron microCT volume data
- [x] Apply Gaussian smooth
- [x] Resample the dataset
- [x] Segment the steel
- [x] Remove unconnected clusters of voxels
- [x] Generate volume mesh of tetrahedra
- [x] Generate high-resolution mesh of triangles of the model outer shell (for visualization)
- [x] Convert the 3D binary to a tetrahedra-FE model for simulation in CalculX or Abaqus
  - [x] Non-linear, quasi-static analysis definition: tensile test with material plasticity. For more info visit: [github.com/mkraska/CalculiX-Examples](https://github.com/mkraska/CalculiX-Examples/blob/master/Drahtbiegen/Zug/Zug.inp)
  - [ ] Local material mapping
- [x] Launch simulation in Calculix
- [x] Convert Calculix output to .VTK for visualization in Paraview
- [x] Visualize simulation results in Paraview

## Acknowledgements
This project was partially developed during the Jupyter Community Workshop [“Building the Jupyter Community in Musculoskeletal Imaging Research”](https://github.com/JCMSK/2022_JCW) sponsored by [NUMFocus](https://numfocus.org/).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "ciclope",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "computed tomography, finite elements, image processing, engineering, simulation, biomechanics",
    "author": "Gigi Crimi",
    "author_email": "Gianluca Iori <gianthk.iori@gmail.com>, Martino Pani <martino.pani@port.ac.uk>, Alfonso Dario Santamaria <dariosantamaria99@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/d3/f7/6f56a59dc36ac8c4f9e0b5ac137f2ea79b915c0386ac607ba1c24af71743/ciclope-2.0.0.tar.gz",
    "platform": null,
    "description": "# ciclope\nComputed Tomography to Finite Elements.\n\n[![GitHub license](https://img.shields.io/github/license/gianthk/ciclope)](https://github.com/gianthk/ciclope/blob/master/LICENSE)\n[![PyPi Version](https://img.shields.io/pypi/v/ciclope.svg?style=flat-square)](https://pypi.org/project/ciclope/)\n[![PyPI pyversions](https://img.shields.io/pypi/pyversions/ciclope.svg?style=flat-square)](https://pypi.org/project/ciclope/)\n[![Documentation Status](https://readthedocs.org/projects/ciclope/badge/?version=latest)](https://ciclope.readthedocs.io/en/latest/?badge=latest)\n[![DOI](https://joss.theoj.org/papers/10.21105/joss.04952/status.svg)](https://doi.org/10.21105/joss.04952)\n\nMicro Finite Element (microFE) models can be derived from micro Computed Tomography (microCT) 3D images to non-destructively assess mechanical properties of biological or artificial specimens. <br />\n**ciclope** provides fully open-source pipelines from microCT data preprocessing to microFE model generation, solution and postprocessing. <br />\n\n## Installation\nFor mesh generation, `ciclope` requires [pygalmesh](https://github.com/meshpro/pygalmesh), a Python frontend to [CGAL](https://www.cgal.org/).\nFollow the [installation procedure](https://github.com/meshpro/pygalmesh#installation) for [CGAL](https://www.cgal.org/) and [Eigen](http://eigen.tuxfamily.org/index.php?title=Main_Page).\nAfter that, install pygalmesh with pip or conda\n```commandline\nconda install -c conda-forge pygalmesh\n```\nAfter installing pygalmesh, you can install `ciclope` using pip. The flag `[all]` will install optional dependencies needed to run full pipelines and examples.\n```commandline\npip install ciclope[all]\n```\n\nSome examples will require [DXchange](https://dxchange.readthedocs.io/en/latest/index.html). You can install it with\n```shell\nconda install -c conda-forge dxchange\n```\n### Testing\nTo verify your installation checkout this repository and run the tests with the command\n```commandline\ncd test\npython -m unittest -v test_ciclope.run_tests\n```\n### How to contribute\nIf you want to contribute to this project, please install `ciclope` following the [development guide](development.md).\n\n## Usage\n**ciclope** pipelines can be run from the command line as a script. Scroll down and take a look at the [Examples](###Examples) folder for this type of use.\nTo view the command line script help run\n```commandline\nciclope -h\n```\n\nTo use **ciclope** within python, import the package with\n```python\nimport ciclope\n```\n### Image pre-processing\n`ciclope.utils` contains functions that help you read and pre-process 3D datasets for FE model generation.\n\nRead 3D CT dataset stored as stack of TIFFs\n```python\nfrom ciclope.utils.recon_utils import read_tiff_stack\n\ninput_file = './test_data/LHDL/3155_D_4_bc/cropped/3155_D_4_bc_0000.tif'\n\ndata_3D = read_tiff_stack(input_file)\nvs = np.ones(3) * 0.06  # voxelsize [mm]\n```\n`read_tiff_stack` reads all TIFF files (slices) contained in the `input_file` folder. The volume is stored in a 3D [`numpy.ndarray`](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html) with size `[slices, rows, columns]`.\n\n---\nSegment and remove unconnected voxels\n```python\nfrom skimage import morphology\nfrom ciclope.utils.preprocess import remove_unconnected\n\nBW = data_3D > 142 # fixed global threshold\nBW = morphology.closing(BW, morphology.ball(2)) # optional step\nL = remove_unconnected(BW)\n```\n\n### Mesh and FE model generation\nIf you already have a mesh file, you can skip the mesh generation steps and use `ciclope` with 3D [`meshio`](https://github.com/nschloe/meshio) objects.\n\n#### voxel-FE\n![](test_data/trabecular_bone/trab_sample_mini3_UD3.png)\nGenerate unstructured grid mesh of hexahedra (voxels)\n```python\nimport ciclope\nmesh = ciclope.core.voxelFE.vol2ugrid(data_3D, vs)\n```\n\nGenerate CalculiX input file `.INP` for **voxel-FE** model of linear elastic compression test\n```python\ninput_template = \"./input_templates/tmp_example01_comp_static_bone.inp\"\nciclope.core.voxelFE.mesh2voxelfe(mesh, input_template, 'foo.inp', keywords=['NSET', 'ELSET'])\n```\n\n#### tetrahedra-FE\n![](test_data/steel_foam/B_matrix_tetraFE_mesh.png)\nGenerate mesh of tetrahedra. `ciclope` uses [`pygalmesh`](https://github.com/nschloe/pygalmesh) for tetrahedra mesh generation\n```python\nmesh = ciclope.core.tetraFE.cgal_mesh(L, vs, 'tetra', max_facet_distance=0.2, max_cell_circumradius=0.1)\n```\n\nGenerate CalculiX input file `.INP` for **tetrahedra-FE** model of non-linear tensile test\n```python\ninput_template = \"./input_templates/tmp_example02_tens_static_steel.inp\"\nciclope.core.tetraFE.mesh2tetrafe(mesh, input_template, 'foo.inp', keywords=['NSET', 'ELSET'])\n```\n\n### Postprocessing\n`ciclope.utils.postprocess.paraviewplot` calls [`ParaView`](https://www.paraview.org/) to generate and save plots of a chosen model scalar field.\n- Add path to your ParaView installation with\n```python\nimport sys\nsys.path.append('~/Applications/ParaView-5.9.0-RC1-MPI-Linux-Python3.8-64bit/lib/python3.8/site-packages')\n```\n\n- Plot midplanes of the vertical displacement field `UD3`\n```python\nciclope.utils.postprocess.paraview_plot('test_data/tooth/results/Tooth_3_scaled_2.vtk', slicenormal=\"xyz\",\n                                        RepresentationType=\"Surface\", Crinkle=True, ColorBy=['U', 'D2'], Roll=90,\n                                        ImageResolution=[1024, 1024], TransparentBackground=True,\n                                        colormap='Cool to Warm')\n```\n| | | |\n|:-------------------------:|:-------------------------:|:-------------------------:|\n|![](test_data/tooth/results/Tooth_3_scaled_2_UD3_XY.png) | ![](test_data/tooth/results/Tooth_3_scaled_2_UD3_XZ.png) | ![](test_data/tooth/results/Tooth_3_scaled_2_UD3_YZ.png) |\n\n- Plot midplanes of the Von Mises stress `S_Mises`\n```python\nciclope.utils.postprocess.paraview_plot(\"test_data/tooth/results/Tooth_3_scaled_2.vtk\", slicenormal=\"xyz\",\n                                        RepresentationType=\"Surface\", Crinkle=False, ColorBy=\"S_Mises\", Roll=90,\n                                        ImageResolution=[1024, 1024])\n```\n| | | |\n|:-------------------------:|:-------------------------:|:-------------------------:|\n|![](test_data/tooth/results/Tooth_3_scaled_2_S_Mises_XY.png) | ![](test_data/tooth/results/Tooth_3_scaled_2_S_Mises_XZ.png) | ![](test_data/tooth/results/Tooth_3_scaled_2_S_Mises_YZ.png) |\n\n\nSee the Jupyter Notebooks in the [examples section](https://github.com/gianthk/ciclope#examples) for more examples of 3D data and results visualization.\n\n## ciclope pipeline \nThe following table shows a general pipeline for FE model generation from CT data that can be executed from the command line with the `ciclope` script:\n\n| # | Step | Description | command line script flag |\n|:-:|:-|:-|:-|\n| 1. | **Load CT data** | | |\n| 2. | **Pre-processing** | Gaussian smooth | `--smooth` |\n| | | Resize image | `-r` |\n| | | Add embedding | (not implemented yet) |\n| | | Add caps | `--caps` |\n| 3. | **Segmentation** | Uses Otsu method if left empty | `-t` |\n| | | Remove unconnected voxels | |\n| 4. | **Meshing** | Outer shell mesh of triangles | `--shell_mesh` |\n| | | Volume mesh of tetrahedra | `--vol_mesh` |\n| 5. | **FE model generation** | Apply Boundary Conditions | |\n| | | Material mapping | `-m`, `--mapping` |\n| | | Voxel FE | `--voxelfe` |\n| | | Tetrahedra FE | `--tetrafe` |\n\n\n## Notes on ciclope\n* Tetrahedra meshes are generated with [pygalmesh](https://github.com/nschloe/pygalmesh) (a Python frontend to [CGAL](https://www.cgal.org/))\n* High-resolution surface meshes for visualization are generated with the [PyMCubes](https://github.com/pmneila/PyMCubes) module.\n* All mesh exports are performed with the [meshio](https://github.com/nschloe/meshio) module.\n* **ciclope** handles the definition of material properties and FE analysis parameters (e.g. boundary conditions, simulation steps..) through separate template files. The folders [material_properties](/material_properties) and [input_templates](/input_templates) contain a library of template files that can be used to generate FE simulations.\n  * Additional libraries of [CalculiX](https://github.com/calculix) examples and template files can be found [here](https://github.com/calculix/examples) and [here](https://github.com/calculix/mkraska)\n\n## Examples\n### [Example 1: voxel-uFE model of trabecular bone; linear compression test](examples/ipynb/ciclope_ex01_voxeluFE_CalculiX.ipynb) [![Made withJupyter](https://img.shields.io/badge/Made%20with-Jupyter-orange?style=for-the-badge&logo=Jupyter)](examples/old/ciclope_ex01_voxelFE_trabecularbone_CalculiX.ipynb)\n![](test_data/LHDL/3155_D_4_bc/results/LHDL_voxelFE_U3.png)\n\nThe pipeline can be executed from the command line with:\n```commandline\nciclope test_data/LHDL/3155_D_4_bc/cropped/3155_D_4_bc_0000.tif test_data/LHDL/3155_D_4_bc/results/3155_D_4_bc_voxelFE.inp -vs 0.0195 0.0195 0.0195 -r 2 -t 63 --smooth 1 --voxelfe --template input_templates/tmp_example01_comp_static_bone.inp --verbose\n```\n\nThe example shows how to:\n- [x] Load and inspect microCT volume data\n- [x] Apply Gaussian smooth\n- [x] Resample the dataset\n- [x] Segment the bone tissue\n- [x] Remove unconnected clusters of voxels\n- [x] Convert the 3D binary to a voxel-FE model for simulation in CalculX or Abaqus\n  - [x] Linear, static analysis; displacement-driven\n  - [X] Local material mapping (dataset Grey Values to bone Tissue Elastic Modulus)\n- [x] Launch simulation in Calculix\n- [x] Convert Calculix output to .VTK for visualization in Paraview\n- [x] Visualize simulation results in Paraview\n---\n### [Example 2: tetrahedra-uFE model of trabecular bone; linear compression test](examples/ipynb/ciclope_ex02_tetrauFE_CalculiX.ipynb) [![Made withJupyter](https://img.shields.io/badge/Made%20with-Jupyter-orange?style=for-the-badge&logo=Jupyter)](examples/ipynb/ciclope_ex02_tetrauFE_CalculiX.ipynb)\n![](test_data/LHDL/3155_D_4_bc/results/LHDL_tetraFE_U3.png)\n\nThe pipeline can be executed from the command line with:\n```commandline\nciclope test_data/LHDL/3155_D_4_bc/cropped/3155_D_4_bc_0000.tif test_data/LHDL/3155_D_4_bc/results/3155_D_4_bc.inp -vs 0.0195 0.0195 0.0195 -r 2 -t 63 --smooth 1 --tetrafe --max_facet_distance 0.025 --max_cell_circumradius 0.05 --vol_mesh --template input_templates/tmp_example01_comp_static_bone.inp\n```\n---\n### [Example #3 - tetrahedra-FE model of embedded tooth; compression test; heterogeneous materials](examples/ipynb/ciclope_ex03_tetraFE_tooth_CalculiX.ipynb) [![Made withJupyter](https://img.shields.io/badge/Made%20with-Jupyter-orange?style=for-the-badge&logo=Jupyter)](examples/ciclope_ex02_tetraFE_steelfoam_CalculiX.ipynb)\n![](test_data/tooth/results/Tooth_3_scaled_2_Smises2.png)\n---\n### [Example #4 - non-linear tetrahedra-FE model of stainless steel foam](examples/ipynb/ciclope_ex04_tetraFE_steelfoam_nonlinear_CalculiX.ipynb) [![Made withJupyter](https://img.shields.io/badge/Made%20with-Jupyter-orange?style=for-the-badge&logo=Jupyter)](examples/ciclope_ex04_tetraFE_steelfoam_nonlinear_CalculiX.ipynb)\n![](test_data/steel_foam/B_matrix_tetraFE_Nlgeom_results/PEEQ.gif)\n\nThe pipeline can be executed from the command line with:\n```commandline\nciclope input.tif output.inp -vs 0.0065 0.0065 0.0065 --smooth -r 1.2 -t 90 --vol_mesh --tetrafe --template ./../input_templates/tmp_example02_tens_Nlgeom_steel.inp -v\n```\n\nThe example shows how to:\n- [x] Load and inspect synchrotron microCT volume data\n- [x] Apply Gaussian smooth\n- [x] Resample the dataset\n- [x] Segment the steel\n- [x] Remove unconnected clusters of voxels\n- [x] Generate volume mesh of tetrahedra\n- [x] Generate high-resolution mesh of triangles of the model outer shell (for visualization)\n- [x] Convert the 3D binary to a tetrahedra-FE model for simulation in CalculX or Abaqus\n  - [x] Non-linear, quasi-static analysis definition: tensile test with material plasticity. For more info visit: [github.com/mkraska/CalculiX-Examples](https://github.com/mkraska/CalculiX-Examples/blob/master/Drahtbiegen/Zug/Zug.inp)\n  - [ ] Local material mapping\n- [x] Launch simulation in Calculix\n- [x] Convert Calculix output to .VTK for visualization in Paraview\n- [x] Visualize simulation results in Paraview\n\n## Acknowledgements\nThis project was partially developed during the Jupyter Community Workshop [\u201cBuilding the Jupyter Community in Musculoskeletal Imaging Research\u201d](https://github.com/JCMSK/2022_JCW) sponsored by [NUMFocus](https://numfocus.org/).\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 Gianluca Iori  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Computed Tomography to Finite Elements",
    "version": "2.0.0",
    "project_urls": {
        "Home": "https://github.com/gianthk/ciclope"
    },
    "split_keywords": [
        "computed tomography",
        " finite elements",
        " image processing",
        " engineering",
        " simulation",
        " biomechanics"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c8a6239a5f2ae33c3b50115a0608afd25160cb79c049dd2b04ee335e8a6746d9",
                "md5": "b8d54dbb89dd1f131404d08584c763d5",
                "sha256": "2a3f68033a53d66410e1ef475a571d5a7f387210b798c703b7985e13f657a275"
            },
            "downloads": -1,
            "filename": "ciclope-2.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b8d54dbb89dd1f131404d08584c763d5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 39538,
            "upload_time": "2024-12-20T15:20:25",
            "upload_time_iso_8601": "2024-12-20T15:20:25.726523Z",
            "url": "https://files.pythonhosted.org/packages/c8/a6/239a5f2ae33c3b50115a0608afd25160cb79c049dd2b04ee335e8a6746d9/ciclope-2.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d3f76f56a59dc36ac8c4f9e0b5ac137f2ea79b915c0386ac607ba1c24af71743",
                "md5": "90210e2b8220f921f427c092aaf10262",
                "sha256": "d6ceff138f4b8647bff61f503a85c05b8e8d231fe1ab57f42b189b3c346bcf39"
            },
            "downloads": -1,
            "filename": "ciclope-2.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "90210e2b8220f921f427c092aaf10262",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 42329,
            "upload_time": "2024-12-20T15:20:28",
            "upload_time_iso_8601": "2024-12-20T15:20:28.355127Z",
            "url": "https://files.pythonhosted.org/packages/d3/f7/6f56a59dc36ac8c4f9e0b5ac137f2ea79b915c0386ac607ba1c24af71743/ciclope-2.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-20 15:20:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "gianthk",
    "github_project": "ciclope",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "ciclope"
}
        
Elapsed time: 0.43947s