Commit d54840f1 authored by ac_22's avatar ac_22

updated batchSegment for mask handling

parent 7c96ad7f
......@@ -27,6 +27,15 @@ else
end
segParams.draw=false;
commandList=[];
if 1==segParams.wellRadius
% need to set the median image before we go into spmd, otherwise out of
% memory...
medianMask=Segment.getMedianMask(conn,CONSTANTS,segParams);
else
medianMask=[];
end
% make the command list
for t=1:CONSTANTS.imageData.NumberOfFrames
nc=[repmat(t,length(rgRadius),1),rgRadius'];
......@@ -68,7 +77,7 @@ for idp=0:ceil(size(commandList,1)/p.NumWorkers)-1
sp=segParams;
sp.minimumRadius_um=commandList(labindex+idxCommandList,2);
if isempty(intersect(t,tSeg)) && t>0 && t<=CONSTANTS.imageData.NumberOfFrames
nc=Segment.FrameSegment_texture('',t,CONSTANTS,sp);
nc=Segment.FrameSegment_texture('',t,CONSTANTS,sp,medianMask);
else
if ~isempty(intersect(t,tSeg))
fprintf(1,' found existing seg, t=%d, idxCommandList=%d\n',t,idxCommandList+labindex);
......
......@@ -9,12 +9,12 @@ nctime=tic();
% initialize the bucket with the cells from the maximal radius
% segmentation
idx=1;
while isempty(ensembleCells{idx}) && idx<length(ensembleCells)
while isempty(ensembleCells{idx}) && idx<=length(ensembleCells)
idx=idx+1;
end
if idx==length(ensembleCells)
if idx>length(ensembleCells)
% only zero or one non-empty bucket -- nothing to nest
nestedCells=ensembleCells{idx}; % could be [], or just cells from smallest radius
nestedCells={};
return;
end
for i=1:length(ensembleCells{idx})
......@@ -30,6 +30,9 @@ end
% the two buckets
for i=idx+1:length(ensembleCells)
iCells=ensembleCells{i};
if isempty(iCells)
continue
end
p=gcp('nocreate');
if isempty(p)
[iBucketDest,iCells]=getBucketDest(iCells,rgRadius,nestedCells,szIm,i);
......
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