OIR Segmentation
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
model
sample
script
src
.gitignore
README.md
doPredict.lua
predict.lua
predict_batch.lua
train.lua

README.md

OIR segmentation

This is the code to train a CNN to do the segmentation of the vaso-obliteration zone and the neovascular tufts/clusters in the images obtained from the mouse model of oxygen-induced retinopathy (OIR).

Setup

All code is implemented in Torch.

First install Torch, then update / install the following packages:

luarocks install torch
luarocks install nn
luarocks install nngraph
luarocks install image
luarocks install gnuplot

(Optional) GPU Acceleration

If you have an NVIDIA GPU, you can accelerate all operations with CUDA.

luarocks install cutorch
luarocks install cunn

.tif, .tiff support

The code supports .tif and .tiff format, but you need to install the following package:

apt-get install libgraphicsmagick1-dev
luarocks install graphicsmagick

Run segmentation on new image

Single image

th predict.lua --imageFile 'image/raw.png' --outputdir 'output'

Here is an example of the input and output

Batch images

th predict_batch.lua --imageFolder 'sample/batch' --outputdir 'output'

The program will process all the images in the given "imageFolder", including all the subfolders. The folder structure will be copied to the given "outputdir", and the segmenation results will be saved in a "result" folder in each corressponding directories.