-
Notifications
You must be signed in to change notification settings - Fork 0
/
FullFigureDataIdentitySpacesAll.m
120 lines (104 loc) · 4.91 KB
/
FullFigureDataIdentitySpacesAll.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Core Model, 2022
% Written by Maya Davis
% Concept by Maya Davis and Melissa A. Redford
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function fullFigureData = FullFigureDataIdentitySpacesAll( ...
GoalList, MResultList, ActivationsList, ActivationsTime, ...
NumVerticalTiles, NumHorizontalTiles)
% Assumes that the transformation is the identity transformation and
% plots everything in the same space
PurpleClusterPlottingParameters;
plottingParameters = plottingParameters;
plottingParameters.NumberOfPointsBetweenPoints = 1;
%% CREATE FIGURE AND AXES
[Figure, axesList] = MakeFigureAndAxes([0.2 0 0.3], ...
[1 1 1], NumVerticalTiles, NumHorizontalTiles, [-2 37], [-1 18]);
Figure.WindowState = "maximized";
%% INITIALIZE SIZES OF LISTS
NumAxes = NumVerticalTiles * NumHorizontalTiles;
assert(NumAxes == length(GoalList));
clusterXList = cell(NumAxes, 1);
clusterYList = cell(NumAxes, 1);
clusterColorList = cell(NumAxes, 1);
clusterAlphaList = cell(NumAxes, 1);
silhouetteFaceList = cell(NumAxes, 1);
silhouetteVertexList = cell(NumAxes, 1);
silhouetteColorList = cell(NumAxes, 1);
silhouetteAlphaList = cell(NumAxes, 1);
trajectoryXList = cell(NumAxes, 1);
trajectoryYList = cell(NumAxes, 1);
trajectoryColorList = cell(NumAxes, 1);
resultXList = cell(NumAxes, 1);
resultYList = cell(NumAxes, 1);
resultColorList = cell(NumAxes, 1);
%% GOING THROUGH EACH OF THE AXES
for n = 1:NumAxes
goal = GoalList(n);
% Cluster values
AlphaClusterValues = ones(length(goal.Space.Clusters),1);
[MCXValues, MCYValues, MCColorValues, ~] = ...
goal.Space.MotorClusterPlottingInfo(...
plottingParameters.ClusterColorArray, AlphaClusterValues);
clusterXList{n} = MCXValues;
clusterYList{n} = MCYValues;
clusterColorList{n} = MCColorValues;
if ActivationsTime == 0
clusterAlphaList{n} = 0.5 * ones(size(ActivationsList{n}(:, 1)));
else
clusterAlphaList{n} = ActivationsList{n}(:, ActivationsTime);
end
% Silhouette values
[VertexData, FaceData, AlphaData] = ...
goal.Silhouette.PlottingInfo( ...
plottingParameters.MotorSilhouetteMinOpacity, ...
plottingParameters.MotorSilhouetteMaxOpacity);
silhouetteColorArray = zeros(size(FaceData, 1), 3);
for sColors = 1:size(silhouetteColorArray, 1)
silhouetteColorArray(sColors,:) = plottingParameters.MotorSilhouetteColor1;
end
silhouetteFaceList{n} = FaceData;
silhouetteVertexList{n} = VertexData;
silhouetteColorList{n} = silhouetteColorArray;
silhouetteAlphaList{n} = AlphaData;
% Trajectory values
[trajectoryXValues, trajectoryYValues, trajectoryColorValues] = ...
goal.Exemplar.PlottingInfo(...
plottingParameters.PerceptualTrajectoryColor1, ...
plottingParameters.PerceptualTrajectoryColor2);
trajectoryXList{n} = trajectoryXValues;
trajectoryYList{n} = trajectoryYValues;
trajectoryColorList{n} = trajectoryColorValues;
% Result values
[rawResultXValues, rawResultYValues, rawResultColorValues] = ...
MResultList(n).PlottingInfo(...
plottingParameters.ResultTrajectoryColor1, ...
plottingParameters.ResultTrajectoryColor2);
interpXM = transpose(1: ...
plottingParameters.NumberOfPointsBetweenPoints: ...
plottingParameters.NumberOfPointsBetweenPoints * ...
length(rawResultXValues) + 1 - ...
plottingParameters.NumberOfPointsBetweenPoints);
interpXQM = transpose(1: ...
plottingParameters.NumberOfPointsBetweenPoints ...
* length(rawResultXValues) + 1 - ...
plottingParameters.NumberOfPointsBetweenPoints);
resultXValues = interp1(interpXM, rawResultXValues, interpXQM);
resultYValues = interp1(interpXM, rawResultYValues, interpXQM);
resultColorValues = interp1(interpXM, rawResultColorValues, interpXQM);
resultXList{n} = resultXValues;
resultYList{n} = resultYValues;
resultColorList{n} = resultColorValues;
end
%% ADDITIONAL VALUES
junctureSizes = plottingParameters.JunctureSizes;
resultPointSizes = plottingParameters.ResultPointSizes;
%% MAKING FINAL OUTPUT
fullFigureData = FullFigureData(axesList, clusterXList, ...
clusterYList, clusterColorList, clusterAlphaList, ...
silhouetteFaceList, silhouetteVertexList, ...
silhouetteColorList, silhouetteAlphaList, ...
trajectoryXList, trajectoryYList, trajectoryColorList, ...
resultXList, resultYList, resultColorList, ...
junctureSizes, resultPointSizes);
end