forked from klasma/BaxterAlgorithms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMake4DMatrix.m
More file actions
46 lines (45 loc) · 1.36 KB
/
Make4DMatrix.m
File metadata and controls
46 lines (45 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
seqPath = 'D:\Dropbox (VU Basic Sciences)\Duvall Confocal\Duvall Lab\Brock Fletcher\2021-11-15-Ai9CMAX PRotein Screen\Analysis\Baxter';
TrackVersion='_220106_115446';
FilePath=fullfile(seqPath,'Analysis',strcat('CellData',TrackVersion),'Compact');
a=dir(fullfile(FilePath,'*.mat'));
b={a.name};
HasCells=[a.bytes];
blank=~(HasCells>185);
d=b;
d(blank) =[];
for m=1:length(b)
Run=b{1,m};
Run=Run(1:end-4)
if blank(m)
BronkBox{1,1,1,m}={};
else
cellPath=strcat(seqPath,'\',Run);
cells = LoadCells(cellPath, TrackVersion, 'Compact', true);
fluorProps = {cells.regionProps};
fluorProps = cellfun(@fieldnames, fluorProps,'UniformOutput', false);
fluorProps = unique(cat(1,fluorProps{:}))';
BronkBox=cell(length(cells),max([cells.stopT]),length(fluorProps),NumWells);
for k=1:length(fluorProps)
currProp=fluorProps{k};
Test='MinorAxisLength';
for j=1:length(cells)
c = cells(j);
t = c.firstFrame : c.lastFrame;
tp=1;
for i=t
BronkBox{j,i,k,m}=cells(1,j).regionProps.(currProp)(tp);
tp=tp+1;
end
end
end
end
end
empties=cellfun('isempty',BronkBox);
BronkBox(empties) = {NaN};
Data=cell2mat(BronkBox);
means=mean(Data(:,:,:,:),'omitnan');
medians=median(Data(:,:,:,:),'omitnan');
stds=std(Data(:,:,:,:),'omitnan');
vars=var(Data(:,:,:,:),'omitnan');
sums=sum(Data(:,:,:,:),'omitnan');
CVs=stds./means;