Commit d32bd385 authored by ac32's avatar ac32

updated intensity thresholds for parasites, use intensity from multithresh not prctile

parents db39f4af 633fe72b
......@@ -340,6 +340,8 @@ function addFiletoBatchSeg(leverCommand,nSlot)
inProcessQ[nSlot].childProc=null;
inProcessQ[nSlot].leverFile=null;
inProcessQ[nSlot].status="";
inProcessQ[nSlot].matlabPID=0; // done with the batch segment process
batchSegFile=null; // ok to start a new batch segment
checkToProcessQ();
});
......
......@@ -206,11 +206,15 @@ for n=1:num
Cells=[Cells newCell];
end
% intensity threshold for parasites
if segParams.isPhase>0
% bright interior phase
fgRatio=0.05; % intensity model needed to keep phase parasites down
elseif segParams.isPhase<0
% dark interior phase
fgRatio=0.05; % less intensity driven
else
% not phase
fgRatio=0.05; % less intensity driven
end
% set features for parasite test
......@@ -223,7 +227,7 @@ for i=1:length(Cells)
Cells(i).pfg=length(find(bwIntensity(idx)))/size(Cells(i).pts,1);
% less then 5% foreground are parasites
if DRAW
% text(Cells(i).centroid(1),Cells(i).centroid(2),num2str(Cells(i).pfg,2),'color','w');
text(Cells(i).centroid(1),Cells(i).centroid(2),num2str(Cells(i).pfg,2),'color','w');
if Cells(i).pfg<fgRatio
plot(Cells(i).surface(:,1),Cells(i).surface(:,2),'color','k','linewidth',3);
end
......
......@@ -75,6 +75,7 @@ function bwIntensity=thresholdPhaseIntensity(im,alpha,min_radius_pixels,min_area
% qThresh=prctile(im(:),[1,99]);
qThresh=multithresh(im,2);
% use dark boundaries. seems to work for both dark and bright interior...
qThresh=multithresh(im,2);
bwIntensity=logical(im<qThresh(1));
bwIntensity=bwIntensity|imfill(bwIntensity,'holes');
se=strel('disk',ceil(min_radius_pixels/4));
......
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