-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgraph_debugging.m
34 lines (26 loc) · 957 Bytes
/
graph_debugging.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 graph_debugging(link_i,im_dim,sampling_rate_manual,smoothing)
%%Function for plotting the graph created by Skel2Graph3D.m while also providing the original image dimensions.
[test_I,test_J,test_K] = ind2sub(im_dim,link_i(1).point);
[test_I,test_J,test_K] = down_sample_link(test_I,test_J,test_K,sampling_rate_manual);
if smoothing == 1
test_I = smoothdata(test_I,'rloess');
test_J = smoothdata(test_J,'rloess');
test_K = smoothdata(test_K,'rloess');
end
figure(99)
plot3(test_I,test_J,test_K,'*-')
axis([0 im_dim(1) 0 im_dim(2) 0 im_dim(3)])
hold on;
if length(link_i) > 1
for i=2:length(link_i)
[test_I,test_J,test_K] = ind2sub(im_dim,link_i(i).point);
if smoothing == 1
test_I = smoothdata(test_I,'rloess');
test_J = smoothdata(test_J,'rloess');
test_K = smoothdata(test_K,'rloess');
end
plot3(test_I,test_J,test_K,'*-')
end
end
hold off;
end