Commit b4c4c237 authored by ac 20's avatar ac 20

Merge branch 'fsIntensity' of git-bioimage.coe.drexel.edu:bioimage/leverjs into fsIntensity

# Conflicts:
#	matlab/+Segment/segReduce.m
parents f446dea4 e40d15b8
......@@ -1299,9 +1299,9 @@ class LeverDB {
}
// set write ahead mode on the database -- makes concurrent access possible
setWAL(fnCallback) {
var sqlCmd = "PRAGMA journal_mode = WAL";
this._lDB.exec(sqlCmd,function(){
fnCallback();
var sqlCmd = "PRAGMA journal_mode = WAL;pragma journal mode";
this._lDB.all(sqlCmd,function(err,rows){
fnCallback();
});
}
......
......@@ -83,7 +83,7 @@ end
% touching segmentation using a morphological region fill
bw2=bw;
bw=Segment.segReduce(bw,bwLog,min_area_pixels,min_radius_pixels);
bw=Segment.segReduce(bw,bwLog,segParams,min_area_pixels,min_radius_pixels);
if ~segParams.isPhase
bw=bw|imfill(bw,'holes');
......
......@@ -24,7 +24,6 @@ im=denoise(im,segParams);
if 1==nargout
return
end
if is3D(im)
% 3D
if 1==nargout
......@@ -106,7 +105,7 @@ else
imx=medfilt2(im)-imgaussfilt(im,szFilter(1:2));
end
end
imx=max(imx,0);
im=mat2gray(imx);
......
function bw=segReduce(bw,bwLog,min_area_pixels,min_radius_pixels)
function bw=segReduce(bw,bwLog,segParams,min_area_pixels,min_radius_pixels)
[origL,num]=bwlabeln(bw);
......
......@@ -26,19 +26,27 @@ bwLog=bwareaopen(bwLog,4*min_area_pixels);
if segParams.isPhase
se=strel('disk',1);
se2=strel('disk',ceil(min_radius_pixels/2));
T=adaptthresh(im,0.5,'foregroundpolarity','dark','statistic','gaussian');
se2=strel('disk',ceil(min_radius_pixels));
if segParams.isPhase>0
T=adaptthresh(im,0.5,'foregroundpolarity','dark','statistic','gaussian');
else
T=adaptthresh(im,0.5,'foregroundpolarity','bright','statistic','gaussian');
end
bw=imbinarize(im,T);
bw=imcomplement(bw);
if segParams.isPhase>0
bw=imcomplement(bw);
end
% bw=imopen(bw,se);
bw=imclose(bw,se2);
bw=imfill(bw,'holes');
if segParams.wellRadius
if true==segParams.wellRadius
bwMask=imbinarize(medianMask,adaptthresh(medianMask,'statistic','gaussian'));
seMask=strel('disk',ceil(2*min_radius_pixels));
bwMask=imdilate(bwMask,se2);
bw=bw&~bwMask;
bwMask=imdilate(bwMask,seMask);
bwLog=bwLog&~bwMask;
end
bw=imfill(bw,'holes');
else
% use 2x the default nhood size
T=adaptthresh(im,0.5,'NeighborhoodSize',4*floor(size(im)/16)+1,'statistic','gaussian');
......
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