Skip to content
Snippets Groups Projects
Commit 593a8adf authored by shihao's avatar shihao
Browse files

fix the splitting pixels list

parent d815bb67
No related branches found
No related tags found
1 merge request!1Split Hull Bug Fix
......@@ -18,7 +18,7 @@
%LEVer in file "gnu gpl v3.txt". If not, see <http://www.gnu.org/licenses/>.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [ newHulls ] = CreateHulls(bwIm, orgIm, minCellDia, frame, minXY, minZ)
function [ newHulls ] = CreateHulls(bwIm, orgIm, minCellDia, frame, minXY, minZ, labeledIm)
global imageData
newHulls = [];
......@@ -29,6 +29,9 @@ end
if ~exist('minZ','var')
minZ = 0;
end
if ~exist('labeledIm','var')
labeledIm = 0;
end
[newHulls,~,~] = GetEmptyStructs();
imageDims = [imageData.XDimension, imageData.YDimension, imageData.ZDimension];
......@@ -37,7 +40,11 @@ scaleFactor = imageDims ./ max(imageDims) .* physDims/physDims(1);
imDiv = imageDims /2;
minCellVol = (4*pi*(minCellDia/2)^3)/3;
if (labeledIm==0)
cc = bwconncomp(bwIm);
else
cc = bwIm;
end
stts = regionprops(cc,orgIm,'BoundingBox','PixelList','WeightedCentroid');
if isempty(stts)
return
......
......@@ -27,7 +27,7 @@ for i=1:k
im(idx) = i;
end
newHulls = CreateHulls(im,orgImage(:,:,:,hullChan,Hulls(hull).frame),1,Hulls(hull).frame);
newHulls = CreateHulls(im,orgImage(:,:,:,hullChan,Hulls(hull).frame),1,Hulls(hull).frame,0,0,1);
oldHull = Hulls(hull);
Hulls(hull) = newHulls(1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment