-
Notifications
You must be signed in to change notification settings - Fork 0
/
Collecting_Histogram_Data.m
34 lines (29 loc) · 1.12 KB
/
Collecting_Histogram_Data.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
function [T]=Collecting_Histogram_Data(O,NumberOfCells)
Nucleus_ch=find(cell2mat(strfind(O.General_Thresholds.Label,'Nucleus')));
Cell_ch=find(cell2mat(strfind(O.General_Thresholds.Label,'Cell')));
nuc = O.IM{Nucleus_ch};
labelled_nuc = O.BW{Nucleus_ch};
% Display seed overlay
% figure
% imshow(nuc, [])
% hold on
% plot(Centroid(:,1),Centroid(:,2),'.r')
% Display labelled image
% figure
%imshow(labelled_nuc, [])
% TODO (Lior)
% initialize nuc_histograms as a array data type
% Loop over each nucleus (from 1 to max value in BW image)
% Get the original image intensity values for one nucleus
% Compute histogram(nuc_values(:))
% Store historgram result in nuc_histograms array
%% Histogram bins are equally spaced between min and max
nuc_histograms = [];
[maxVal] = max(labelled_nuc(:));
for cell_index = 1:maxVal
nuc_values = nuc(find(labelled_nuc==cell_index));
new_histogram = hist(nuc_values, 10);
nuc_histograms = [nuc_histograms; new_histogram];
end
T = table(nuc_histograms); % return histogram values
end