The function to find the boundary of the data works but unfortunately there are separate connected components without measured data, some some tweaking has to be done.