Commit a63641f7 authored by Andrew Cohen's avatar Andrew Cohen

thresholdImages - phase mask handling dilation and open

parent 0cfb431f
......@@ -42,20 +42,21 @@ if segParams.isPhase
bw=imbinarize(im,T);
if segParams.isPhase>0
bw=imcomplement(bw);
end
% bw=imopen(bw,se);
end
bw=imclose(bw,se2);
if true==segParams.wellRadius
bwMask=imbinarize(medianMask,adaptthresh(medianMask,'statistic','gaussian'));
bwMask==imdilate(bwMask,se2);
bw=bw&~bwMask;
bwh=imfill(bw,'holes');
nrep=0;
% if the mask forms a solid circle, the hole fill on bw will fill
% in the whole foreground. dilate mask until that doesn't happen...
while nrep<5 && length(find(bwh&~bw))/length(bw(:))>0.25
nrep=nrep+1;
bwMask=imdilate(bwMask,se);
bw=bw&~bwMask;
end
bw=imopen(bw,se);
bwLog=bwLog&~bwMask;
end
bw=imfill(bw,'holes');
......
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