function [I index]=shift_image(I,shift)
dimx = size(I,2);
if(shift >=0)
    shift=shift+1;
    I(:,shift:dimx,:) = I(:,1:dimx-shift+1,:);
    I(:,1:shift-1,:) = 0;
    index=[1,shift-1];
else
    if(shift<0)
        shift=shift-1;
        I(:,1:dimx+shift+1,:) = I(:,-shift:dimx,:);
        I(:,dimx+shift+2:dimx,:) = 0;
        index=[dimx+shift+2 dimx];
    end
end
end