Commit 9b5a64cb authored by ac_22's avatar ac_22

updated threshold for 3d images

parent 8fbffa76
......@@ -8,7 +8,7 @@ qL=origL;
% nDimension is 2 for 2-D, 3 for 3-D used for concat'ing
nDimension=length(size(bw));
if is3D(bw)
minKernelArea=27;
minKernelArea=ceil(min_area_pixels/2); %
else
minKernelArea=9; %floor(min_area_pixels/4)+1;
end
......
......@@ -4,19 +4,26 @@ function [bw,bwLog]=thresholdImagess(im,imLog,segParams, min_radius_pixels,min_a
imLog(imLog<0)=0;
imLog=mat2gray(imLog);
nsz=4*floor(size(im)/16)+1;
T=adaptthresh(imLog,0.5,'NeighborhoodSize',nsz,'statistic','gaussian');
bwLog=imbinarize(imLog,T);
bwLog=bwareaopen(bwLog,4*min_area_pixels);
if is3D(im)
nsz=2*floor(size(im)/16)+1;
T=adaptthresh(imLog,0.5,'NeighborhoodSize',nsz,'statistic','gaussian');
bwLog=imbinarize(imLog,T);
bwLog=bwareaopen(bwLog,4*min_area_pixels);
T=adaptthresh(im,0.4,'NeighborhoodSize',nsz,'statistic','gaussian');
bw=imbinarize(im,T);
bw=bwareaopen(bw,min_area_pixels);
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=bwareaopen(bwLog,4*min_area_pixels);
if segParams.isPhase
se=strel('disk',1);
se2=strel('disk',ceil(min_radius_pixels/2));
......
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