function [imagex_align_new] = plot_two_gels_2dalign(imagex_align, ...
xsel_ladder,  xsel,diagonalline,imagex_align2, xsel_ladder2, xsel2,diagonalline2);
%  xsel2 = load('saverd138c_Abomb_5prime_Unfold','xsel')   %
%
%  variables with "2" are the target gel (equivalent to "first") 
%  onto which the current gel
%  needs to be threaded.  
%
%
%  load 'savemk84_Abomb_5prime_Unfold'

goodpoints = intersect(find(xsel_ladder2>0) , ...
		       find(xsel_ladder>0));

numpixelsX = size(imagex_align,2);

mapaxisX = interp1( xsel_ladder(goodpoints), ...
		    xsel_ladder2(goodpoints), 1:numpixelsX, ...
		    'linear','extrap');


goodpoints = intersect(find(xsel2>0) , ...
		       find(xsel>0));

numpixelsY = size(imagex_align,1);

[dummy,strongband] =  min(  (diagonalline - min(xsel_ladder)).^2);
[dummy,strongband2] = min(  (diagonalline2- min(xsel_ladder2)).^2);

mapaxisY = interp1( [xsel(goodpoints) strongband ], ...
		    [xsel2(goodpoints) strongband2], 1:numpixelsY, ...
		    'linear','extrap');

imagex_align_new = interp2(imagex_align2,mapaxisX,mapaxisY');

figure(2)
subplot(1,2,1)
image(imagex_align);
subplot(1,2,2);
image(imagex_align_new);