Commit a2abd217 authored by actb's avatar actb

updated thresholdImages to use positive portion of LoG only

parent c235393c
......@@ -58,7 +58,11 @@ else
end
end
imLog=mat2gray(imLog);
% note - DO NOT mat2gray imLog here. Later processing can use the negative
% or positive portions for inside/outside info. Once we mat2gray that's
% gone.
% LEFT HERE AS CAUTIONARY TALE imLog=mat2gray(imLog);
%
4;
function im=denoise(im,segParams)
......
......@@ -2,22 +2,21 @@
function [bw,bwLog]=thresholdImagess(im,imLog,segParams, min_radius_pixels,min_area_pixels,...
medianMask)
imLog(imLog<0)=0;
imLog=mat2gray(imLog);
T=adaptthresh(imLog,0.5,'statistic','gaussian');
bwLog=imbinarize(imLog,T);
bwLog=bwareaopen(bwLog,4*min_area_pixels);
if is3D(im)
% use 2x the default nhood size
T=adaptthresh(imLog,0.5,'statistic','gaussian');
bwLog=imbinarize(imLog,T);
bwLog=bwareaopen(bwLog,min_area_pixels);
nsz=4*floor(size(im)/16)+1;
nsz(3)=nsz(1);
T=adaptthresh(im,0.4,'NeighborhoodSize',nsz,'statistic','gaussian');
% nsz(3)=nsz(1);
T=adaptthresh(im,0.5,'NeighborhoodSize',nsz,'statistic','gaussian');
bw=imbinarize(im,T);
return;
end
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);
if segParams.isPhase
se=strel('disk',1);
se2=strel('disk',ceil(min_radius_pixels/2));
......
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