forked from sarastokes/RabbitGammaCell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFullFigures.m
227 lines (188 loc) · 6.21 KB
/
FullFigures.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
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
% SETTINGS
% Each figure is in a separate section and can be run individually with
% ctrl + enter, or the
%
% Set this to the folder where you would like the images to be saved
saveDir = 'C:\...';
% Set to true if you want to save them. I keep this false until I finish
% setting colors, transparencies, etc, then set it to true.
saveMode = false; % true
% Once you're happy, run through everything with saveMode = true or
% save figures individually like:
% saveHighResImage(gcf, saveDir, 'filename.png')
%% Import segmented structures
c437_IDs = [158878, 158883, 158887, 158899, 158907];
c5544_IDs = [158826, 158953, 158828, 158829, 158832];
c5542_IDs = [158538, 158560, 128311, 158582, 158609, 158610, 158611,...
158614, 158618, 158626, 158629, 41588];
c6131_IDs = [158697, 158704, 136057, 158710, 158712, 158718, 158716,...
158736, 158940, 158942];
c13525_IDs = [158472, 158477, 158473, 158515];
c437_segments = [];
for i = 1:numel(c437_IDs)
c437_segments = cat(1, c437_segments, Neuron(c437_IDs(i), 'r'));
c437_segments(i).build();
end
c5544_segments = [];
for i = 1:numel(c5544_IDs)
c5544_segments = cat(1, c5544_segments, Neuron(c5544_IDs(i), 'r'));
c5544_segments(i).build();
end
c5542_segments = [];
for i = 1:numel(c5542_IDs)
c5542_segments = cat(1, c5542_segments, Neuron(c5542_IDs(i), 'r'));
c5542_segments(i).build();
end
c6131_segments = [];
for i = 1:numel(c6131_IDs)
c6131_segments = cat(1, c6131_segments, Neuron(c6131_IDs(i), 'r'));
c6131_segments(i).build();
end
c13525_segments = [];
for i = 1:numel(c13525_IDs)
c13525_segments = cat(1, c13525_segments, Neuron(c13525_IDs(i), 'r'));
c13525_segments(i).build();
end
% -------------------------------------------------------------------------
%% Figure 2
% -------------------------------------------------------------------------
c13525 = Neuron(13525, 'r');
c476 = Neuron(476, 'r');
c476.render('FaceColor', [0.8, 0.8, 0.8], 'FaceAlpha', 0.6);
c13525.render('ax', gca, 'FaceColor', [0, 0.5, 1], 'FaceAlpha', 0.6);
view(-90, 180);
ylim([98, 165]);
set([gcf, gca], 'Color', 'k'); hideAxes(); tightfig(gcf);
if saveMode
saveHighResImage(gcf, saveDir, 'yourfilename.tiff');
end
% ---------------------------------------------------------------------
%% Figure 4
% ---------------------------------------------------------------------
% Figure 4A - side
c5544 = Neuron(5544, 'r');
c5544.render('FaceColor', [0, 1, 0.5], 'FaceAlpha', 0.6);
% Do the same for each segment
for i = 1:numel(c5544_segments)
c5544_segments(i).render('ax', gca, ...
'FaceColor', [0, 1, 0.5], 'FaceAlpha', 0.6);
end
view(90,90);
set([gcf, gca], 'Color', 'k'); hideAxes(); tightfig(gcf);
if saveMode
saveHighResImage(gcf, saveDir, 'yourfilename.tiff');
end
%% Figure 4A - flatmount
c5544 = Neuron(5544, 'r');
c5544.render('FaceColor', [0, 1, 0.5], 'FaceAlpha', 0.6);
% Do the same for each segment
for i = 1:numel(c5544_segments)
c5544_segments(i).render('ax', gca,...
'FaceColor', [0, 1, 0.5], 'FaceAlpha', 0.6);
end
view(0,90);
set([gcf, gca], 'Color', 'k'); hideAxes(); tightfig(gcf);
if saveMode
saveHighResImage(gcf, saveDir, 'yourfilename.tiff');
end
%% Figure 4B side
c437 = Neuron(437, 'r');
c437.render('FaceColor', [1, 0, 0], 'FaceAlpha', 0.6);
% Do the same for the segments
for i = 1:numel(c437_segments)
c437_segments(i).render('ax', gca,...
'FaceColor', [1, 0, 0], 'FaceAlpha', 0.6);
end
view(180, 180);
set([gcf, gca], 'Color', 'k'); hideAxes(); tightfig(gcf);
if saveMode
saveHighResImage(gcf, saveDir, 'yourfilename.tiff');
end
%% Figure 4B Flatmount
c437 = Neuron(437, 'r');
c437.render('FaceColor', [1, 0, 0], 'FaceAlpha', 0.6);
% Do the same for the segments
for i = 1:numel(c437_segments)
c437_segments(i).render('ax', gca,...
'FaceColor', [1, 0, 0], 'FaceAlpha', 0.6);
end
% 20um scalebar
plot([70 90], [195 195], 'w', 'LineWidth', 2);
view(180,90);
set([gcf, gca], 'Color', 'k');
hideAxes(); tightfig(gcf);
if saveMode
saveHighResImage(gcf, saveDir, 'yourfilename.tiff');
end
% ---------------------------------------------------------------------
%% Figure 5
% ---------------------------------------------------------------------
% Figure 5A
c5542 = Neuron(5542, 'r');
c5542.render('FaceColor', [0, 0.5, 1], 'FaceAlpha', 0.6);
% Do the same for the segments
for i = 1:numel(c5542_segments)
c5542_segments(i).render('ax', gca,...
'FaceColor', [0, 0.5, 1], 'FaceAlpha', 0.6);
end
view(270, 180);
set([gcf, gca], 'Color', 'k');
hideAxes(); tightfig(gcf);
if saveMode
saveHighResImage(gcf, saveDir, 'yourfilename.tiff');
end
% Flatmount view
view(0, 90);
if saveMode
saveHighResImage(gcf, saveDir, 'yourfilename.tiff');
end
%% Figure 5B
c6131 = Neuron(6131, 'r');
c6131.render('FaceColor', [0.5, 0, 1], 'FaceAlpha', 0.6);
% Do the same for the segments
for i = 1:numel(c6131_segments)
c6131_segments(i).render('ax', gca,...
'FaceColor', [0.5, 0, 1], 'FaceAlpha', 0.6);
end
view(90, 180);
set([gcf, gca], 'Color', 'k');
hideAxes(); tightfig(gcf);
if saveMode
saveHighResImage(gcf, saveDir, 'yourfilename.tiff');
end
%% Figure 5B - Flatmount view
c6131 = Neuron(6131, 'r');
c6131.render('FaceColor', [0.5, 0, 1], 'FaceAlpha', 0.6);
% Do the same for the segments
for i = 1:numel(c6131_segments)
c6131_segments(i).render('ax', gca,...
'FaceColor', [0.5, 0, 1], 'FaceAlpha', 0.6);
end
view(0,90);
set([gcf, gca], 'Color', 'k'); hideAxes(); tightfig(gcf);
if saveMode
saveHighResImage(gcf, saveDir, 'yourfilename.tiff');
end
%% Figure 5AB
c5542 = Neuron(5542, 'r');
c6131 = Neuron(6131, 'r');
c5542.render('FaceColor', [0, 0.5, 1], 'FaceAlpha', 1);
c6131.render('ax', gca, 'FaceColor', [0.5, 0, 1], 'FaceAlpha', 1);
% Set the segments similarly
for i = 1:numel(c5542_segments)
c5542_segments(i).render('ax', gca,...
'FaceColor', [0, 0.5, 1], 'FaceAlpha', 1);
end
for i = 1:numel(c6131_segments)
c6131_segments(i).render('ax', gca,...
'FaceColor', [0.5, 0, 1], 'FaceAlpha', 1);
end
% Clip out the somas, leaving only the dendrites
zlim([11.5 24]);
view(0,90);
% 20 um scalebar
plot3([165 185], [170 170], [24 24], 'w', 'LineWidth', 2);
set([gcf, gca], 'Color', 'k'); hideAxes(); tightfig(gcf);
if saveMode
saveHighResImage(gcf, saveDir, 'yourfilename.tiff');
end