Skip to content
Snippets Groups Projects
Commit b8078501 authored by Eric Wait's avatar Eric Wait
Browse files

LEVer 4.1

parent a1ca3abb
Branches
Tags v4.1
No related merge requests found
*~
bin/*.c
bin/*.log
*.mat
......
function AddConstant(field,val,overWrite)
% AddConstant(field,val,overWrite) will add the given field to the
% CONSTANTS global variable and assign it the given value.
% overWrite - is an optional flag {0,1} that will force the new value if
% the field exists. Zero will keep the old value, One will overwrite the
% current value
%--Eric Wait
global CONSTANTS
if(~exist('overWrite','var'))
overWrite = 0;
end
if(~isfield(CONSTANTS,field))
CONSTANTS.(field) = val;
elseif(overWrite)
CONSTANTS.(field) = val;
end
end
\ No newline at end of file
......@@ -2,23 +2,22 @@ function InitializeConstants()
%Set all constants here
%--Eric Wait
global CONSTANTS
CONSTANTS.imageAlpha = 1;
CONSTANTS.maxRetrackDistSq = 40^2;
CONSTANTS.maxPixelDistance = 40;
CONSTANTS.maxCenterOfMassDistance = 80;
CONSTANTS.minParentCandidateTimeFrame = 5;
CONSTANTS.minParentHistoryTimeFrame = 5;
CONSTANTS.minParentFuture = 5;
CONSTANTS.minFamilyTimeFrame = 5;
CONSTANTS.maxFrameDifference = 5;
CONSTANTS.historySize = 50;
CONSTANTS.clickMargin = 500;
CONSTANTS.timeResolution = 10; %in frames per min
CONSTANTS.dMaxConnectComponet = 40;
CONSTANTS.dMaxCenterOfMass = 80;
CONSTANTS.lookAhead = 2;
CONSTANTS.minPlayer = 9;
CONSTANTS.minMitosis = 30;
AddConstant('imageAlpha',1.5);
AddConstant('maxRetrackDistSq',40^2);
AddConstant('maxPixelDistance',40);
AddConstant('maxCenterOfMassDistance',80);
AddConstant('minParentCandidateTimeFrame',5);
AddConstant('minParentHistoryTimeFrame',5);
AddConstant('minParentFuture',5);
AddConstant('minFamilyTimeFrame',5);
AddConstant('maxFrameDifference',5);
AddConstant('historySize',50);
AddConstant('clickMargin',500);
AddConstant('timeResolution',10); %in frames per min
AddConstant('dMaxConnectComponet',40);
AddConstant('dMaxCenterOfMass',80);
AddConstant('lookAhead',2);
AddConstant('minPlayer',9);
AddConstant('minMitosis',30);
end
\ No newline at end of file
......@@ -7,7 +7,7 @@ function opened = OpenData()
global Figures Colors CONSTANTS CellFamilies CellHulls HashedCells Costs CellTracks
if(isempty(Figures))
fprintf('LEVer ver 4.0\n***DO NOT DISTRIBUTE***\n\n');
fprintf('LEVer ver 4.1\n***DO NOT DISTRIBUTE***\n\n');
end
if(exist('ColorScheme.mat','file'))
......@@ -30,11 +30,6 @@ if (~exist('settings','var') || isempty(settings))
end
filterIndexImage = 0;
matFile = [];
matFilePath = [];
imageFile = [];
imagePath = [];
imageDataset = [];
goodLoad = 0;
opened = 0;
......@@ -56,7 +51,6 @@ if(~isempty(Figures))
end
oldCONSTANTS = CONSTANTS;
InitializeConstants();
%find the first image
imageFilter = [settings.imagePath '*.TIF'];
......@@ -70,7 +64,6 @@ while (filterIndexImage==0)
end
index = strfind(settings.imageFile,'_t');
frameT = '001';
if (~isempty(index) && filterIndexImage~=0)
CONSTANTS.rootImageFolder = settings.imagePath;
imageDataset = settings.imageFile(1:(index(length(index))-1));
......@@ -117,11 +110,11 @@ switch answer
end
catch
end
CellFamilies = [];
CellTracks = [];
CellHulls = [];
HashedCells = [];
Costs = [];
% CellFamilies = [];
% CellTracks = [];
% CellHulls = [];
% HashedCells = [];
% Costs = [];
rootImageFolder = CONSTANTS.rootImageFolder;
imageSignificantDigits = CONSTANTS.imageSignificantDigits;
......@@ -160,7 +153,7 @@ switch answer
Figures.time = 1;
LogAction(['Opened file ' matFile],[],[]);
LogAction(['Opened file ' settings.matFile],[],[]);
otherwise
return
end
......
......@@ -51,7 +51,6 @@ WriteSegData(cellSegments,CONSTANTS.datasetName);
fprintf(1,'\nDone\n');
load ( ['SegObjs_' CONSTANTS.datasetName '.mat']);
fnameIn=['SegObjs_' CONSTANTS.datasetName '.txt'];
fnameOut=['Tracked_' CONSTANTS.datasetName '.txt'];
tSeg=toc;
......
......@@ -8,7 +8,7 @@ function objs = Segmentor(tStart,tLength,rootImageFolder,datasetName,imageAlpha,
%--Andrew Cohen
% global CONSTANTS
se=strel('square',3);
objs=[];
if(ischar(tStart)),tStart = str2double(tStart);end
......@@ -30,6 +30,11 @@ for t = tStart:tStart + tLength
fname=[rootImageFolder '\' datasetName '_t' frameT '.TIF'];
if(isempty(dir(fname))),continue,end
fprintf('%d, ', t);
if ( mod(t,20) == 0 )
fprintf('\n');
end
[im map]=imread(fname);
im=mat2gray(im);
......@@ -44,7 +49,7 @@ for t = tStart:tStart + tLength
% bwNorm=GetNormalVectors(bwHalo,bwDark);
bwNorm=0*bwDark;
se=strel('square',3);
gd=imdilate(im,se);
ge=imerode(im,se);
ig=gd-ge;
......
......@@ -2,7 +2,12 @@ function trackIDs = TrackSplitHulls(newHulls, forceTracks, COM)
global CONSTANTS CellHulls HashedCells
t = CellHulls(newHulls(1)).time;
trackIDs = [CellHulls(newHulls).trackID];
trackIDs = [];
for i = 1:length(newHulls)
trackIDs = [trackIDs GetTrackID(newHulls(i))];
end
if ( t <= 1 )
return;
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment