function[im3, im] = dilation(im, mask , dilSize)

W = dilStructure(dilSize);
im3 = imdilate(mask, W);
indx = find(im3 == 1);

[m n] = size(im3);
for i=1:m
    for j=1:n
        if im3(i,j)
        im(i,j,1) = 0;
        im(i,j,2) = 0;
        im(i,j,3) = 0;
        end
    end
end

end
