Image segmentation method based on the fast marching method
Feel free to email me with any questions (log in to GitHub to see email).
All code used in the manuscript is available upon request. Here we provide basic code that segments and runs out routine on an example wing.
Segment Wing Image -Code and example wing used to segment wings in the manuscript. Optimization -Code used to perform area-weighted circularity optimization
All Python Code Python v 2.7 Anaconda makes installing all packages easy. All Mathematica code works in Mathematica 10 and 11 Dependencies:
numy, scipy, Pillow, matplotlib
scikit-fmm [https://github.com/scikit-fmm/scikit-fmm]
scikit-image [http://scikit-image.org/]
Installation of dependencies on clean Ubuntu build
pip install numpy
pip install scipy
pip install Pillow
pip install matplotlib
pip install scikit-fmm
pip install scikit-image
Code can be easily parallelized to run on many wing images simultaneously using
mpi4py
glob
Once dependencies installed:
cd Segment_Wing_Image
python generate_seeds_and_velocity.py
python segment.py
python mask_image.py
cd ..
Open Mathematica Notebook for Polygonization and Optimization routines.
Here is an example of a wide range of segmented biological images. These are taken from the SI of Hoffmann and Donoughe, et al, PNAS 2018. For another project, I was able to help a group segment the following image:
Katia Bertoldi's group was looking at the properties of compressed structures that were initially composed of a grid of disc-shaped holes. During compression, the holes gained an orientation, either parallel or perpendicular to the axis of compression.
However, studying the geometric properties of the holes during the compression was not a trivial segmentation task.
As the material compressed, the holes would get smaller, at some point becoming nearly invisible.
Additionally, the center of the holes would come in contact before either side, resulting in shapes that appeared to be two objects rather than one. The lighting and the material made it increasingly difficult to use off-the-shelf segmentation tools.
However, by modifying my tool, I was able to create extremely accurate segmentations for nearly the entire duration of the video.
By initializing each hole with 4 different seeds, I performed a level set segmentation up until some maximum time,