MATLAB: Reference for use of imfill

imfill

I have used the command
BW2 = imfill(BW,'holes')
for some of my code. I would like to know how this code works so that i have an idea what the program is doing. Does anyone know what the method/technique/procedure that imfill is using is called? Does anyone have a good reference for the method that Matlab is using for imfill?

Best Answer

edit imfill
and look near line 125, "if do_fillholes"