Commit f394a32f authored by ac 20's avatar ac 20

cmdSegment - don't redo cellDistance if segmentation not run

parent b49385ec
......@@ -13,13 +13,14 @@ fprintf(1,'segmenting frame %d to %d\n',tStart,tEnd);
for t=tStart:tEnd
% don't run segment on frames that already have segmentations
% need to use reseg for that
bChangedSegmentation=false;
for a=1:length(qAlgorithms)
algorithmInfo=jsondecode(qAlgorithms{a});
if segmentationExists(conn,algorithmInfo,t)
continue
end
bChangedSegmentation=true;
functionName=algorithmInfo.function;
if '+'==functionName(1)
functionName(1)=[];
......@@ -35,7 +36,9 @@ for t=tStart:tEnd
Write.updateSegmentationConstants(conn,CONSTANTS);
end
Distance.cellDistance(conn,CONSTANTS,t,[t-2:t+2]);
if bChangedSegmentation
Distance.cellDistance(conn,CONSTANTS,t,[t-2:t+2]);
end
end
function bExists = segmentationExists(conn,algorithmInfo,t)
......
......@@ -24,7 +24,7 @@ end
if isempty(p)
p=parpool(nProcessors);
end
p.IdleTimeout=360;
time=1;
tCells=[];
rgDistance=Composite();
......
......@@ -101,13 +101,13 @@ if ~segParams.isPhase
bw=bw|imfill(bw,'holes');
end
if prod(size(im))<1e9
% if prod(size(im))<1e9
[L,num,bwBoundary]=Segment.allocateShake(bw,bw2,min_radius_pixels,segParams);
[L2]=bwlabeln(bw2); % used to mark original cc for segCC field
else
[L,num]=bwlabeln(bw);
L2=L;
end
% else
% [L,num]=bwlabeln(bw);
% L2=L;
% end
if bEnsemble
if size(bw,3)>1
......
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