Commit 003745f0 authored by actb's avatar actb

2d/3d thresholdImages same, logScale=[.25,.25,1.25]

parent 95838369
......@@ -117,7 +117,7 @@ end
function imLog=msLog(im,min_radius_pixels)
logScale=[0.25:0.25:2];
logScale=[0.25:0.25:1.25];
imLogCombined=[];
if length(min_radius_pixels)==3 && min_radius_pixels(3)>0
% 3d
......
......@@ -13,7 +13,7 @@ else
end
%
bwOut=bw;
nIter=100; %10*max(min_radius_pixels);
nIter=pi*max(min_radius_pixels)/2;
for nDilate=1:nIter
bwKernels=bwOut&~bwLog;
bwKernels=Segment.aiAreaOpen(bwKernels,0.5*min_radius_pixels);
......
......@@ -21,34 +21,20 @@ if sensitivity>1 && round(sensitivity)==sensitivity
return;
end
if is3D(im)
nsz=2*floor(size(im)/16)+1;
T=adaptthresh(imLog,0.5,'NeighborhoodSize',nsz,'statistic','gaussian');
bwLog=imbinarize(imLog,T);
bwLog=Segment.aiAreaOpen(bwLog,min_radius_pixels);
nsz=4*floor(size(im)/16)+1;
T=adaptthresh(im,sensitivity,'NeighborhoodSize',nsz,'statistic','gaussian');
bw=imbinarize(im,T);
bw=Segment.aiAreaOpen(bw,min_radius_pixels);
return;
end
if segParams.isPhase
[bw,bwLog]=phaseThreshold(im,bwLog,min_radius_pixels,segParams,...
sensitivity,medianMask);
return;
end
% else (not 3d)
nsz=4*floor(size(im)/16)+1;
T=adaptthresh(imLog,0.5,'NeighborhoodSize',nsz,'statistic','gaussian');
bwLog=imbinarize(imLog,T);
bwLog=Segment.aiAreaOpen(bwLog,min_radius_pixels);
% use 2x the default nhood size
T=adaptthresh(im,sensitivity,'NeighborhoodSize',4*floor(size(im)/16)+1,'statistic','gaussian');
nsz=4*floor(size(im)/16)+1;
T=adaptthresh(im,sensitivity,'NeighborhoodSize',nsz,'statistic','gaussian');
bw=imbinarize(im,T);
bw=Segment.aiAreaOpen(bw,min_radius_pixels);
4;
......
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