Skip to content
Snippets Groups Projects
Commit 22458440 authored by ac 20's avatar ac 20
Browse files

fill holes after segReduce

parent 66e41519
No related branches found
No related tags found
No related merge requests found
...@@ -89,6 +89,9 @@ end ...@@ -89,6 +89,9 @@ end
% allocateShake (below) assigns each discarded pixel to it's closest % allocateShake (below) assigns each discarded pixel to it's closest
% touching segmentation using a morphological region fill % touching segmentation using a morphological region fill
bw=Segment.aiAreaOpen(bw,min_radius_pixels); bw=Segment.aiAreaOpen(bw,min_radius_pixels);
if ~segParams.isPhase
bw=bw|imfill(bw,'holes');
end
bw2=bw; bw2=bw;
bPhaseReduce=segParams.isPhase || segParams.bCytoplasmic; bPhaseReduce=segParams.isPhase || segParams.bCytoplasmic;
% if prod(size(im))>1e9 % if prod(size(im))>1e9
...@@ -96,18 +99,12 @@ bPhaseReduce=segParams.isPhase || segParams.bCytoplasmic; ...@@ -96,18 +99,12 @@ bPhaseReduce=segParams.isPhase || segParams.bCytoplasmic;
% bPhaseReduce=true; % bPhaseReduce=true;
% end % end
bw=Segment.segReduce(bw,bwLog,bPhaseReduce,min_area_pixels,min_radius_pixels); bw=Segment.segReduce(bw,bwLog,bPhaseReduce,min_area_pixels,min_radius_pixels);
if ~segParams.isPhase if ~segParams.isPhase
bw=bw|imfill(bw,'holes'); bw=bw|imfill(bw,'holes');
end end
% if prod(size(im))<1e9
[L,num,bwBoundary]=Segment.allocateShake(bw,bw2,min_radius_pixels,segParams); [L,num,bwBoundary]=Segment.allocateShake(bw,bw2,min_radius_pixels,segParams);
[L2]=bwlabeln(bw2); % used to mark original cc for segCC field [L2]=bwlabeln(bw2); % used to mark original cc for segCC field
% else
% [L,num]=bwlabeln(bw);
% L2=L;
% end
if bEnsemble if bEnsemble
if size(bw,3)>1 if size(bw,3)>1
...@@ -129,6 +126,9 @@ end ...@@ -129,6 +126,9 @@ end
CC=bwconncomp(L); CC=bwconncomp(L);
for n=1:num for n=1:num
idx=CC.PixelIdxList{n}; idx=CC.PixelIdxList{n};
if length(idx)<3
continue
end
if is3D(im) if is3D(im)
newCell=Segment.frameSegment_create_3D(idx,size(bw),chan,t); newCell=Segment.frameSegment_create_3D(idx,size(bw),chan,t);
else else
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment