Commit 4eeed920 authored by ac32's avatar ac32

changed area settings for intensity thresholds

parent 39eb4a3f
......@@ -9,6 +9,9 @@ segParams=Segment.getDefaultSegParams();
if exist('args','var')
segParams=Segment.getParams(segParams,args);
end
if isdeployed()
segParams.draw=false;
end
global DRAW
DRAW=segParams.draw;
......@@ -48,7 +51,8 @@ else
min_radius_pixels=min_radius_pixels(1);
min_area_pixels = min_radius_pixels^2 * pi;
end
min_area_pixels = max(1,round(min_area_pixels));
min_area_pixels = 4*max(1,round(min_area_pixels));
if DRAW
imRaw=MicroscopeData.Reader('imageData',CONSTANTS.imageData, 'chanList',segParams.channels(1),'timeRange',[t t], 'outType','single','prompt',false);
......@@ -63,8 +67,10 @@ if DRAW
drawnow
end
bw=imbinarize(im,adaptthresh(im,0.5,'statistic','gaussian'));
% T=adaptthresh(im,0.5,'NeighborhoodSize',2*floor(size(im)/8)+1,'statistic','gaussian');
T=adaptthresh(im,0.5,'NeighborhoodSize',4*floor(size(im)/16)+1,'statistic','gaussian');
bw=imbinarize(im,T);
bw=bwareaopen(bw,min_area_pixels);
% bw2 is all the pixels in our foreground image. after we mask, some
% of those pixels will be discarded in resolving the underlying cells.
......
......@@ -67,8 +67,12 @@ min_area_pixels = min_radius_pixels^2 * pi;
min_area_pixels = max(1,round(min_area_pixels));
imLog(imLog<median(imLog(:)))=0;
imLog=mat2gray(imLog);
bwLog=imbinarize(imLog,adaptthresh(imLog,0.5,'statistic','gaussian'));
bwLog=bwareaopen(bwLog,2*min_area_pixels);
% bwLog=imbinarize(imLog,adaptthresh(imLog,0.5,'statistic','gaussian'));
T=adaptthresh(imLog,0.5,'NeighborhoodSize',4*floor(size(im)/16)+1,'statistic','gaussian');
bwLog=imbinarize(imLog,T);
% bwLog=bwareaopen(bwLog,4*min_area_pixels);
% se=strel('disk',ceil(1.5*min_radius_pixels(1)));
% bwLog=imclose(bwLog,se);
4;
......
......@@ -7,11 +7,14 @@ bwDilate=bwLog;
qL=[];
% nDimension is 2 for 2-D, 3 for 3-D used for concat'ing
nDimension=length(size(bw));
% divide by 4 for kernel min area, since we *2 for min_area in
% frameSegment_texture
minKernelArea=floor(min_area_pixels/4)+1;
for nDilate=1:2*min_radius_pixels
for nDilate=1:4*min_radius_pixels
bwDilate=bwmorph(bwDilate,'dilate');
kernels=bwfill(bwDilate,'holes')&~bwDilate;
kernels=bwareaopen(kernels,min_area_pixels);
kernels=bwareaopen(kernels,minKernelArea);
if isempty(find(kernels, 1))
break;
end
......@@ -57,6 +60,7 @@ for iq=niq:-1:1
L=bwlabeln(bw);
end
4;
function nc=numComponents(L,idx)
labels=unique(L(idx));
......
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