function image = getShift(extimage, dx, dy, size)
% return an image shifted by dx,dy
% extimage must be replicateBounds(image0,size,size)

[row col] = size(extimage);
maxshift = (row-size(1))/2;

%[row col a b] = size(stack);
%image = stack(:,:,dx+round(a/2),dy+round(a/2));

image = extimage(...
   (maxshift+dx+1):(maxshift+dx+size(1)),...
   (maxshift+dy+1):(maxshift+dy+size(2))...
   );   

