-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExampleImages.m
More file actions
executable file
·182 lines (147 loc) · 4.59 KB
/
ExampleImages.m
File metadata and controls
executable file
·182 lines (147 loc) · 4.59 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
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
clear all
%% Plot the example images
SourceFileCell = {...
'./ExtractedStacks/Cond_3/Image_1.mat',...
'./ExtractedStacks/Cond_5/Image_7.mat',...
'./ExtractedStacks/Cond_9/Image_1.mat',...
'./ExtractedStacks/Cond_11/Image_2.mat',...
};
OP_blurRange = 0.0001; % micrometers
Ser2P_blurRange = 0.0001; % micrometers
Ser5P_blurRange = 0.0001; % micrometers
% imgInds = {[1,7],[2,8]}; %[1,3]
imgRanges = {...
[42.5,44.8,25.5,27.8],...
[41.2,43.5,31.5,33.8],...
[12.7,15,33,35.3],...
[28.3,30.6,56.3,58.6]};
zCoordinate = [23,44,25,46];
rotate_flag = [false,false,false,false];
zoomLocations = {[6.78,2.48],[7.45,3.2]};
zoomRange = 3.0; % in microns
plotTitles = {'SE1'};
scaleBar = 1.0; % in microns
Ser5P_lim_topUp = 800;
numPlots = numel(imgRanges);
figure(1)
clf
for pp = 1:numPlots
pp
thisFilePath = SourceFileCell{pp};
loadStruct = load(thisFilePath,...
'imgStack','imgSize','pixelSize','zStepSize');
imgStack = loadStruct.imgStack;
imgSize = loadStruct.imgSize;
pixelSize = loadStruct.pixelSize;
zStepSize = loadStruct.zStepSize;
thisImg = imgStack;
thisPixelSize = pixelSize;
% --- Removal of DNA background
OP_img = double(thisImg{1}(:,:,zCoordinate(pp)));
Ser2P_img = double(thisImg{2}(:,:,zCoordinate(pp)));
Ser5P_img = double(thisImg{3}(:,:,zCoordinate(pp)));
if rotate_flag(pp)
OP_img = OP_img';
Ser2P_img = Ser2P_img';
Ser5P_img = Ser5P_img';
end
OP_img = imgaussfilt(OP_img,...
OP_blurRange./thisPixelSize);
Ser5P_img = imgaussfilt(Ser5P_img,...
Ser5P_blurRange./thisPixelSize);
Ser2P_img = imgaussfilt(Ser2P_img,...
Ser2P_blurRange./thisPixelSize);
thisImgRange = round(imgRanges{pp}./thisPixelSize)+1;
OP_img = OP_img(...
thisImgRange(1):thisImgRange(2),...
thisImgRange(3):thisImgRange(4));
Ser2P_img = Ser2P_img(...
thisImgRange(1):thisImgRange(2),...
thisImgRange(3):thisImgRange(4));
Ser5P_img = Ser5P_img(...
thisImgRange(1):thisImgRange(2),...
thisImgRange(3):thisImgRange(4));
thisSize = size(Ser5P_img)
OP_lims = prctile(OP_img(:),[10,99.9]);
Ser5P_img = Ser5P_img./median(Ser5P_img(:));
Ser5P_lims = [0.7,2.5];
Ser2P_lims = prctile(Ser2P_img(:),[10,99]);
subplot(3,numPlots.*2,numPlots.*0+1+(pp-1).*2)
imagesc([0,thisSize(2)].*thisPixelSize,...
[0,thisSize(1)].*thisPixelSize,...
OP_img,OP_lims)
axis equal tight
set(gca,'XTick',[],'YTick',[])
set(gca,'YDir','normal')
hold on
plot([0.1,0.1+scaleBar],thisSize(1).*thisPixelSize-[0.1,0.1],...
'w-','LineWidth',3) % Plot scale bar
textObject = ...
text(0.1+0.5.*scaleBar,thisSize(2).*thisPixelSize-0.3,...
sprintf('%d \\mum',scaleBar));
set(textObject,'Color',[1,1,1],'HorizontalAlignment','center',...
'FontSize',12)
ylabel('Oligopaint')
subplot(3,numPlots.*2,numPlots.*2+1+(pp-1).*2)
imagesc([0,thisSize(2)].*thisPixelSize,...
[0,thisSize(1)].*thisPixelSize,...
Ser5P_img,Ser5P_lims)
axis equal tight
set(gca,'XTick',[],'YTick',[])
set(gca,'YDir','normal')
ylabel('Pol II S5P')
colormap(gray)
subplot(3,numPlots.*2,numPlots.*4+1+(pp-1).*2)
imagesc([0,thisSize(2)].*thisPixelSize,...
[0,thisSize(1)].*thisPixelSize,...
Ser2P_img,Ser2P_lims)
axis equal tight
set(gca,'XTick',[],'YTick',[])
set(gca,'YDir','normal')
ylabel('Pol II S2P')
colormap((gray))
% --- OP / Ser5P
% Prepare the color channels for RGB plotting
this_magenta_plot = ...
(Ser5P_img-Ser5P_lims(1))./diff(Ser5P_lims);
this_green_plot = ...
(OP_img-OP_lims(1))./diff(OP_lims);
thisSize = size(OP_img);
subplot(3,numPlots.*2,numPlots.*0+2+(pp-1).*2)
redChannel = this_magenta_plot;
blueChannel = this_magenta_plot;
greenChannel = this_green_plot;
rgb_img = zeros(thisSize(1),thisSize(2),3);
rgb_img(:,:,1) = redChannel;
rgb_img(:,:,2) = greenChannel;
rgb_img(:,:,3) = blueChannel;
image([0,thisSize(2)].*thisPixelSize,...
[0,thisSize(1)].*thisPixelSize,...
rgb_img)
set(gca,'XTick',[],'YTick',[])
set(gca,'YDir','normal')
ylabel('OP / Pol II Ser5P')
axis equal tight
% --- OP / Ser2P
% Prepare the color channels for RGB plotting
this_magenta_plot = ...
(Ser2P_img-Ser2P_lims(1))./diff(Ser2P_lims);
this_green_plot = ...
(OP_img-OP_lims(1))./diff(OP_lims);
thisSize = size(OP_img);
subplot(3,numPlots.*2,numPlots.*2+2+(pp-1).*2)
redChannel = this_magenta_plot;
blueChannel = this_magenta_plot;
greenChannel = this_green_plot;
rgb_img = zeros(thisSize(1),thisSize(2),3);
rgb_img(:,:,1) = redChannel;
rgb_img(:,:,2) = greenChannel;
rgb_img(:,:,3) = blueChannel;
image([0,thisSize(2)].*thisPixelSize,...
[0,thisSize(1)].*thisPixelSize,...
rgb_img)
set(gca,'XTick',[],'YTick',[])
set(gca,'YDir','normal')
ylabel('OP / Pol II Ser2P')
axis equal tight
end