Skip to content
forked from EIT-team/Mesher

CGAL based FEMs for EIT from segmentation files

License

Notifications You must be signed in to change notification settings

carlpan937/Mesher

 
 

Repository files navigation

Build Status

EIT-Mesher

EIT-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).

Rat Brain Mesh

Example Usage
Unit Cube - 'Hello World' example
Meshing segmented brain data
Meshing from STL file
Mesh refinement examples
Mesh deformation

Using the Meshes

Examples for using the EIT-MESHER outputs with common EIT and DOT solvers are given in solvers examples

Build instructions (tested on Ubuntu 16, 17, 18)

  • Install dependencies
sudo apt-get install build-essential cmake libcgal-dev libcgal-qt5-dev libglu1-mesa libxi-dev libxmu-dev libglu1-mesa-dev
  • Clone repository
git clone https://github.com/EIT-team/Mesher.git
  • Make build & output directories
cd Mesher
mkdir build
mkdir output
  • Compile
cd build
cmake ..
make
  • Test
cd ../test/
./run_tests
  • Run mesher ( from /Mesher root directory)
Usage:
./bin/mesher -i INPUT_INR -e INPUT_ELECTRODES -p INPUT_PARAMETERS
        -i input image file
        -e electrode position file
        -p parameter file
        -o output mesh name (default = new_mesh)
        -d output directory (default = output/)

Example:

./bin/mesher -i inputs/input.inr -e inputs/Electrodes.txt -p inputs/params.txt

Produces the following mesh as viewed in paraview

Brain Example

Docker instructions (for Ubuntu 19&20+)

EIT-MESHER can be built in a container to install on newer linux installations. Windows users require WSL2 for docker to work.

Install container

The docker container can be obtained using two different methods:

  • Build container from source (mesher is a name of your choice):
docker build -t mesher .
  • Pull image directly from dockerhub without having to build
docker pull doctorjimbles/eit-mesher

Running Mesher from container

To test 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:

docker run --rm mesher

The --rm flag removes the container after its done to prevent having lots of unnecessary container IDs.

The mesher can then be called with the parameter arguments as normal Note these are files inside the container.

docker run --rm mesher -i inputs/input.inr -e inputs/Electrodes.txt -p inputs/params.txt
  • Using your own data - mounting volumes

The container has two volumes /input and /output which can be mounted to a directory on the host using the -v flag. So for example with the MESHER repository on the home dir:

docker run --rm -v ~/Mesher/inputs:/input -v ~/Mesher/output:/output  mesher

The mesher can then finally be called by combining the volume definitions and the parameters. Note The directories must be with respect to the container file structure

docker run --rm  -v ~/Mesher/inputs:/input -v ~/Mesher/output:/output  mesher -i /input/input.inr -e /input/Electrodes.txt -p /input/params.txt -d /output/ -o dockertest

About

CGAL based FEMs for EIT from segmentation files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 90.8%
  • MATLAB 6.9%
  • CMake 1.9%
  • Other 0.4%