-
Notifications
You must be signed in to change notification settings - Fork 1
/
similaritytest.m
36 lines (30 loc) · 957 Bytes
/
similaritytest.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
function max_Z = similaritytest(Temp_Coordinates_Unit, bone_indx, bone_coord)
load averages.mat
load means.mat
if bone_indx == 1
if bone_coord == 1
m = 3;
elseif bone_coord == 2
m = 5;
else
m = 4;
end
elseif bone_indx == 2
if bone_coord == 1
m = 1;
else
m = 2;
end
else
m = bone_indx + 3;
end
AP_diff = atan2d(norm(cross(Temp_Coordinates_Unit(2,:),mean_AP(m,:))),dot(Temp_Coordinates_Unit(2,:),mean_AP(m,:)));
SI_diff = atan2d(norm(cross(Temp_Coordinates_Unit(4,:),mean_SI(m,:))),dot(Temp_Coordinates_Unit(4,:),mean_SI(m,:)));
ML_diff = atan2d(norm(cross(Temp_Coordinates_Unit(6,:),mean_ML(m,:))),dot(Temp_Coordinates_Unit(6,:),mean_ML(m,:)));
if ML_diff > 90
ML_diff = 180 - ML_diff;
end
AP_Z = abs((AP_diff - AP_average(m)) / AP_std(m));
ML_Z = abs((ML_diff - ML_average(m)) / ML_std(m));
SI_Z = abs((SI_diff - SI_average(m)) / SI_std(m));
max_Z = max([AP_Z,ML_Z,SI_Z]);