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).
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
If you have an NVIDIA GPU, you can accelerate all operations with CUDA.
luarocks install cutorch
luarocks install cunn
The code supports .tif and .tiff format, but you need to install the following package:
apt-get install libgraphicsmagick1-dev
luarocks install graphicsmagick
th predict.lua --imageFile 'image/raw.png' --outputdir 'output'
Here is an example of the input and output
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.