Commit 689e8344 authored by ac_22's avatar ac_22

Merge branch 'master' of git-bioimage.coe.drexel.edu:bioimage/leverjs

parents 784ec5b7 b49385ec
function bMitosis=checkMitosis(p,c1,c2,CONSTANTS,imCache)
bMitosis=~Ensemble.bCellsOverlap(p,c1,size(imCache.im)) && ~Ensemble.bCellsOverlap(p,c2,size(imCache.im));
bMitosis=~Ensemble.bCellsOverlap(p,c1,size(imCache.im)) || ~Ensemble.bCellsOverlap(p,c2,size(imCache.im));
4;
\ No newline at end of file
......@@ -39,6 +39,7 @@ end
override=fscanf(fid,'%s');
fclose(fid);
override=strrep(override,'\','\\');
override=jsondecode(override);
leverFile=fullfile(override.ROOT,[CONSTANTS.imageData.DatasetName '.h5']);
if exist(leverFile,'file')
......
......@@ -137,8 +137,9 @@ if ~is3D(im)
fprintf(2,'ACK frameSegment: boundaries and num components !=\n');
end
end
CC=bwconncomp(L);
for n=1:num
idx=find(L==n);
idx=CC.PixelIdxList{n};
if length(idx)<area_min|| max(d(idx))<dmin
continue
end
......
......@@ -19,24 +19,19 @@ nIter=100; %10*max(min_radius_pixels);
for nDilate=1:nIter
bwKernels=bwOut&~bwLog;
bwKernels=bwareaopen(bwKernels,minKernelArea);
% if isempty(find(bwKernels, 1))
% break;
% end
%
L=bwlabeln(bwKernels);
workingL=bwlabeln(bwOut);
CC=bwconncomp(bwOut);
workingL=double(labelmatrix(CC));
% 3 things can happen: (0) CC s (1) CC disappears (2) CC splits
idxWL=find(workingL);
idxWL=vertcat(CC.PixelIdxList{:});
map=unique([workingL(idxWL),L(idxWL)],'rows');
map(map(:,2)==0,:)=[];
% h=histogram(map(:,1),[0.5:max(map(:,1))+0.5]);
% mapCounts=h.Values;
mapCounts=hist(map(:,1),[1:max(map(:,1))])';
idxChange=find(mapCounts>1);
for i=1:length(idxChange)
% copy over new objects to bwOut
idxMap=find(map(:,1)==idxChange(i),1,'first');
idx=find(workingL==map(idxMap,1));
idx=CC.PixelIdxList{map(idxMap,1)};
bwOut(idx)=logical(L(idx));
end
......@@ -47,14 +42,9 @@ for nDilate=1:nIter
bwLog=imdilate(bwLog,se);
end
4;
function bwReduce=phaseReduce(bw,bwLog,min_radius_pixels)
% min_radius_pixels=min_radius_pixels(1);
% se=strel('disk',ceil(min_radius_pixels/2));
% bwLogHoles=imclose(bwLog,se);
bwLogHoles=bwLog;
bwLogHoles=imfill(bwLogHoles,'holes')&~bwLogHoles;
bwReduce=bw&bwLogHoles;
......
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