malloc47 / matsciseg

Algorithms for materials science image segmentation -- BEWARE: ugly research code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

matsciseg

materials science image segmentation algorithms

Dependencies

  • Python 2.7 (go here for instructions to setup python 2.7 on machines with older versions of python)

  • OpenCV with Python bindings (tested with 2.3.1 and 2.4.3)

  • All packages under requirements.txt, preferably installed into a virtualenv. A bug in some numpy/scipy package dependencies might mandate that numpy be installed manually

  • (optional) wxWidgets (must be manually compiled and installed into virtualenv) to use the now-deprecated graphical interface

  • GCO compiled as a static library--patches for specific files, as well as a makefile that will build the shared library on linux are available under gco_extra.

  • Tested on Debian Stable (Squeeze), Fedora 15, Arch Linux

Setup

virtualenv --no-site-packages ~/.virtualenv
source ~/.virtualenv/bin/activate
# compile/install opencv and make it available to the virutalenv
pip install numpy==1.6.2 # fix circular dependency
pip install -r requirements.txt
make # fetches submodules, builds gco, and compiles gco wrappers

Use

A command line interface (matscicli.py) and a web interface (webgui/manage.py runserver) are available.

The CLI relies upon different "recipes" in the recipes.py file, which can be easily customized as needed. Its arguments are documented upon invocation. The "label" files are plain text files with rows (separated by newlines) of integers (separated by whitespace) for each row of pixels in the corresponding image. Sample invocations are shown in tests/tests.sh. The sample.sh script will run the global algorithm on the data found in sample/ to produce a file sample/0001-output.png, which is a good sanity check that all is working as it should be.

The web interface requires volumes made of sequences of images each with a label initialization (same format as above) converted into individual numpy *.npz files. This can be done with the included wrap_labels.py script. Placing these in webgui/data/[data-name]/*.npz will allow the web interface to find the data. To initialize the web interface, simply navigate to the webgui folder, run

./manage runserver

and navigate to http://localhost:8000.

References

Techniques used in this package are described in:


Jarrell Waggoner
/-/ malloc47.com

About

Algorithms for materials science image segmentation -- BEWARE: ugly research code


Languages

Language:Python 78.3%Language:JavaScript 12.8%Language:C++ 5.3%Language:Shell 2.9%Language:CSS 0.6%Language:C 0.2%