Julia software for detecting the cornea in a fluorescence image. This was developed and run in Julia 1.5.3, with the packages and versions listed in the Manifest.toml
file.
See the documentation on the package manager if you need additional information.
- (optional) Create a directory, which I will designate here as
foo
. - Start Julia.
- Enter
using Pkg
. - (recommended) Enter
pkg"activate foo"
. This creates a separate environment for the software, to help avoid dependency version conflicts. - Enter
pkg"add https://github.com/tobydriscoll/cornea-detection"
. This will download all required dependencies, which will take a few minutes.
If you created a dedicated environment for installation, you will have to follow the process above to activate it in each new Julia session. Then enter
using CorneaDetection
On the first invocation it will take several minutes to compile all the dependencies. Loading should be much faster after that.
The fundamental entry point is the detect
method. Running detect(img)
for image img
performs the cornea detection and returns a named tuple with these primary fields:
cenrow
row location of the cornea center, normalized by the image heightcencol
column location of the cornea center, normalized by the image heightradius
radius of the cornea center, normalized by the image height
There are additional diagnostic fields you can ignore.
If you run detect(folder)
with folder
being a vector of file names, the images will be processed serially. In this mode, the final state of one image is used as a candidate initial state for the next one, making a continuous transition more likely for the optimizer.
The file src/parameters.jl
defines parameter values that affect the behavior of the algorithm. Some may need to be adjusted to get the most consistent results on a new data set. The most important ones may be those related to automatic detection of the Purkinje image, which is used to find candidates to initialize the optimization.
You can find sample data from two videos to try out the algorithms.