function [xsel_orig, ysel_orig] = mapbacktooriginalcoords( xsel, ysel, anchorlines);

ysel = round(ysel);
anchorpoints = anchorlines(ysel,:,1);
[dummy, sortindex] = sort(anchorpoints);

xsel_orig = interp1( anchorlines(ysel,sortindex,2), anchorlines(ysel,sortindex,1), ...
	 xsel,'linear','extrap');
ysel_orig = ysel;

