function [l_img] = getDistLevel2_gus(image,segcell, segdna ,numlevels,check)
%What is this function supposed to do? grj 10/4/14

if ~exist('check','var')
   check = 1;
end

image = segcell.*image;

[D,L] = bwdist(~segcell);
%unique_D = unique(D);
%unique_D(1) = [];

l_img = segcell*0;

ww = find(segdna>0);
D(ww) = -1;
m_level = linspace(1,max(D(:)),numlevels+1);

for i=1:numlevels
   
    ww = find( D >= m_level(i) & D<m_level(i+1) );
    l_img(ww) = i;
end

