-
Notifications
You must be signed in to change notification settings - Fork 0
/
viewResults_Registration.m
55 lines (46 loc) · 1.45 KB
/
viewResults_Registration.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
addpath '../../utilities/matlab/'
% load source data
% SourcePts contains the coordinates of the vertices, SourceEdges contains a connectivity matrix for the definition of the edges
[SourcePts SourceEdges] = VTKPolyDataReader(['ellipse.vtk']);
% load target data
[TargetPts TargetEdges] = VTKPolyDataReader(['ellipse_flow__t_19.vtk']);
% load deformation of source data
for t=1:20
Pts{t} = VTKPolyDataReader(['ellipse_flow__t_' num2str(t-1) '.vtk']);
end
% see source and target
figure;
set(gcf,'OuterPosition',[0 0 500 500]);
for t=1:20
clf;
hold on
for k=1:size(TargetEdges,1)
plot(TargetPts(TargetEdges(k,:),1),TargetPts(TargetEdges(k,:),2),'-r','LineWidth',2);
end
for k=1:size(SourceEdges,1)
plot(SourcePts(SourceEdges(k,:),1),SourcePts(SourceEdges(k,:),2),'-r','LineWidth',2);
plot(Pts{t}(SourceEdges(k,:),1),Pts{t}(SourceEdges(k,:),2),'-b','LineWidth',2);
end
axis([-150 100 -100 120]);
pause(0.5);
end
figure;
set(gcf,'OuterPosition',[0 500 1500 500]);
subplot(1,3,1)
hold on
for k=1:size(SourceEdges,1)
plot(SourcePts(SourceEdges(k,:),1),SourcePts(SourceEdges(k,:),2),'-r','LineWidth',2);
end
axis([-150 100 -100 120]);
subplot(1,3,2)
hold on
for k=1:size(SourceEdges,1)
plot(Pts{20}(SourceEdges(k,:),1),Pts{20}(SourceEdges(k,:),2),'-b','LineWidth',2);
end
axis([-150 100 -100 120]);
subplot(1,3,3)
hold on
for k=1:size(TargetEdges,1)
plot(TargetPts(TargetEdges(k,:),1),TargetPts(TargetEdges(k,:),2),'-r','LineWidth',2);
end
axis([-150 100 -100 120]);