level set methods use level sets as a tool for numerical analysis of surfaces and shapes. When they were developed (Osher and Sethian), they supposed a simple and versatile method for computing and analyzing the motion of an interface in two or three dimensions. The big advantage of such methods is that one can perform numerical computations involving curves and surfaces on a fixed Cartesian grid without having to parameterize these objects. I attack a website with an explanation of the level set approach.
Moreover, different studies have developed Matlab algorithms to level set based automatic retinal vasculature segmentation (i.e., Dizdaro et al., 2012). You can contact with authors if you need the code. Finally, in Matlab, the activecontour function uses a level-set based segmentation algorithm which can be useful for your purpose.