function [xsel_new, ysel_new] = maptonewimage( xsel, ysel, anchorlines);

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

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

