function [sar, inc, mask] = Mask(sar, inc)
%sar, inc are the output of Coreg - sar(ii) and inc(ii) match.

Plotsite(sar, inc);
ax(1) = gca;

figure;
imagesc(sar(:,:,1), [0,1]); colormap(gray);
ax(2) = gca;
linkaxes(ax);

roi = imfreehand; %interactively draw the roi on the fixed SAR image
mask = createMask(roi); %creates the image mask

close

for i = 1:size(sar,3)
    mask(sar(:,:,i) <= 0) = false;
end

repmask = repmat(mask,1,1,size(sar,3));

% ind = find(~repmask);
% ind0 = find(sar <= 0);
% indm = find(~maskroi);
% indf = [ind0;indm];

sar(~repmask) = NaN;
inc(~repmask) = NaN;

end

