-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathplot_motion.m
48 lines (43 loc) · 1.08 KB
/
plot_motion.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
function [] = plot_motion(mov)
% [] = plot_motion(mov)
%
% This function will plot the translation and rotation parameters following
% realignment and save them to a pdf file.
%
% ------
% INPUTS
% ------
%
% mov - an N x 6 matrix, where N = number of time points. Each column
% represents a different motion parameter as per the following order:
% 1 - x translation; 2 - y translation; 3 - z translation; 4 - pitch;
% 5 - roll; 6 - yaw.
%
% -------
% OUTPUTS
% -------
%
% pdf file contating separate plots for both
%
%==========================================================================
figure(10)
subplot(2,1,1)
plot(mov(:,1));
hold on
plot(mov(:,2),'g');
plot(mov(:,3),'r');
title('translation','fontsize',15,'fontweight','bold')
legend({'x','y','z'})
ylabel('mm')
xlabel('time (volumes)')
subplot(2,1,2)
plot(mov(:,4));
hold on
plot(mov(:,5),'g');
plot(mov(:,6),'r');
title('rotation','fontsize',15,'fontweight','bold');
legend({'pitch','roll','yaw'})
ylabel('degrees')
xlabel('time (volumes)')
set(gcf,'color','white');
saveas(gcf,['prepro_report_motion_',date],'pdf')