Commit 63a0849f authored by Mark Winter's avatar Mark Winter

Bugfixes for add and splitting cells.

parent 4b637c83
......@@ -10,7 +10,7 @@ function newHulls = SplitDeterministic(hull, k, checkHullIDs)
end
rcImageDims = Metadata.GetDimensions('rc');
xyOldMeans = zeros(k, rcImageDims);
xyOldMeans = zeros(k, length(rcImageDims));
for i=1:length(checkHullIDs)
rcOldCoord = Utils.IndToCoord(rcImageDims, CellHulls(checkHullIDs(i)).indexPixels);
xyOldMeans(i,:) = Utils.SwapXY_RC(mean(rcOldCoord,1));
......
......@@ -42,7 +42,7 @@ function newTrackID = AddNewSegmentHull(xyClickPt, time)
if ( isempty(chkHull) )
% Add a point hull since we couldn't find a segmentation containing the click
clickIndex = Utils.CoordToInd(rcImageDims, round(Utils.SwapXY_RC(xyClickPt)));
newHull = Hulls.CreateHull(rcImageDims, Utils.SwapXY_RC(xyClickPt), time, true, 'Manual');
newHull = Hulls.CreateHull(rcImageDims, clickIndex, time, true, 'Manual');
else
newHull = Hulls.CreateHull(rcImageDims, chkHull.indexPixels, time, true, chkHull.tag);
end
......
......@@ -62,11 +62,12 @@ function hulls = PartialImageSegment(chanImg, xyCenterPt, subSize, primaryChan,
end
function newHulls = fixupFromSubimage(rcCoordMin, origSize, subSize, hulls)
newHulls = hulls;
newHulls = [];
rcOffset = rcCoordMin - 1;
for i=1:length(hulls)
newHulls(i).indexPixels = makeGlobalPix(hulls(i).indexPixels, origSize, subSize, rcOffset);
idxPix = makeGlobalPix(hulls(i).indexPixels, origSize, subSize, rcOffset);
newHulls = [newHulls Hulls.CreateHull(origSize, idxPix)];
end
end
......
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