Commit 487cb3b8 authored by Mark Winter's avatar Mark Winter

Delete functions that are now in utilities repo.

parent 64e2ef98
function localName = GetLocalName(fullName, chkPath)
if ( ~exist('chkPath', 'var') )
chkPath = pwd();
end
localName = [];
partialPath = fullName;
while ( ~isempty(partialPath) && ~strcmpi(chkPath,partialPath) )
[partialPath callPart] = fileparts(partialPath);
if ( callPart(1) == '+' )
localName = [callPart(2:end) '.' localName];
else
localName = fullfile(callPart, localName);
end
end
end
\ No newline at end of file
function arrayIdx = CoordToIndex(arraySize, coords)
linSize = [1 cumprod(arraySize(1:end-1))];
arrayIdx = sum((coords-1) .* repmat(linSize, size(coords,1),1), 2) + 1;
end
function pathString = GetFullImagePath(chan, frame)
global CONSTANTS
imageName = Helper.GetImageName(chan, frame);
pathString = fullfile(CONSTANTS.rootImageFolder,imageName);
end
function imageName = GetImageName(chan, frame)
global CONSTANTS
valueNames = {'c' 't'};
paramValues = {chan frame};
paramTokens = Helper.GetNamePatternParams(CONSTANTS.imageNamePattern);
paramOrder = cellfun(@(x)(x{1}),paramTokens, 'UniformOutput',0);
[bHasParam,valueIdx] = ismember(paramOrder, valueNames);
if ( ~all(bHasParam) )
imageName = '';
missingValues = cellfun(@(x)([' ' x]), paramOrder(bHasParam));
fprintf('Unspecified value(s) needed to generate image string:%s\n', missingValues);
return;
end
imageName = sprintf(CONSTANTS.imageNamePattern, paramValues{valueIdx});
end
function coord = IndexToCoord(arraySize, arrayIdx)
coord = zeros(length(arrayIdx),length(arraySize));
linSize = [1 cumprod(arraySize)];
partialIdx = arrayIdx;
for i = length(arraySize):-1:1
r = rem(partialIdx-1, linSize(i)) + 1;
q = floor((partialIdx-r) / linSize(i)) + 1;
coord(:,i) = q;
partialIdx = r;
end
end
function im = LoadPrimaryIntensityImage(frame)
global CONSTANTS
primaryChan = CONSTANTS.primaryChannel;
im = Helper.LoadIntensityImage(frame, primaryChan);
end
function swapCoords = SwapXY_RC(coords)
swapCoords = coords;
if ( isvector(coords) )
swapCoords([1 2]) = swapCoords([2 1]);
elseif ( ismatrix(coords) )
swapCoords(:,[1 2]) = swapCoords(:,[2 1]);
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