-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmidlineIntensity.m
More file actions
127 lines (117 loc) · 5.16 KB
/
midlineIntensity.m
File metadata and controls
127 lines (117 loc) · 5.16 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
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
%%%% Intensity plot along the middle line of the rotationally symmetric
%%%% structures
%%%% Sebastien Callens
clear; close all; clc;
cmap = coolwarm(256);
cmap2 = fire(256);
color1 = [239,193,100]/255; % yellowish
color2 = [243,131,93]/255; % orangeish
color3 = [243,89,85]/255; % redish
color4 = [40,98,117]/255; % dark blueish
color5 = [0,67,76]/255; % darker blueish
%% Input
substrate = 'Unduloid';
caseImg = 'D8ConvexDiff';
switch substrate
case 'Spheres'
switch caseImg
case 'D8ConvexDiff'
ImgA = load('example_data/20191204_D8ConvexDiffBS2Spheres_actin.mat');
ImgB = load('example_data/20191212_D8ConvexDiffS4BSpheres_actin.mat');
ImgC = load('example_data/20200116_D8ConvexDiffS2Spheres_actin.mat');
ImgD = load('example_data/20200121_D8ConvexDiffS4Spheres_actin.mat');
ImgA = double(ImgA.Img);
ImgB = double(ImgB.Img);
ImgC = double(ImgC.Img);
ImgD = double(ImgD.Img);
Img = ImgA/mean(ImgA,'all')+ImgB/mean(ImgB,'all')+ImgC/mean(ImgC,'all')+ImgD/mean(ImgD,'all');
end
case 'Unduloid'
switch caseImg
case 'D8ConvexDiff'
ImgA = load('example_data/20191204_D8ConvexDiffBS2Unduloid_actin.mat');
ImgB = load('example_data/20191212_D8ConvexDiffBS4Unduloid_actin.mat');
ImgC = load('example_data/20200116_D8ConvexDiffS2Unduloid_actin.mat');
ImgD = load('example_data/20200121_D8ConvexDiffS4Unduloid_actin.mat');
ImgA = double(ImgA.Img);
ImgB = double(ImgB.Img);
ImgC = double(ImgC.Img);
ImgD = double(ImgD.Img);
Img = ImgA/mean(ImgA,'all')+ImgB/mean(ImgB,'all')+ImgC/mean(ImgC,'all')+ImgD/mean(ImgD,'all');
end
case 'Catenoids'
switch caseImg
case 'D8ConvexDiff'
ImgA = load('example_data/20191204_D8ConvexDiffBS2Catenoids_actin.mat');
ImgB = load('example_data/20191212_D8ConvexDiffS4BCatenoids_actin.mat');
ImgC = load('example_data/20200116_D8ConvexDiffS2Catenoid_actin.mat');
ImgD = load('example_data/20200121_D8convexDiffS4Catenoid_actin.mat');
ImgA = double(ImgA.Img);
ImgB = double(ImgB.Img);
ImgC = double(ImgC.Img);
ImgD = double(ImgD.Img);
Img = ImgA/mean(ImgA,'all')+ImgB/mean(ImgB,'all')+ImgC/mean(ImgC,'all')+ImgD/mean(ImgD,'all');
end
case 'Pseudospheres'
switch caseImg
case 'D8ConvexDiff'
ImgA = load('example_data/20191204_D8ConvexDiffBS2Pseudospheres_actin.mat');
ImgB = load('example_data/20191212_D8ConvexDiffS4BPseudospheres_actin.mat');
ImgC = load('example_data/20200116_D8ConvexDiffS2Pseudospheres_actin.mat');
ImgD = load('example_data/20200121_D8ConvexDiffS4Pseudospheres_actin.mat');
ImgA = double(ImgA.Img);
ImgB = double(ImgB.Img);
ImgC = double(ImgC.Img);
ImgD = double(ImgD.Img);
Img = ImgA/mean(ImgA,'all')+ImgB/mean(ImgB,'all')+ImgC/mean(ImgC,'all')+ImgD/mean(ImgD,'all');
end
case 'Cylinder'
switch caseImg
case 'D8ConvexDiff'
ImgA = load('example_data/20191204_D8ConvexDiffBS2Cylinder_actin.mat');
ImgB = load('example_data/20191212_D8ConvexDiffS4BCylinder_actin.mat');
ImgC = load('example_data/20200121_D8ConvexDiffS4Cylinder_actin.mat');
ImgA = double(ImgA.Img);
ImgB = double(ImgB.Img);
ImgC = double(ImgC.Img);
Img = ImgA/mean(ImgA,'all')+ImgB/mean(ImgB,'all')+ImgC/mean(ImgC,'all');
end
end
%% Load curvature map and color image
load(strcat(substrate,'_k1Map.mat'));
load(strcat(substrate,'_k2Map.mat'));
if strcmp(substrate,'Wavy')
curvMap_k1 = flip(curvMap_k1,1);
curvMap_k2 = flip(curvMap_k2,1);
end
% Normalize curvature by radius of sphere
curvMap_k1 = curvMap_k1*180;
curvMap_k2 = curvMap_k2*180;
%% Extract intensity along middle line
% Determine top and bottom point for every structure
top = 1;
bottom = size(Img,1);
% Get midline (column number) of the structure
midLine = round(size(Img,2)/2);
% Get intensity vector along midline, from top to bottom
midInt = Img(top:bottom,midLine);
midk1 = curvMap_k1(top:bottom,midLine);
midk2 = curvMap_k2(top:bottom,midLine);
%% Plot
figure
subplot(2,1,1)
plot(0.6*(1:1:length(midInt)),midInt,'Color',color1)
hold on
plot(0.6*(1:1:length(midInt)),smooth(midInt,80),'Color',color3,'LineWidth',2)
ylabel('Normalized intensity (a.u.)')
set(gca,'xtick',[])
axis tight
subplot(2,1,2)
plot(0.6*(1:1:length(midInt)),midk1,'Color',color4,'LineWidth',2)
hold on
plot(0.6*(1:1:length(midInt)),midk2,'Color',color2,'LineWidth',2)
xlabel('Position (\mum)')
ylabel('Principal curvature (-)')
legend('\kappa_1','\kappa_2')
legend('boxoff')
axis tight