{"id":13422170,"url":"https://github.com/EIT-team/Mesher","last_synced_at":"2025-03-15T11:31:26.112Z","repository":{"id":35570818,"uuid":"39842966","full_name":"EIT-team/Mesher","owner":"EIT-team","description":"CGAL based FEMs for EIT from segmentation files","archived":false,"fork":false,"pushed_at":"2020-11-03T13:20:25.000Z","size":58606,"stargazers_count":11,"open_issues_count":14,"forks_count":4,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-07-31T23:44:43.032Z","etag":null,"topics":["cgal","electrical-impedance-tomography","meshes","meshing","segmentation"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EIT-team.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-28T15:42:17.000Z","updated_at":"2023-12-30T11:12:53.000Z","dependencies_parsed_at":"2022-09-17T23:01:01.529Z","dependency_job_id":null,"html_url":"https://github.com/EIT-team/Mesher","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EIT-team%2FMesher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EIT-team%2FMesher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EIT-team%2FMesher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EIT-team%2FMesher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EIT-team","download_url":"https://codeload.github.com/EIT-team/Mesher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221572067,"owners_count":16845574,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cgal","electrical-impedance-tomography","meshes","meshing","segmentation"],"created_at":"2024-07-30T23:00:38.493Z","updated_at":"2025-03-15T11:31:26.105Z","avatar_url":"https://github.com/EIT-team.png","language":"C++","funding_links":[],"categories":["Modeling and Meshes"],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/EIT-team/Mesher.svg?branch=master)](https://travis-ci.org/EIT-team/Mesher)\n# EIT-Mesher\n\nEIT-MESHER is C++ software, based on the CGAL library, which generates high quality Finite Element Model tetrahedral meshes from binary masks of 3D volume segmentations. Originally developed for biomedical applications in Electrical Impedance Tomography (EIT) to address the need for custom, non-linear refinement in certain areas (e.g. around electrodes), EIT-MESHER can also be used in other fields where custom FEM refinement is required, such as Diffuse Optical Tomography (DOT).\n\n\u003cimg src = \"./examples/brain/figures/brain_PV_HR.png\" alt=\"Rat Brain Mesh\" width = 600\u003e\n\n[Example Usage](./examples/readme.md)  \n[Unit Cube - 'Hello World' example](./examples/unitcube/readme.md)  \n[Meshing segmented brain data](./examples/brain/readme.md)  \n[Meshing from STL file](./examples/neonatescalp/readme.md)  \n[Mesh refinement examples](./examples/refinements/readme.md)  \n[Mesh deformation](./examples/deformation/readme.md)\n\n## Citing this work\n\nIf you use this repository please cite the accompanying [JORS article](http://doi.org/10.5334/jors.321)\n\n```text\nDowrick, T., Avery, J., Faulkner, M., Holder, D. and Aristovich, K., 2020. EIT-MESHER – Segmented FEM Mesh Generation and Refinement. Journal of Open Research Software, 8(1), p.27. DOI: http://doi.org/10.5334/jors.321\n```\n\n## Using the Meshes\n\nExamples for using the EIT-MESHER outputs with common EIT and DOT solvers are given in [solvers examples](examples/solvers)\n\n## Build instructions (tested on Ubuntu 16, 17, 18 and WSL 1\u00262)\n\n* Install dependencies\n\n```bash\nsudo apt-get install build-essential cmake libcgal-dev libcgal-qt5-dev libglu1-mesa libxi-dev libxmu-dev libglu1-mesa-dev\n```\n\n* Clone repository\n\n```bash\ngit clone https://github.com/EIT-team/Mesher.git\n```\n\n* Make build \u0026 output directories\n\n```bash\ncd Mesher\nmkdir build\nmkdir output\n```\n\n* Compile\n\n```bash\ncd build\ncmake ..\nmake\n```\n\n* Test\n\n```bash\ncd ../test/\n./run_tests\n```\n\n* Run mesher ( from /Mesher root directory)\n\n```bash\nUsage:\n./bin/mesher -i INPUT_INR -e INPUT_ELECTRODES -p INPUT_PARAMETERS\n        -i input image file\n        -e electrode position file\n        -p parameter file\n        -o output mesh name (default = new_mesh)\n        -d output directory (default = output/)\n```\n\nExample:\n\n```bash\n./bin/mesher -i inputs/input.inr -e inputs/Electrodes.txt -p inputs/params.txt\n```\n\nProduces the following mesh as viewed in paraview\n\n![Brain Example](examples/brain/figures/brain_PV.png)\n\n## Docker instructions (for Ubuntu 19\u002620+, macOS)\n\nEIT-MESHER can be built in a container to install on newer Linux installations. Windows users require WSL2 for docker to work.\n\n### Install container\n\nThe docker container can be obtained using two different methods:\n\n* Build container from source (`mesher` is a name of your choice):\n\n```bash\ndocker build -t mesher .\n```\n\n* Pull image directly from dockerhub without having to build, renaming the container to `mesher` (or name of your choice) :\n\n```bash\ndocker pull doctorjimbles/eit-mesher\ndocker image tag doctorjimbles/eit-mesher:latest mesher:latest\n```\n\n### Running Mesher from container\n\nTo test if it is working run the container with no inputs, this will call the mesher with defaults which runs the single example included in the container:\n\n```bash\ndocker run --rm mesher\n```\n\nThe `--rm` flag removes the container after its done to prevent having lots of unnecessary container IDs.\n\nThe mesher can then be called with the parameter arguments as normal **Note** these are files *inside* the container.\n\n```bash\ndocker run --rm mesher -i inputs/input.inr -e inputs/Electrodes.txt -p inputs/params.txt\n```\n\n* Using your own data - mounting volumes\n\nThe container has two **root** directories `/in` and `/out` which can be mounted as volumes to map to directories on the host using the `-v` flag. So for example, if we had the `MESHER` repository in our home dir we would add the flags:\n\n```bash\n -v ~/Mesher/inputs:/in -v ~/Mesher/output:/out\n```\n\nThe mesher can then finally be called by combining the volume definitions and then directing the mesher at the new input location `/in/`. **Note** Parameters given must be with respect to the container file structure. So for example, to make the default mesh but using the inputs files in the repository on the host machine (assuming it is stored in /home/user/Mesher):\n\n```bash\ndocker run --rm  -v ~/Mesher/inputs:/in -v ~/Mesher/output:/out  mesher -i /in/input.inr -e /in/Electrodes.txt -p /in/params.txt -d /out/ -o dockertest\n```\n\nThis will result in an output mesh `dockertest` in `/home/user/Mesher/output`.\n\nTo run the NN scalp example (still assuming this repository is stored in /home/user/Mesher)\n\n```bash\ndocker run --rm  -v ~/Mesher/examples/neonatescalp/:/in -v ~/Mesher/examples/neonatescalp/output:/out  mesher -i /in/NNscalp.inr -e /in/NNscalp_elecINRpos.txt -p /in/NNscalp_param.txt -d /out/ -o dockertestNN\n```\n\n* Improving slow file write on some systems\n\nIn some systems (reported on macOS 10.15.6, Docker Desktop 2.3.0.4, Docker Engine 19.03.12) it is much slower writing files into the mapped volume. Therefore to improve performance, it is possible to call the mesher and copy the files out afterwards. To do this we remove the `--rm` flag as we want to keep it, and add the `--name` flag to give it a name that makes more sense to us. We also drop the `-v` flag for the `\\out` folder.\n\n```bash\ndocker run --name NNmesher  -v ~/Mesher/examples/neonatescalp/:/in mesher -i /in/NNscalp.inr -e /in/NNscalp_elecINRpos.txt -p /in/NNscalp_param.txt -d /out/ -o dockertestNN\n```\n\nThe mesher files can then be copied outside of the container\n\n```bash\ndocker cp NNmesher:/out ./newoutputdir\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEIT-team%2FMesher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FEIT-team%2FMesher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEIT-team%2FMesher/lists"}