Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V16 #5

Open
wants to merge 169 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
169 commits
Select commit Hold shift + click to select a range
9dcf322
starting the new version
NirDick84 Jul 6, 2014
d6afaf8
new version
NirDick84 Jul 8, 2014
7e5bc84
Add todo
oferfrid Jul 8, 2014
7b69952
debug 1
oferfrid Jul 8, 2014
2ca2fa2
fix hierarchy bug
NirDick84 Jul 8, 2014
39b89f2
Rename bord2board and BoardHint as file
oferfrid Jul 8, 2014
5edebff
Merge branch 'V16' of github.com:oferfrid/NQBMatlab into V16
oferfrid Jul 8, 2014
b5d0f53
starting new version
NirDick84 Jul 9, 2014
93d29c0
tif is our ile type
NirDick84 Jul 9, 2014
c85724d
init parameters
oferfrid Jul 9, 2014
d2a846e
Merge branch 'V16' of github.com:oferfrid/NQBMatlab into V16
oferfrid Jul 9, 2014
4fb7da7
Match colonies and fixes!
oferfrid Jul 9, 2014
7314799
Ofer Version
oferfrid Jul 10, 2014
7055472
new version
NirDick84 Jul 10, 2014
f307cb9
new version plate analyzer
NirDick84 Jul 13, 2014
a3f33f6
Change fileprop 2 2 different parameters
oferfrid Jul 13, 2014
363fce9
fix compilation error
NirDick84 Jul 13, 2014
0ff38ef
new ver
NirDick84 Jul 13, 2014
8c071a2
Ofer
oferfrid Jul 13, 2014
5982a0f
Merge branch 'V16' of github.com:oferfrid/NQBMatlab into V16
oferfrid Jul 13, 2014
8648437
Merge branch 'V16' of github.com:oferfrid/NQBMatlab into V16
oferfrid Jul 13, 2014
3342ff4
nir
NirDick84 Jul 13, 2014
6152fba
Ofer
oferfrid Jul 13, 2014
c0a09c5
Merge branch 'V16' of github.com:oferfrid/NQBMatlab into V16
oferfrid Jul 13, 2014
31e7afb
nir
NirDick84 Jul 13, 2014
953e086
Merge branch 'V16' of github.com:oferfrid/NQBMatlab into V16
oferfrid Jul 13, 2014
9151d24
nir
NirDick84 Jul 13, 2014
2ef5378
Merge branch 'V16' of github.com:oferfrid/NQBMatlab into V16
oferfrid Jul 13, 2014
4d19259
from cell 2 array
oferfrid Jul 14, 2014
9a516b4
ofer.
oferfrid Jul 14, 2014
b89e27c
Transpose area
oferfrid Jul 14, 2014
9422acd
nir
NirDick84 Jul 14, 2014
13c0a92
nir
NirDick84 Jul 14, 2014
a215ec9
app
NirDick84 Jul 14, 2014
87b8de4
added TH
NirDick84 Jul 14, 2014
539b604
OFer
oferfrid Jul 14, 2014
ee2d11a
Merge branch 'V16' of github.com:oferfrid/NQBMatlab into V16
oferfrid Jul 14, 2014
2e20f12
Nir Bugs!
oferfrid Jul 15, 2014
acc3201
Nir Bugs?
oferfrid Jul 15, 2014
cc45981
cliiping numbers
NirDick84 Jul 15, 2014
17c7204
Find using max
oferfrid Jul 15, 2014
cea6a00
rename CleanImage
oferfrid Jul 16, 2014
8976277
new version app
NirDick84 Jul 16, 2014
0aa1550
Merge branch 'V16' of https://github.com/oferfrid/NQBMatlab into V16
NirDick84 Jul 16, 2014
1f5b0b3
Handel change
oferfrid Jul 16, 2014
abb36e9
appData
NirDick84 Jul 16, 2014
ca07ebd
Merge branch 'V16' of https://github.com/oferfrid/NQBMatlab into V16
NirDick84 Jul 16, 2014
98503de
bug: I saved the IgnoredColonies as logical type so
NirDick84 Aug 7, 2014
408e230
set titles time and description
NirDick84 Aug 10, 2014
ae1e447
set description and time of titles
NirDick84 Aug 10, 2014
84c8c9b
changing the plotting function's names
NirDick84 Aug 10, 2014
4ad981b
changing the plotting functions names
NirDick84 Aug 10, 2014
023693f
getTitle to GetTitle as a method with its own file
NirDick84 Aug 10, 2014
95f055e
new
NirDick84 Aug 10, 2014
046c92e
added Plot functions
NirDick84 Aug 11, 2014
0183441
added Plates2Colonies
NirDick84 Aug 11, 2014
a168333
fix
oferfrid Aug 12, 2014
a3514f5
Merge branch 'V16' of github.com:oferfrid/NQBMatlab into V16
oferfrid Aug 12, 2014
660d19a
Movie and Irit's functions
NirDick84 Sep 11, 2014
621feea
Merge branch 'V16' of https://github.com/oferfrid/NQBMatlab into V16
NirDick84 Sep 11, 2014
6313367
fixing procedures
NirDick84 Sep 16, 2014
8db26ae
times to time
NirDick84 Sep 17, 2014
4742c09
...
NirDick84 Sep 17, 2014
b099b02
fixing few problems and saving the data file name in one place
NirDick84 Sep 17, 2014
04af46b
Update saveROI.m
NirDick84 Dec 3, 2014
159d126
Update CropROI.m
NirDick84 Dec 3, 2014
6ecb27f
debug print
oferfrid Dec 3, 2014
ec20fa7
Merge branch 'V16' of github.com:oferfrid/NQBMatlab into V16
oferfrid Dec 3, 2014
c4fd221
Update getAppearanceTime.m
NirDick84 Dec 3, 2014
e5e305e
Merge branch 'V16' of github.com:oferfrid/NQBMatlab into V16
oferfrid Dec 3, 2014
6af7a70
Small fixes
oferfrid Dec 3, 2014
9b9a3e7
Update Images2Colonies.m
NirDick84 Jan 29, 2015
ea56812
Update CropROI.m
NirDick84 Feb 10, 2015
e49954f
Update CropROI.m
NirDick84 Feb 10, 2015
2b85b15
Update CropROI.m
NirDick84 Feb 11, 2015
ad3e216
Update setMaskApp.m
NirDick84 Feb 11, 2015
ff91696
Update GetMask.m
NirDick84 Feb 11, 2015
cc9e5f0
Update PlateAnalyzer.m
NirDick84 Feb 15, 2015
cc91041
Create SetStartingTime.m
NirDick84 Feb 15, 2015
d23ff4e
Update ShowAreaGraphByData.m
NirDick84 Feb 15, 2015
5eb611b
Update getAppearanceTime.m
NirDick84 Feb 15, 2015
6d6a13d
Update getAppearanceGrowth.m
NirDick84 Feb 15, 2015
a30776b
Nir update from mail
oferfrid Feb 18, 2015
564445e
Update PlateAnalyzer.m
NirDick84 Aug 2, 2015
658790b
Update SetStartingTime.m
NirDick84 Aug 2, 2015
6961f2a
Update getAppearanceGrowth.m
NirDick84 Aug 3, 2015
c77515a
Update getAppearanceTime.m
NirDick84 Aug 3, 2015
4fff341
Create getDistrStatistics.m
NirDick84 Aug 3, 2015
34bdc06
Create getSurvivalCurve.m
NirDick84 Aug 3, 2015
28988e8
Delete AlignandCut.m
NirDick84 Sep 7, 2015
5cad575
Update CropROI.m
NirDick84 Sep 7, 2015
dc5b1d5
Update CropROI.m
NirDick84 Sep 7, 2015
5207a4f
Update GetDataName.m
NirDick84 Sep 7, 2015
8dedf6e
Update GetDataName.m
NirDick84 Sep 7, 2015
c41a485
Update saveROI.m
NirDick84 Sep 7, 2015
61ba12b
Update saveROI.m
NirDick84 Sep 7, 2015
ad2f7aa
Update FindColoniesInWorkingArea.m
NirDick84 Sep 7, 2015
edef056
Update FindColoniesInWorkingArea.m
NirDick84 Sep 7, 2015
d160496
Update GetDataName.m
NirDick84 Sep 7, 2015
ed4e22a
Update GetMask.m
NirDick84 Sep 7, 2015
d1abbc3
Update FindColoniesInWorkingArea.m
NirDick84 Sep 7, 2015
27cacca
Update cleanImage.m
NirDick84 Sep 7, 2015
8d6452b
Update im2L.m
NirDick84 Sep 7, 2015
9d2403c
Update image2Lrgb.m
NirDick84 Sep 7, 2015
94b42c9
Update GetPlateLrgb.m
NirDick84 Sep 7, 2015
bf73d83
Update GetPlateLrgb.m
NirDick84 Sep 7, 2015
115b90b
Update Images2Colonies.m
NirDick84 Sep 7, 2015
ea00db9
Update PlateAnalyzer.m
NirDick84 Sep 7, 2015
217502b
Update Plates2Colonies.m
NirDick84 Sep 7, 2015
dd24401
Update PlotPlate.m
NirDick84 Sep 7, 2015
1565040
Update PlotPlateAnalysis.m
NirDick84 Sep 7, 2015
15045b2
Update CropROI.m
NirDick84 Sep 9, 2015
f3ea3bf
Update PlateAnalyzer.m
NirDick84 Sep 30, 2015
6467781
Update GetDefaultNoColonyCode.m
NirDick84 Oct 15, 2015
e3dd2cb
Update GetDefaultTH.m
NirDick84 Oct 15, 2015
9775dd6
Update MakePlateMovie.m
NirDick84 Oct 15, 2015
0d63be5
Update PlotPlateAnalysisByData.m
NirDick84 Oct 15, 2015
fd1a276
Update PlotPlateByData.m
NirDick84 Oct 15, 2015
681f434
Update PlotPlateColoniesNumbers.m
NirDick84 Oct 15, 2015
7e67ef8
Update PlotPlateColoniesNumbersByData.m
NirDick84 Oct 15, 2015
b7712c6
Update ProcessPlates.m
NirDick84 Oct 15, 2015
034ebeb
Update ShowAreaGraphByData.m
NirDick84 Oct 15, 2015
5f5e92f
Update ShowPlate.m
NirDick84 Oct 15, 2015
7cf27b1
Update getSurvivalCurve.m
NirDick84 Oct 28, 2015
4eaf3e1
Delete folders from older version
oferfrid Dec 7, 2015
26dbcf9
adding a subroutine for calculating hind starting from the name of th…
oferfrid Dec 7, 2015
1acee10
Changed the image argument to be either image or path
oferfrid Dec 31, 2015
70f4fc2
deleted the CreateBoardHintByName.m
oferfrid Dec 31, 2015
a0dfa3a
message for not saving before exit
oferfrid Dec 31, 2015
d95952a
Create transform2V16Dir.m
NirDick84 Jan 11, 2016
2f27ca7
Create TransformToV16.m
NirDick84 Jan 11, 2016
fedf448
Update and rename transform2V16Dir.m to Transform2V16Dir.m
NirDick84 Jan 11, 2016
507b429
Update and rename Transform2V16Dir.m to ConvertTo2V16Dir.m
NirDick84 Jan 11, 2016
6e2e3dd
Update and rename TransformToV16.m to ConvertToV16.m
NirDick84 Jan 11, 2016
a4bb542
Update ConvertTo2V16Dir.m
NirDick84 Jan 11, 2016
279ebbc
Add the general utilities back
oferfrid Jan 11, 2016
7379086
Delete ConvertTo2V16Dir.m
NirDick84 Jan 11, 2016
9d06737
Delete ConvertToV16.m
NirDick84 Jan 11, 2016
9f49d26
Update README.md
NirDick84 Jan 11, 2016
23614bc
print directory
oferfrid Jan 11, 2016
9184734
Merge branch 'V16' of https://github.com/oferfrid/NQBMatlab into V16
oferfrid Jan 11, 2016
d4d3899
print current directory
oferfrid Jan 11, 2016
f506ddd
no BB!
oferfrid Jan 11, 2016
4e7e9ea
Update ConvertToV16.m
NirDick84 Jan 20, 2016
42392cd
plots several 1d histograms on a 3d axis
IritLevin Jan 21, 2016
7ccae23
Merge branch 'V16' of https://github.com/oferfrid/NQBMatlab into V16
IritLevin Jan 21, 2016
1814715
Update and rename ConvertTo2V16Dir.m to ConvertToV16Dir.m
NirDick84 Jan 21, 2016
a5a0cb0
Update ConvertToV16.m
NirDick84 Jan 21, 2016
36b82ac
Update ConvertToV16Dir.m
NirDick84 Jan 21, 2016
4ba6b9e
Update CropROI.m
NirDick84 Feb 15, 2016
834547b
adding colormap as an optional parameter
IritLevin Feb 16, 2016
af1ebd9
Merge branch 'V16' of https://github.com/oferfrid/NQBMatlab into V16
IritLevin Feb 16, 2016
8fb1186
Update CropROI.m
NirDick84 Mar 1, 2016
c0d70f3
Merge branch 'V16' of https://github.com/oferfrid/NQBMatlab into V16
IritLevin Mar 1, 2016
c267ad2
strange things for irit:
oferfrid Mar 2, 2016
723ae8a
Update CreateBoardHint.m
NirDick84 Apr 20, 2016
ccdbd80
Update CropROI.m
NirDick84 Apr 20, 2016
cd1a30f
change max to mode
IritLevin Apr 20, 2016
610d586
change normalization
IritLevin Apr 20, 2016
d951f21
Merge branch 'V16' of https://github.com/oferfrid/NQBMatlab into V16
IritLevin Apr 20, 2016
7aa854b
Create GetColoinesNum.m
NirDick84 Apr 26, 2016
f981c55
Update ConvertToV16.m
NirDick84 Jun 8, 2016
aa30e5c
Update PlotPlate.m
NirDick84 Aug 15, 2016
fb68b42
Add files via upload
NirDick84 Aug 15, 2016
c7c321b
Irit?!
NirDick84 Aug 15, 2016
8273550
Update PlotPlate.m
NirDick84 Aug 18, 2016
8bb3665
Update PlotPlate.m
NirDick84 Aug 18, 2016
f7a671f
bug fix from Orit
IritLevin Oct 26, 2016
65306ce
bug fix of
IritLevin Mar 30, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ConditionAnalysis/GetDataName.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
function name = GetDataName(SourceDir)
[~,dir,~]=fileparts(SourceDir);
name=[dir '_data.mat'];
name=fullfile(SourceDir,name);
end

4 changes: 4 additions & 0 deletions ConditionAnalysis/GetDefaultDataName.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
function fileName = GetDefaultDataName
fileName='data.mat';
end

107 changes: 107 additions & 0 deletions ConditionAnalysis/getAppearanceGrowth.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
function [AppearanceGrowth,NotBigEnough,Merged] = getAppearanceGrowth(SourceDirs, lb, ub,BeginTimes)
% [ColoniesGrowth, ColoniesAppearance,ColoniesIndices,AreaGap,...
% NotBigEnough,MergedBeforUpper]
%% [ColoniesGrowth, ColoniesAppearance] = getAppearanceGrowth(
% FileDir, lb, ub)
% -------------------------------------------------------------------------
% Purpose: This function calculates the growth rate and appearance time for
% each relevant colony.
%
% Description: This function calculates the growth rate and appearance time for
% each relevant colony. Relevant colonies are the colonies that are not
% excluded and far enough from the border. For colonies that that became
% one we take data only till the first merging time.
%
% Arguments: FileDir - The directory of the data
% lb - lower bound size in pixels
% ub - upper bound size in pixels
%
% Returns: ColoniesIndices - The indices of colonies that entered to
% statistics.
% AreaGap - The diffrence between the first area that exceeded lb
% and the first area that exceeded ub for each colony that entered
% to statistics.
%
% ColoniesGrowth - vector of the times it take for each colony to
% reach from lb size to ub size.
% ColoniesAppearance - Colony's first appearance
%
% NotBigEnough - colonies with last area < ub (not in statistics)
%
% MergedBeforUpper - colonies that merged before exceeding the ub
% (not in statistics)
% -------------------------------------------------------------------------
% Nir Dick. 9.2013
dataFlag=0;
if nargin<4
dataFlag=1;
BeginTimes=zeros(size(SourceDirs));
end

if(~iscell(SourceDirs))
SourceDirs = {SourceDirs};
end

numOfSources=length(SourceDirs);

% AppearanceGrowth init
AppearanceGrowth.plate=[];
AppearanceGrowth.id=[];
AppearanceGrowth.growth=[];
AppearanceGrowth.appearance=[];
AppearanceGrowth.areaGap=[];

% NotBigEnough init
NotBigEnough.plate=[];
NotBigEnough.id=[];

% Merged init
Merged.plate=[];
Merged.id=[];

for i=1:numOfSources
currAppearance=[];
if (lb>ub)
disp 'Invalid arguments lb > up';
else
% Load data file
FileDir=SourceDirs{i};
data=load(GetDataName(FileDir));

[currIndices,currGrowth,currGap,currNotBigEnough,currMerged]=...
getColoniesGrowthRate(FileDir, lb, ub);
coloniesNum=size(currIndices,1);
for k=1:coloniesNum
AppearenceIndex = find(data.Area(:,currIndices(k)),1,'first');
currAppearance=[currAppearance;data.FilesDateTime(AppearenceIndex)];
end
end

if dataFlag&&isfield(data,'StartingTime')
currStarting=data.StartingTime;
else
currStarting=BeginTimes(i);
end

currAppearance=currAppearance-currStarting;

if currStarting
currAppearance=round(currAppearance*24*60);
end

% AppearanceGrowth building
AppearanceGrowth.plate=[AppearanceGrowth.plate; i*ones(size(currIndices))];
AppearanceGrowth.id=[AppearanceGrowth.id; currIndices];
AppearanceGrowth.growth=[AppearanceGrowth.growth;currGrowth];
AppearanceGrowth.appearance=[AppearanceGrowth.appearance;currAppearance];
AppearanceGrowth.areaGap=[AppearanceGrowth.areaGap;currGap];

% NotBigEnough building
NotBigEnough.plate=[NotBigEnough.plate;i*ones(size(currNotBigEnough))];
NotBigEnough.id=[NotBigEnough.id;currNotBigEnough];

% Merged building
Merged.plate=[Merged.plate;i*ones(size(currMerged))];
Merged.id=[Merged.id;currMerged];
end
end
44 changes: 44 additions & 0 deletions ConditionAnalysis/getAppearanceTime.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
function [ApperanceTime] = getAppearanceTime(SourceDirs,BeginTimes)
dataFlag=0;
if nargin<2
dataFlag=1;
BeginTimes=zeros(size(SourceDirs));
end

if(~iscell(SourceDirs))
SourceDirs = {SourceDirs};
end

numOfSources=length(SourceDirs);

ApperanceTime.plate=[];
ApperanceTime.id=[];
ApperanceTime.time=[];

for i=1:numOfSources
% Load data file
data=load(GetDataName(SourceDirs{i}));

if dataFlag&&isfield(data,'StartingTime')
currBeginTime=data.StartingTime;
else
currBeginTime=BeginTimes(i);
end

indexes = 1:length(data.IgnoredColonies);
indexes = indexes(~data.IgnoredColonies);

[~,I]=max(data.Area(:,indexes)>0,[],1);
PlateAppearanceTime = data.FilesDateTime(I);

PlateAppearanceTime=PlateAppearanceTime-currBeginTime;

if currBeginTime
PlateAppearanceTime=round(PlateAppearanceTime*24*60);
end

ApperanceTime.plate=[ApperanceTime.plate,i*ones(size(indexes))];
ApperanceTime.id=[ApperanceTime.id,indexes];
ApperanceTime.time=[ApperanceTime.time,PlateAppearanceTime];
end
end
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
function [ColoniesIndices,ColoniesGrowth,AreaGap,...
NotBigEnough,RemovedMerged]=...
getColoniesGrowthRate(FileDir, lb, ub)
function [ColoniesIndices,ColoniesGrowth,AreaGap,NotBigEnough,RemovedMerged]=...
getColoniesGrowthRate(dataInfo, lb, ub)
%% ColonisGrowth = getColoniesGrowthRate(FileDir)
% -------------------------------------------------------------------------
% Purpose: This function calculates the growth rate of each colony
Expand All @@ -17,30 +16,28 @@
% indicesBeforeMerged - Colony's index respectivly
% -------------------------------------------------------------------------
% Nir Dick. 9.2013

%% Loading data and initializations
DirName = fullfile(FileDir, 'Results');
load(fullfile(DirName,'VecArea'));
load(fullfile(DirName,'ExcludedBacteria.txt'));
load(fullfile(DirName,'TimeAxis'));

allColonies = FindColoniesInWorkingArea(FileDir);
if isstruct(dataInfo)
data=dataInfo;
% Data info is the location of the file
else
data=load(GetDataName(dataInfo));
end

allColonies = find(data.IgnoredColonies==0);

% Return an array of not big enough colonies
NotBigEnough=find(VecArea(:,end)<ub);
NotBigEnough=find(data.Area(end,:)<ub);
NotBigEnough=intersect(NotBigEnough,allColonies);

% Remove excluded and not big enough
indicesBeforeMerged=setdiff(allColonies,ExcludedBacteria);
indicesBeforeMerged=setdiff(indicesBeforeMerged,NotBigEnough);
indicesBeforeMerged=setdiff(allColonies,NotBigEnough);

%% Remove colonies that merged between lb to ub and for the rest
% calculate rate
RemovedMerged=[];
ColoniesGrowth=[];
ColoniesIndices=[];
AreaGap=[];
allMerged=getMergedColonies(DirName);
allMerged=getMergedColonies(data.Centroid);
CINum=length(indicesBeforeMerged);
for j=1:CINum
currCol=indicesBeforeMerged(j);
Expand All @@ -50,31 +47,31 @@

% Check if current colony merged while growing from lb to ub
if mergeTimeIdx>0
% Doesn't make sense, but stil....
% Doesn't make sense, but stil we cant calcullate prev
% index in this case
if (mergeTimeIdx==1)
removeMerged=1;
else
% Get area of current colony before merging time
currArea=VecArea(currCol,mergeTimeIdx-1);
currArea=data.Area(mergeTimeIdx-1,currCol);
if currArea<ub
removeMerged=1;
end
end

end

% Add current colony to the removed colonies for merging reasons
if (removeMerged)
RemovedMerged=[RemovedMerged;currCol];
% Add current colony to the result arrays
else
lbIndex = find(VecArea(currCol,:)>=lb,1,'first');
ubIndex = find(VecArea(currCol,:)>=ub,1,'first');
lbIndex = find(data.Area(:,currCol)>=lb,1,'first');
ubIndex = find(data.Area(:,currCol)>=ub,1,'first');
ColoniesIndices=[ColoniesIndices;currCol];
ColoniesGrowth=...
[ColoniesGrowth;TimeAxis(ubIndex)-TimeAxis(lbIndex)];
[ColoniesGrowth;data.FilesDateTime(ubIndex)-data.FilesDateTime(lbIndex)];
AreaGap=...
[AreaGap;VecArea(currCol,ubIndex)-VecArea(currCol,lbIndex)];
[AreaGap;data.Area(ubIndex,currCol)-data.Area(lbIndex,currCol)];
end
end

Expand Down
26 changes: 26 additions & 0 deletions ConditionAnalysis/getDistrStatistics.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
function [Stat] = getDistrStatistics(Distr)
% Stat = ExperimentStatistics(Distr)
% -------------------------------------------------------------------------
% Purpose: checking statistical parmeters for a histogram
% Arguments: TimeAxis - Time
% Distr - appearance time for each bacteria (not a histogram)
% Returns: Stat.total
% .Avg
% .std
% .skw
% .mode
% .median
% .stdMed
% -------------------------------------------------------------------------
% Irit Levin Reisman. 2015
Stat.total = length(Distr);
Stat.Avg = mean(Distr);
Stat.std = std(Distr);
Stat.skw = skewness(Distr);
% h = hist(Distr, TimeAxis);
% [val, Ind] = max(h);
% Stat.max = TimeAxis(Ind);
Stat.mode = mode(Distr);
Stat.median= median(Distr);
Stat.stdMed= sqrt(sum((Distr - Stat.median).^2)/Stat.total);
end
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function [result] = getMergedColonies(DirName)
function [result] = getMergedColonies(VecCen)
%% [result] = getMergedColonies()
% -------------------------------------------------------------------------
% Purpose: This function return for each colony the first time it merged.
Expand All @@ -12,11 +12,9 @@
% relevant index or 0 if colony didn't merge.
% -------------------------------------------------------------------------
% Nir Dick. 9.2013

load(fullfile(DirName,'VecCen'));

coloniesNum=size(VecCen,1);
timesNum=size(VecCen,3);
coloniesNum=size(VecCen,2);
timesNum=size(VecCen,1);

result=zeros(coloniesNum,1);

Expand All @@ -26,10 +24,10 @@
for j=1:coloniesNum
for k=1:timesNum
% Get colony center
cen=VecCen(j,:,k);
if (cen ~= [0 0])
cen=[VecCen(k,j,1) VecCen(k,j,2)];
if ((cen(1) ~= 0) || (cen(2) ~= 0))
cenColoniesNum=...
sum(VecCen(:,1,k)==cen(1,1)&VecCen(:,2,k)==cen(1,2));
sum(VecCen(k,:,1)==cen(1,1)&VecCen(k,:,2)==cen(1,2));

if (cenColoniesNum>1)
result(j,1)=k;
Expand Down
28 changes: 28 additions & 0 deletions ConditionAnalysis/getPropInTime.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
function [id,Time,Area,Centroid] = getPropInTime(SourceDirs)
if(~iscell(SourceDirs))
SourceDirs = {SourceDirs};
end

numOfDirs=length(SourceDirs);

id = cell(1,numOfDirs);
Time=cell(1,numOfDirs);
Area=cell(1,numOfDirs);
Centroid=cell(1,numOfDirs);

for i=1:numOfDirs
% Load data file
data=load(GetDataName(SourceDirs{i}));

% Build the id vecs - colonie's id and source dir
indexes = 1:length(data.IgnoredColonies);
indexes = indexes(~data.IgnoredColonies);
id{i}=indexes;

% Load add the times arrea
Time{i}=data.FilesDateTime;
Area{i}=data.Area(:,indexes);
Centroid{i}=data.Centroid(:,indexes,:);
end
end

23 changes: 23 additions & 0 deletions ConditionAnalysis/getSurvivalCurve.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
function [SurvivalCurveX, SurvivalCurveY] = getSurvivalCurve(SourceDirs,BeginTimes)
%%[Time, DC] = plotDeathCurve(DirVec)
% -------------------------------------------------------------------------
% Purpose: creating a death curve
% Arguments: DirVec - a cell array of the dir names
% ShowPlot - (1) plot the results. (0) no plot [default]
% Returns: Time - Time axis till TimeLimit
% DC - Death Curve
% -------------------------------------------------------------------------
% Irit Levin Reisman. 2015
sentBegin=false;
if nargin>1
sentBegin=true;
end

if sentBegin
totalAppearenceTime=getAppearanceTime(SourceDirs,BeginTimes);
else
totalAppearenceTime=getAppearanceTime(SourceDirs);
end
SurvivalCurveX = sort(totalAppearenceTime.time);
SurvivalCurveY = length(totalAppearenceTime.time):-1:1;
end
Loading