|
38 | 38 | % getBiNodalComparisonPlot - returns a global comparison plot |
39 | 39 | % getBiNodalRandomComparisonPlot - returns a global randomcomparison plot |
40 | 40 | % |
41 | | - % See also Analysis, MeasurementST_BUD, RandomComparisonST_BUD, ComparisonST_BUD |
| 41 | + % See also Analysis, MeasurementCON_BUD, RandomComparisonCON_BUD, ComparisonCON_BUD |
42 | 42 |
|
43 | 43 | methods |
44 | 44 | function analysis = AnalysisCON_BUD(id, label, notes, cohort, measurements, randomcomparisons, comparisons, varargin) |
45 | 45 | % AnalysisCON_BUD(ID, LABEL, NOTES, COHORT, MEASUREMENTS, RANDOMCOMPARISON, COMPARISONS) |
46 | 46 | % creates a connectivity analysis of fixed density with ID, LABEL, |
47 | | - % COHORT, MEASUREMENTS, RANDOMCOMPARISON and COMPARISONS. It |
48 | | - % initializes the ANALYSISST_WU with default settings. |
| 47 | + % COHORT, MEASUREMENTS, RANDOMCOMPARISON and COMPARISONS. It |
| 48 | + % initializes the ANALYSISCON_WU with default settings. |
49 | 49 | % |
50 | 50 | % AnalysisCON_BUD(ID, LABEL, NOTES, COHORT, MEASUREMENTS, RANDOMCOMPARISON, COMPARISONS, PROPERTY, VALUE, ...) |
51 | 51 | % creates a connectivity analysis of fixed density with ID, LABEL, |
52 | 52 | % COHORT, MEASUREMENTS, RANDOMCOMPARISON and COMPARISONS. It |
53 | | - % initializes the ANALYSISST_WU with specified settings VALUES. |
| 53 | + % initializes the ANALYSISCON_WU with specified settings VALUES. |
54 | 54 | % |
55 | | - % See also MeasurementST_WU, RandomComparisonST_WU, ComparisonST_WU. |
56 | | - |
| 55 | + % See also MeasurementCON_WU, RandomComparisonCON_WU, ComparisonCON_WU. |
| 56 | + |
57 | 57 | analysis = analysis@AnalysisCON_WU(id, label, notes, cohort, measurements, randomcomparisons, comparisons, varargin{:}); |
58 | 58 | end |
59 | 59 | end |
|
65 | 65 | % creates a measurement ID with the ANALYSIS class, the |
66 | 66 | % MEASURE_CODE, the GROUP and the DENSITY. |
67 | 67 | % |
68 | | - % See also getRandomComparisonID, getComparisonID. |
| 68 | + % See also getRandomComparisonID, getComparisonID. |
69 | 69 |
|
70 | 70 | measurement_id = getMeasurementID@AnalysisCON_WU(analysis, measure_code, group, varargin{:}); |
71 | 71 |
|
72 | 72 | density = get_from_varargin(0, 'density', varargin{:}); |
73 | | - measurement_id = [measurement_id ' density=' num2str(density)]; |
| 73 | + measurement_id = [measurement_id ' density=' num2str(density)]; |
74 | 74 | end |
75 | 75 | function randomcomparison_id = getRandomComparisonID(analysis, measure_code, group, varargin) |
76 | 76 | % GETRANDOMCOMPARISONID returns a random comparison ID |
|
79 | 79 | % creates a random comparison ID with the ANALYSIS class, the |
80 | 80 | % MEASURE_CODE, the GROUP and the DENSITY. |
81 | 81 | % |
82 | | - % See also getMeasurementID, getComparisonID. |
83 | | - |
| 82 | + % See also getMeasurementID, getComparisonID. |
| 83 | + |
84 | 84 | randomcomparison_id = getRandomComparisonID@AnalysisCON_WU(analysis, measure_code, group, varargin{:}); |
85 | 85 |
|
86 | 86 | density = get_from_varargin(0, 'density', varargin{:}); |
|
102 | 102 | end |
103 | 103 | end |
104 | 104 | methods (Access = protected) |
105 | | - function g = get_graph_for_subjects(analysis, subjects, varargin) |
106 | | - % GET_GRAPH_FOR_SUBJECTS returns the graph created with the correlation matrix |
| 105 | + function graphs = get_graphs_for_group(analysis, group, varargin) |
| 106 | + % GET_GRAPH_FOR_GROUP returns the graph created with the group data |
107 | 107 | % |
108 | | - % G = GET_GRAPH_FOR_SUBJECTS(ANALYSIS, SUBJECTS, PROPERY, VALUE, ...) creates a |
| 108 | + % G = GET_GRAPH_FOR_GROUP(ANALYSIS, GROUP) creates a |
109 | 109 | % graph with the correlation matrix made of the data of |
110 | | - % subjects. It will binarize the matrix depending on the |
111 | | - % PROPERTY and VALUE. |
| 110 | + % subjects of the group |
112 | 111 | % |
113 | 112 | % See also calculate_measurement. |
114 | 113 |
|
115 | | - atlases = analysis.cohort.getBrainAtlases(); |
116 | | - atlas = atlases{1}; |
| 114 | + graph_type = analysis.getGraphType(); |
| 115 | + subjects = group.getSubjects(); |
| 116 | + graphs = cell(1, group.subjectnumber()); |
117 | 117 |
|
118 | | - subject_number = numel(subjects); |
119 | | - |
120 | | - data = zeros(subject_number, atlas.getBrainRegions().length()); |
121 | | - for i = 1:1:subject_number |
| 118 | + for i = 1:1:group.subjectnumber() |
122 | 119 | subject = subjects{i}; |
123 | | - data(i, :) = subject.getData('CON').getValue(); % st data |
| 120 | + A = subject.getData('CON').getValue(); % CON matrix |
| 121 | + |
| 122 | + density = get_from_varargin(0, 'density', varargin{:}); |
| 123 | + A = binarize(A, 'density', density, varargin{:}); |
| 124 | + |
| 125 | + graphs{i} = Graph.getGraph(graph_type, A); |
124 | 126 | end |
| 127 | + end |
| 128 | + function graph = get_graph_for_subject(analysis, subject, varargin) |
| 129 | + % GET_GRAPH_FOR_SUBJECT returns the graph created with the correlation matrix |
| 130 | + % |
| 131 | + % G = GET_GRAPH_FOR_SUBJECT(ANALYSIS, SUBJECT, PROPERY, VALUE, ...) creates a |
| 132 | + % graph with the correlation matrix made of the data of |
| 133 | + % subject. It will binarize the matrix depending on the |
| 134 | + % PROPERTY and VALUE. |
| 135 | + % |
| 136 | + % See also calculate_measurement. |
125 | 137 |
|
126 | | - correlation_rule = analysis.getSettings('AnalysisCON.CorrelationRule'); |
127 | | - negative_weight_rule = analysis.getSettings('AnalysisCON.NegativeWeightRule'); |
128 | | - A = Correlation.getAdjacencyMatrix(data, correlation_rule, negative_weight_rule); |
| 138 | + data = subject.getData('CON').getValue(); |
129 | 139 |
|
130 | 140 | density = get_from_varargin(0, 'density', varargin{:}); |
131 | | - A = binarize(A, 'density', density, varargin{:}); |
| 141 | + A = binarize(data, 'density', density, varargin{:}); |
132 | 142 |
|
133 | | - graph_type = AnalysisCON_WU.getGraphType(); |
134 | | - g = Graph.getGraph(graph_type, A); |
| 143 | + graph_type = analysis.getGraphType(); |
| 144 | + graph = Graph.getGraph(graph_type, A); |
135 | 145 | end |
136 | 146 | end |
137 | 147 | methods (Static) % Descriptive functions |
|
172 | 182 | function graph_type = getGraphType() |
173 | 183 | % GETGRAPHTYPE returns the compatible type of graph |
174 | 184 | % |
175 | | - % GRAPH_TYPE = GETGRAPHTYPE() returns the compatible type of |
| 185 | + % GRAPH_TYPE = GETGRAPHTYPE() returns the compatible type of |
176 | 186 | % graph 'GraphBU'. |
177 | 187 | % |
178 | 188 | % See also getSubjectClass. |
|
222 | 232 | % See also getGraphPanel, getGlobalPanel. |
223 | 233 |
|
224 | 234 | X = analysis.selectMeasurements(measure_code, group, '.getDensity()'); |
225 | | - if subject == 1 |
| 235 | + if subject == 1 |
226 | 236 | Y = analysis.selectMeasurements(measure_code, group, '.getGroupAverageValue()'); |
227 | | - else |
| 237 | + else |
228 | 238 | measurements = analysis.selectMeasurements(measure_code, group, '.getMeasureValues()'); |
229 | 239 | Y = cellfun(@(x) x(subject-1), measurements); |
230 | 240 | end |
|
0 commit comments