-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresPlus.m
More file actions
57 lines (41 loc) · 1.13 KB
/
Copy pathresPlus.m
File metadata and controls
57 lines (41 loc) · 1.13 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
stack = stackRead('C:\Users\Matteus\ImageTraining\stack.tif');
stack = stack(:,:,1:20);
stackd = double(stack);
radius = 3.5;
nframes = size(stackd,3);
%%
rawStack = stackd;
stackd(abs(stackd)<95)=0;
prj = sum(stackd,3);
%
% for istack = 1:size(stackd,3)
% slice = stackd(:,:,istack);
[ix,iy] = find(prj > 95);
Pset = [ix,iy];
[clustCent,point2cluster,clustMembsCell] = MeanShiftCluster(Pset',radius);
%
x = Pset';
numClust = length(clustMembsCell);
figure(10),hold on
cVec = 'bgrcmykbgrcmykbgrcmykbgrcmyk';%, cVec = [cVec cVec];
for k = 1:min(numClust,length(cVec))
myMembers = clustMembsCell{k};
myClustCen = clustCent(:,k);
plot(x(1,myMembers),x(2,myMembers),[cVec(k) '.'])
plot(myClustCen(1),myClustCen(2),'o','MarkerEdgeColor','k','MarkerFaceColor',cVec(k), 'MarkerSize',10)
end
title(['no shifting, numClust:' int2str(numClust)])
size(clustCent)
% end
%%
Points = zeros(numClust,nframes);
%
for iframe = 1:nframes
for iclust = 1:numClust
Points(iclust,iframe) = norm(rawStack(Pset(clustMembsCell{iclust},1),Pset(clustMembsCell{iclust},2),iframe));
end
end
%%
figure(1010)
hold on
plot(Points(1,:))