Commit 68bfa0da authored by Andrew Cohen's avatar Andrew Cohen

FrameSegment_3D close on denoise

parent 82045447
......@@ -55,18 +55,20 @@ for idChannel=1:length(channels)
c=channels(idChannel);
im = MicroscopeData.Reader('imageData',CONSTANTS.imageData, 'chanList',c, ...
'timeRange',[t t], 'outType','single','prompt',false);
resolution_um=CONSTANTS.imageData.PixelPhysicalSize; % um per pixel
min_radius_pixels = MIN_CELL_RADIUS_um ./ resolution_um;
if (bDenoise)
im=medfilt3(im)-imgaussfilt3(im);
im=medfilt3(im)-imgaussfilt3(im,10*min_radius_pixels);
im=max(im,0);
end
resolution_um=CONSTANTS.imageData.PixelPhysicalSize(1); % um per pixel
% improject=max(im,[],3);figure;imagesc(improject)
min_radius_pixels = max(min_radius_pixels);
min_volume_pixels = max(4/3*pi.*min_radius_pixels.^3);
min_radius_pixels = MIN_CELL_RADIUS_um / resolution_um;
min_volume_pixels = 4/3*pi*min_radius_pixels^3;
max_radius_pixels=MAX_CELL_RADIUS_um/resolution_um;
max_volume_pixels=4/3*pi*max_radius_pixels^3;
max_radius_pixels=min(MAX_CELL_RADIUS_um./resolution_um);
max_volume_pixels=min(4/3*pi.*max_radius_pixels.^3);
% threshold im
im=mat2gray(im);
pix=im(im>0);
......@@ -80,9 +82,11 @@ for idChannel=1:length(channels)
level=oAlpha.*graythresh(pix);
bw=logical(im>level);
% se = strel('sphere',1+floor(min_radius_pixels/2));
% bw=imclose(bw,se);
%
if (bDenoise)
se = strel('sphere',1+ceil(min_radius_pixels/2));
bw=imclose(bw,se);
end
%
% bw=smooth3(bw);
CC = bwconncomp(bw);
numPixels = cellfun(@numel,CC.PixelIdxList);
......
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