functional version of watershed from DVID