Commit 64e2ef98 authored by Mark Winter's avatar Mark Winter

Use utilities functions instead of +Helper routines.

parent 8a9b6646
......@@ -18,8 +18,8 @@ function newHull = CreateHull(rcImageDims, indexPixels, time, userEdited, tag)
newHull = Helper.MakeEmptyStruct(CellHulls);
end
rcCoords = Helper.IndexToCoord(rcImageDims, indexPixels);
xyCoords = Helper.SwapXY_RC(rcCoords);
rcCoords = Utils.IndToCoord(rcImageDims, indexPixels);
xyCoords = Utils.SwapXY_RC(rcCoords);
newHull.indexPixels = indexPixels;
newHull.centerOfMass = mean(rcCoords,1);
......
......@@ -11,7 +11,7 @@ function [addedHull costMatrix nextHulls] = AddSegmentation(prevHull, costMatrix
chanImSet = Helper.LoadIntensityImageSet(time);
guessPoint = Helper.SwapXY_RC(CellHulls(prevHull).centerOfMass);
guessPoint = Utils.SwapXY_RC(CellHulls(prevHull).centerOfMass);
chkHull = Segmentation.FindNewSegmentation(chanImSet, guessPoint, 200, bAggressive, CellHulls(prevHull).indexPixels, time);
if ( isempty(chkHull) )
return;
......
......@@ -59,7 +59,7 @@ function bInLims = checkHullCOMLims(hullID, xyViewLims)
padInMin = bNotEdgeMin.*padScale.*lenDims;
padInMax = bNotEdgeMax.*padScale.*lenDims;
hullCOM = Helper.SwapXY_RC(CellHulls(hullID).centerOfMass).';
hullCOM = Utils.SwapXY_RC(CellHulls(hullID).centerOfMass).';
bInDim = ((hullCOM > xyViewLims(:,1)+padInMin) & (hullCOM < xyViewLims(:,2)-padInMax));
......
......@@ -12,16 +12,16 @@ function newHulls = SplitDeterministic(hull, k, checkHullIDs)
rcImageDims = Metadata.GetDimensions('rc');
xyOldMeans = zeros(k, rcImageDims);
for i=1:length(checkHullIDs)
rcOldCoord = Helper.IndexToCoord(rcImageDims, CellHulls(checkHullIDs(i)).indexPixels);
xyOldMeans(i,:) = Helper.SwapXY_RC(mean(rcOldCoord,1));
rcOldCoord = Utils.IndToCoord(rcImageDims, CellHulls(checkHullIDs(i)).indexPixels);
xyOldMeans(i,:) = Utils.SwapXY_RC(mean(rcOldCoord,1));
end
if ( length(hull.indexPixels) < 2 )
return;
end
rcCoords = Helper.IndexToCoord(rcImageDims, hull.indexPixels);
xyCoords = Helper.SwapXY_RC(rcCoords);
rcCoords = Utils.IndToCoord(rcImageDims, hull.indexPixels);
xyCoords = Utils.SwapXY_RC(rcCoords);
typeParams = Load.GetCellTypeStructure(CONSTANTS.cellType);
if ( typeParams.splitParams.useGMM )
......
......@@ -41,8 +41,8 @@ function newTrackID = AddNewSegmentHull(xyClickPt, time)
rcImageDims = Metadata.GetDimensions('rc');
if ( isempty(chkHull) )
% Add a point hull since we couldn't find a segmentation containing the click
clickIndex = Helper.CoordToIndex(rcImageDims, round(Helper.SwapXY_RC(xyClickPt)));
newHull = Hulls.CreateHull(rcImageDims, Helper.SwapXY_RC(xyClickPt), time, true, 'Manual');
clickIndex = Utils.CoordToInd(rcImageDims, round(Utils.SwapXY_RC(xyClickPt)));
newHull = Hulls.CreateHull(rcImageDims, Utils.SwapXY_RC(xyClickPt), time, true, 'Manual');
else
newHull = Hulls.CreateHull(rcImageDims, chkHull.indexPixels, time, true, chkHull.tag);
end
......
......@@ -36,8 +36,8 @@ function hulls = PartialImageSegment(chanImg, xyCenterPt, subSize, primaryChan,
imSize = max([imSize; size(chanImg{c})],[],1);
end
rcCoordMin = floor(Helper.SwapXY_RC(xyCenterPt) - subSize/2);
rcCoordMax = ceil(Helper.SwapXY_RC(xyCenterPt) + subSize/2);
rcCoordMin = floor(Utils.SwapXY_RC(xyCenterPt) - subSize/2);
rcCoordMax = ceil(Utils.SwapXY_RC(xyCenterPt) + subSize/2);
rcCoordMin(rcCoordMin < 1) = 1;
rcCoordMax(rcCoordMax > imSize) = imSize(rcCoordMax > imSize);
......@@ -71,6 +71,6 @@ function newHulls = fixupFromSubimage(rcCoordMin, origSize, subSize, hulls)
end
function globIdx = makeGlobalPix(locIdx, globSz, locSz, rcOffset)
globCoords = Helper.IndexToCoord(locSz, locIdx) + repmat(rcOffset, size(locIdx,1),1);
globIdx = Helper.CoordToIndex(globSz, globCoords);
globCoords = Utils.IndToCoord(locSz, locIdx) + repmat(rcOffset, size(locIdx,1),1);
globIdx = Utils.CoordToInd(globSz, globCoords);
end
......@@ -35,8 +35,8 @@ end
% guassian clustering (x,y,...) coordinates of cell interior
rcImageDims = Metadata.GetDimensions('rc');
rcCoords = Helper.IndexToCoord(rcImageDims, hull.indexPixels);
xyCoords = Helper.SwapXY_RC(rcCoords);
rcCoords = Utils.IndToCoord(rcImageDims, hull.indexPixels);
xyCoords = Utils.SwapXY_RC(rcCoords);
typeParams = Load.GetCellTypeStructure(CONSTANTS.cellType);
if ( typeParams.splitParams.useGMM )
......
......@@ -138,7 +138,7 @@ function drawSegHulls(hFig,segHulls, bShowInterior)
for i=1:length(segHulls)
colorIdx = mod(i-1,31)+1;
rcCoords = Helper.IndexToCoord(Metadata.GetDimensions(), segHulls(i).indexPixels);
rcCoords = Utils.IndToCoord(Metadata.GetDimensions(), segHulls(i).indexPixels);
plot(hAx, rcCoords(:,2),rcCoords(:,1), '.', 'Color',cmap(colorIdx,:));
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