Commit 0a4c72be authored by ac32's avatar ac32

2d LoG set y sigma properly

parent 4eeed920
......@@ -52,7 +52,7 @@ else
min_area_pixels = min_radius_pixels^2 * pi;
end
min_area_pixels = 4*max(1,round(min_area_pixels));
min_area_pixels = 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);
......@@ -67,8 +67,8 @@ if DRAW
drawnow
end
% 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');
% T=adaptthresh(im,0.5,'NeighborhoodSize',2*floor(size(im)/16)+1,'statistic','gaussian');
bw=imbinarize(im,T);
bw=bwareaopen(bw,min_area_pixels);
......@@ -87,7 +87,7 @@ end
[d,dNN]=bwdist(bw);
[L,num]=bwlabel(bw);
bwAssign=bw2&~bw;
bwAssign(d>min_radius_pixels)=0;
bwAssign(d>2*min_radius_pixels)=0;
idxAssign=find(bwAssign);
L(idxAssign)=L(dNN(idxAssign));
num=max(L(:));
......
......@@ -44,6 +44,7 @@ else
% 2D
if USE_CUDA
logRadius=(1/sqrt(2)).*min_radius_pixels;
logRadius(2)=logRadius(1);
logRadius(3)=0;
imLog=HIP.LoG(im,logRadius,[]);
else
......@@ -72,7 +73,7 @@ imLog=mat2gray(imLog);
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);
bwLog=bwareaopen(bwLog,4*min_area_pixels);
% se=strel('disk',ceil(1.5*min_radius_pixels(1)));
% bwLog=imclose(bwLog,se);
4;
......
......@@ -7,13 +7,12 @@ 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;
minKernelArea=floor(min_area_pixels/2)+1;
for nDilate=1:4*min_radius_pixels
for nDilate=1:2*min_radius_pixels
bwDilate=bwmorph(bwDilate,'dilate');
kernels=bwfill(bwDilate,'holes')&~bwDilate;
kernels=kernels&bw;
kernels=bwareaopen(kernels,minKernelArea);
if isempty(find(kernels, 1))
break;
......@@ -44,9 +43,9 @@ for iq=niq:-1:1
rpdist=cellfun(@(x) max(bwd(x)),ccL.PixelIdxList);
% for each newL component, how many components from L are there?
for n=1:max(newL(:))
if iq>1 && (rpdist(n)<0.5*min(min_radius_pixels))
continue
end
% if iq>1 && (rpdist(n)<0.5*min(min_radius_pixels))
% continue
% end
idx=find(n==newL);
nc=numComponents(L,idx);
if nc<=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