-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaverage_clusters.m
More file actions
32 lines (27 loc) · 1.01 KB
/
average_clusters.m
File metadata and controls
32 lines (27 loc) · 1.01 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
%% OVERLAY CALLS
% DO NOT USE UNTIL you have run unsupervised clustering analysis
% Uses ClusteringData cell from an Extracted Countours file
% Isolates all image maps for each call cluster
% Resizes and averages images to obtain an averaged call for each cluster
% Used to assess homeogeneity/validity of the clusters
%Resize all calls to 300x600 px image
resize = [300 600];
clusters = unique(T.Label); %Get the number of clusters
figure(1);
for i=1:length(clusters)
%Resize all the images that correspond to label i
indexes = T.Label==i;
rows_orig = find(indexes==1);
rows = randsample(rows_orig,15); %Overlay a random subset of the images
composite_im = uint8([zeros(300) zeros(300)]);
for j=1:length(rows)
subTCell = ClusteringData{rows(j),1};
new_image = imresize(subTCell,resize);
ClusteringData{rows(j),1}=new_image;
composite_im = imfuse(composite_im,new_image);
end
subplot(4,6,i)
image(composite_im);
set(gca,'XTick',[], 'YTick', [])
box off;
end