Commit f41f7d07 authored by ac_21's avatar ac_21

check for d(idx), threshold phase mask dilation

parent e7483b57
......@@ -117,10 +117,11 @@ else
rp=[];
end
d=bwdist(~logical(L));
% final CC pass
for n=1:num
idx=find(L==n);
if length(idx)<2*min_area_pixels
if length(idx)<2*min_area_pixels || max(d(idx))<min_radius_pixels/2
continue
end
newCell=Segment.frameSegment_create(idx,size(bw),chan,t);
......
......@@ -47,10 +47,15 @@ if segParams.isPhase
bw=imclose(bw,se2);
if true==segParams.wellRadius
bwMask=imbinarize(medianMask,adaptthresh(medianMask,'statistic','gaussian'));
seMask=strel('disk',ceil(2*min_radius_pixels));
bwMask=imdilate(bwMask,se2);
bwMask==imdilate(bwMask,se2);
bw=bw&~bwMask;
bwMask=imdilate(bwMask,seMask);
bwh=imfill(bw,'holes');
nrep=0;
while nrep<5 && length(find(bwh&~bw))/length(bw(:))>0.25
nrep=nrep+1;
bwMask=imdilate(bwMask,se);
bw=bw&~bwMask;
end
bwLog=bwLog&~bwMask;
end
bw=imfill(bw,'holes');
......
No preview for this file type
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment