-
Notifications
You must be signed in to change notification settings - Fork 0
/
featureValueTableSumbul.m
78 lines (52 loc) · 2.29 KB
/
featureValueTableSumbul.m
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
clear all, close all
r = RGCclass(0);
r.lazyLoad('knownSumbul');
uID = unique(r.RGCtypeID);
nID = numel(uID);
% Variable name, unit, scaling factor, mean formating, SD formating
printInfo = {{'biStratificationDistance', '$\mu m$', 1, '%.1f', '%.1f'}, ...
{'branchAssymetry', [], 1, '%.2f', '%.2f'}, ...
{'dendriticField', '$mm^2$', 1e-6, '%.2f', '%.2f'}, ...
{'dendriticDensity', '$\mu m^{-1}$', 1, '%.2f', '%.2f'}, ...
{'dendriticDiameter', '$\mu m$', 1, '%.0f', '%.0f'}, ...
{'densityOfBranchPoints', '$mm^{-2}$', 1e6, '%.0f', '%.0f'}, ...
{'fractalDimensionBoxCounting', [], 1, '%.2f', '%.2f'}, ...
{'meanBranchAngle', 'degrees', 180/pi, '%.0f', '%.0f'}, ...
{'meanSegmentLength', '$\mu m$', 1, '%.1f', '%.1f'}, ...
{'meanSegmentTortuosity', [], 1, '%.2f', '%.2f'}, ...
{'meanTerminalSegmentLength', '$\mu m$', 1, '%.1f', '%.1f'}, ...
{'numBranchPoints', [], 1, '%.0f', '%.0f'}, ...
... % {'numLeaves', [], 1, '%.0f', '%.0f'}, ...
... % {'numSegments', [], 1, '%.0f', '%.0f'}, ...
... % {'somaArea', '$\mu m^2$', 1, '%.0f', '%.0f'}, ... % No soma area in dataset
{'stratificationDepth', '$\mu m$', 1, '%.0f', '%.0f'}, ...
{'totalDendriticLength', '$mm$', 1e-3, '%.1f', '%.1f'}};
headerStr1 = '\\begin{sidewaystable}\n\\begin{tabular}{llllllll}\n';
headerStr2 = ' & \\multicolumn{5}{c}{Cell Type}\\\\\n\\cline{2-6}\n';
fprintf(headerStr1)
fprintf(headerStr2)
fprintf('Feature name')
for i = 1:nID
idx = find(r.RGCtypeID == uID(i));
fprintf(' & %s', r.RGCtypeName{idx(1)})
end
fprintf('\\\\\n\\hline\n')
for i = 1:numel(r.allFeatureNames)
feat = printInfo{i}{1};
featName = r.featureNameDisplay(feat);
unitStr = printInfo{i}{2};
val = r.getVariable(feat);
if(isempty(unitStr))
fprintf('%s', featName)
else
fprintf('%s (%s)', featName, unitStr)
end
for j = 1:nID
idx = find(r.RGCtypeID == uID(j));
formatStr = sprintf('& $%s \\\\pm %s$', printInfo{i}{4}, printInfo{i}{5});
scale = printInfo{i}{3};
fprintf(formatStr,scale*mean(val(idx)),scale*std(val(idx)))
end
fprintf('\\\\\n')
end
fprintf('\\hline\n\\end{tabular}\n\\end{sidewaystable}\n')