Skip to content

Commit 9dcf943

Browse files
committed
GUIAnalysisSettings and child panels
1 parent c142024 commit 9dcf943

14 files changed

Lines changed: 685 additions & 28 deletions

braph2/analysis/test_GUIAnalysisSettings.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
temp = load(cohort_file, '-mat', 'cohort', 'selected_group', 'selected_subjects', 'BUILD');
3232
cohort = temp.cohort;
3333

34-
GUIAnalysisSettings(cohort, 'AnalysisCON_WU')
34+
GUIAnalysisSettings(cohort, 'AnalysisCON_BUD')
3535

3636
% set(gcf, 'CloseRequestFcn', 'closereq')
3737
% close(gcf)

braph2/workflows/Connectivity/AnalysisCON_WU.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@
207207
number_of_weights = analysis.getSettings('AnalysisCON.NumberOfWeights');
208208
verbose = get_from_varargin(false, 'Verbose', varargin{:});
209209
interruptible = get_from_varargin(0.001, 'Interruptible', varargin{:});
210-
M = get_from_varargin(1e+3, 'RandomComparisonCON.RandomizationNumber', varargin{:});
210+
M = get_from_varargin(1e+3, 'RandomizationNumber', varargin{:});
211211

212212
% Measurements for the group
213213
measurement_group = analysis.getMeasurement(measure_code, group, varargin{:});

braph2/workflows/Connectivity/ComparisonCON_BUD.m

Lines changed: 93 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,22 @@
1818
% getDescription - returns the description of the comparison
1919
% getAnalysisClass - returns the class of the analysis
2020
%
21-
% See also Comparison, AnalysisCON_BUD, MeasurementCON_BUD, RandomComparisonCON_BUD.
21+
% ComparisonCON_BUD plot methods (Static):
22+
% getComparisonSettingsPanel - returns a UIPanel
23+
%
24+
% See also Comparison, AnalysisCON_BUD, MeasurementCON_BUD, RandomComparisonCON_BUD.
2225

2326
properties (Access = protected)
2427
density % density of the values
2528
end
2629
methods % Constructor
2730
function c = ComparisonCON_BUD(id, label, notes, atlas, measure_code, group_1, group_2, varargin)
28-
% ComparisonCON_BUD(ID, LABEL, NOTES, ATLAS, MEASURE_CODE, GROUP_1, GROUP_2, 'density', DENSITY)
31+
% ComparisonCON_BUD(ID, LABEL, NOTES, ATLAS, MEASURE_CODE, GROUP_1, GROUP_2, 'density', DENSITY)
2932
% creates a comparison with ID, LABEL, ATLAS and MEASURE_CODE
3033
% between the data from GROUP_1 and GROUP_2. The data will have
3134
% a fixed DENSITY.
3235
%
33-
% ComparisonCON_BUD(ID, LABEL, NOTES, ATLAS, MEASURE_CODE, GROUP_1, GROUP_2)
36+
% ComparisonCON_BUD(ID, LABEL, NOTES, ATLAS, MEASURE_CODE, GROUP_1, GROUP_2)
3437
% creates a comparison with ID, LABEL, ATLAS and MEASURE_CODE
3538
% between the data from GROUP_1 and GROUP_2. The data will have
3639
% a fixed default DENSITY.
@@ -69,7 +72,7 @@ function setDensity(c, density)
6972
function class = getClass()
7073
% GETCLASS returns the class of connectivity comparison
7174
%
72-
% ANALYSIS_CLASS = GETCLASS(ANALYSIS) returns the class of
75+
% ANALYSIS_CLASS = GETCLASS(ANALYSIS) returns the class of
7376
% comparison. In this case 'ComparisonCON_BUD'.
7477
%
7578
% See also getList, getName, getDescription.
@@ -86,7 +89,7 @@ function setDensity(c, density)
8689
name = 'Comparison Connectivity BUD';
8790
end
8891
function description = getDescription()
89-
% GETDESCRIPTION returns the description of connectivity comparison
92+
% GETDESCRIPTION returns the description of connectivity comparison
9093
%
9194
% DESCRIPTION = GETDESCRIPTION() returns the description
9295
% of ComparisonCON_BUD.
@@ -100,7 +103,7 @@ function setDensity(c, density)
100103
];
101104
end
102105
function analysis_class = getAnalysisClass()
103-
% GETANALYSISCLASS returns the class of the analsysis
106+
% GETANALYSISCLASS returns the class of the analsysis
104107
%
105108
% ANALYSIS_CLASS = GETANALYSISCLASS() returns the class of the
106109
% analysis the comparison is part of, 'AnalysisCON_BUD'.
@@ -110,4 +113,88 @@ function setDensity(c, density)
110113
analysis_class = 'AnalysisCON_BUD';
111114
end
112115
end
116+
methods (Static) % Plot MeasurementGUI Child Panel
117+
function handle = getComparisonSettingsPanel(analysis, uiparent) %#ok<INUSL>
118+
% GETCHILDPANEL returns a dynamic UIPanel
119+
%
120+
% HANDLE = GETCHILDPANEL(ANALYSIS, UIPARENT) returns a dynamic
121+
% UIPanel. Modificable settings are: Verbose, Interruptible,
122+
% Permutation and Density.
123+
%
124+
% See also ComparisonST_BUD.
125+
126+
set(uiparent, 'Visible', 'on')
127+
ui_density_text = uicontrol('Parent', uiparent, 'Units', 'normalized', 'Style', 'text');
128+
ui_density_edit = uicontrol('Parent', uiparent, 'Units', 'normalized', 'Style', 'edit');
129+
ui_density_min_text = uicontrol('Parent', uiparent, 'Units', 'normalized', 'Style', 'text');
130+
ui_density_min_edit = uicontrol('Parent', uiparent, 'Units', 'normalized', 'Style', 'edit');
131+
ui_density_max_text = uicontrol('Parent', uiparent, 'Units', 'normalized', 'Style', 'text');
132+
ui_density_max_edit = uicontrol('Parent', uiparent, 'Units', 'normalized', 'Style', 'edit');
133+
ui_permutation_text = uicontrol('Parent', uiparent, 'Units', 'normalized', 'Style', 'text');
134+
ui_permutation_edit = uicontrol('Parent', uiparent, 'Units', 'normalized', 'Style', 'edit');
135+
init_child_panel()
136+
function init_child_panel()
137+
set(ui_density_text, 'String', 'Density')
138+
set(ui_density_text, 'Position', [.01 .65 .47 .08])
139+
set(ui_density_text, 'Fontweight', 'bold')
140+
141+
set(ui_density_edit, 'String', 1)
142+
set(ui_density_edit, 'Position', [.5 .67 .45 .08])
143+
set(ui_density_edit, 'Callback', {@cb_comparison_density})
144+
145+
set(ui_density_min_text, 'String', 'Min')
146+
set(ui_density_min_text, 'Position', [.01 .75 .47 .08])
147+
set(ui_density_min_text, 'Fontweight', 'bold')
148+
149+
set(ui_density_min_edit, 'String', 0)
150+
set(ui_density_min_edit, 'Position', [.5 .77 .45 .08])
151+
set(ui_density_min_edit, 'Callback', {@cb_comparison_min})
152+
153+
set(ui_density_max_text, 'String', 'Max')
154+
set(ui_density_max_text, 'Position', [.01 .55 .47 .08])
155+
set(ui_density_max_text, 'Fontweight', 'bold')
156+
157+
set(ui_density_max_edit, 'String', 100)
158+
set(ui_density_max_edit, 'Position', [.5 .57 .45 .08])
159+
set(ui_density_max_edit, 'Callback', {@cb_comparison_max})
160+
161+
set(ui_permutation_text, 'String', 'Perumtation Number')
162+
set(ui_permutation_text, 'Position', [.01 .85 .47 .08])
163+
set(ui_permutation_text, 'Fontweight', 'bold')
164+
165+
set(ui_permutation_edit, 'String', 1000)
166+
set(ui_permutation_edit, 'Position', [.5 .87 .45 .08])
167+
set(ui_permutation_edit, 'Callback', {@cb_comparison_permutation})
168+
169+
end
170+
function cb_comparison_density(~,~)
171+
setappdata(uiparent, 'density', ...
172+
str2double(get(ui_density_min_edit, 'String')) : ...
173+
str2double(get(ui_density_edit, 'String')) : ...
174+
str2double(get(ui_density_max_edit, 'String')))
175+
end
176+
function cb_comparison_min(src, ~)
177+
newdata = get(src, 'String');
178+
set(ui_density_min_edit, 'String', newdata);
179+
end
180+
function cb_comparison_max(src, ~)
181+
newdata = get(src, 'String');
182+
set(ui_density_max_edit, 'String', newdata);
183+
end
184+
function cb_comparison_permutation(~, ~)
185+
setappdata(uiparent, 'permutation', str2double(get(ui_permutation_edit, 'String')))
186+
end
187+
188+
handle.variables = {'density'};
189+
handle.step = ui_density_edit;
190+
handle.min = ui_density_min_edit;
191+
handle.max = ui_density_max_edit;
192+
handle.permutation = ui_permutation_edit;
193+
setappdata(uiparent, 'density', ...
194+
str2double(get(ui_density_min_edit, 'String')) : ...
195+
str2double(get(ui_density_edit, 'String')) : ...
196+
str2double(get(ui_density_max_edit, 'String')))
197+
setappdata(uiparent, 'permutation', str2double(get(ui_permutation_edit, 'String')))
198+
end
199+
end
113200
end

braph2/workflows/Connectivity/ComparisonCON_BUT.m

Lines changed: 93 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,22 @@
1818
% getDescription - returns the description of the comparison
1919
% getAnalysisClass - returns the class of the analysis
2020
%
21-
% See also Comparison, AnalysisCON_BUT, MeasurementCON_BUT, RandomComparisonCON_BUT.
21+
% ComparisonCON_BUT plot methods (Static):
22+
% getComparisonSettingsPanel - returns a UIPanel
23+
%
24+
% See also Comparison, AnalysisCON_BUT, MeasurementCON_BUT, RandomComparisonCON_BUT.
2225

2326
properties (Access = protected)
2427
threshold % threshold of the values
2528
end
2629
methods % Constructor
2730
function c = ComparisonCON_BUT(id, label, notes, atlas, measure_code, group_1, group_2, varargin)
28-
% ComparisonCON_BUT(ID, LABEL, NOTES, ATLAS, MEASURE_CODE, GROUP_1, GROUP_2, 'threshold', THRESHOLD)
31+
% ComparisonCON_BUT(ID, LABEL, NOTES, ATLAS, MEASURE_CODE, GROUP_1, GROUP_2, 'threshold', THRESHOLD)
2932
% creates a comparison with ID, LABEL, ATLAS and MEASURE_CODE
3033
% between the data from GROUP_1 and GROUP_2. The data will have
3134
% a fixed THRESHOLD.
3235
%
33-
% ComparisonCON_BUT(ID, LABEL, NOTES, ATLAS, MEASURE_CODE, GROUP_1, GROUP_2)
36+
% ComparisonCON_BUT(ID, LABEL, NOTES, ATLAS, MEASURE_CODE, GROUP_1, GROUP_2)
3437
% creates a comparison with ID, LABEL, ATLAS and MEASURE_CODE
3538
% between the data from GROUP_1 and GROUP_2. The data will have
3639
% a fixed default THRESHOLD.
@@ -69,7 +72,7 @@ function setThreshold(c, threshold)
6972
function class = getClass()
7073
% GETCLASS returns the class of connectivity comparison
7174
%
72-
% ANALYSIS_CLASS = GETCLASS(ANALYSIS) returns the class of
75+
% ANALYSIS_CLASS = GETCLASS(ANALYSIS) returns the class of
7376
% comparison. In this case 'ComparisonCON_BUT'.
7477
%
7578
% See also getList, getName, getDescription.
@@ -86,7 +89,7 @@ function setThreshold(c, threshold)
8689
name = 'Comparison Connectivity BUT';
8790
end
8891
function description = getDescription()
89-
% GETDESCRIPTION returns the description of connectivity comparison
92+
% GETDESCRIPTION returns the description of connectivity comparison
9093
%
9194
% DESCRIPTION = GETDESCRIPTION() returns the description
9295
% of ComparisonCON_BUT.
@@ -100,7 +103,7 @@ function setThreshold(c, threshold)
100103
];
101104
end
102105
function analysis_class = getAnalysisClass()
103-
% GETANALYSISCLASS returns the class of the analsysis
106+
% GETANALYSISCLASS returns the class of the analsysis
104107
%
105108
% ANALYSIS_CLASS = GETANALYSISCLASS() returns the class of the
106109
% analysis the comparison is part of, 'AnalysisCON_BUT'.
@@ -110,4 +113,88 @@ function setThreshold(c, threshold)
110113
analysis_class = 'AnalysisCON_BUT';
111114
end
112115
end
116+
methods (Static) % Plot MeasurementGUI Child Panel
117+
function handle = getComparisonSettingsPanel(analysis, uiparent) %#ok<INUSL>
118+
% GETCHILDPANEL returns a dynamic UIPanel
119+
%
120+
% HANDLE = GETCHILDPANEL(ANALYSIS, UIPARENT) returns a dynamic
121+
% UIPanel. Modificable settings are: Verbose, Interruptible,
122+
% Permutation and Threshold.
123+
%
124+
% See also ComparisonST_BUT.
125+
126+
set(uiparent, 'Visible', 'on')
127+
ui_threshold_text = uicontrol('Parent', uiparent, 'Units', 'normalized', 'Style', 'text');
128+
ui_threshold_edit = uicontrol('Parent', uiparent, 'Units', 'normalized', 'Style', 'edit');
129+
ui_threshold_min_text = uicontrol('Parent', uiparent, 'Units', 'normalized', 'Style', 'text');
130+
ui_threshold_min_edit = uicontrol('Parent', uiparent, 'Units', 'normalized', 'Style', 'edit');
131+
ui_threshold_max_text = uicontrol('Parent', uiparent, 'Units', 'normalized', 'Style', 'text');
132+
ui_threshold_max_edit = uicontrol('Parent', uiparent, 'Units', 'normalized', 'Style', 'edit');
133+
ui_permutation_text = uicontrol('Parent', uiparent, 'Units', 'normalized', 'Style', 'text');
134+
ui_permutation_edit = uicontrol('Parent', uiparent, 'Units', 'normalized', 'Style', 'edit');
135+
init_child_panel()
136+
function init_child_panel()
137+
set(ui_threshold_text, 'String', 'Threshold')
138+
set(ui_threshold_text, 'Position', [.01 .65 .47 .08])
139+
set(ui_threshold_text, 'Fontweight', 'bold')
140+
141+
set(ui_threshold_edit, 'String', 0.1)
142+
set(ui_threshold_edit, 'Position', [.5 .67 .45 .08])
143+
set(ui_threshold_edit, 'Callback', {@cb_comparison_threshold})
144+
145+
set(ui_threshold_min_text, 'String', 'Min')
146+
set(ui_threshold_min_text, 'Position', [.01 .75 .47 .08])
147+
set(ui_threshold_min_text, 'Fontweight', 'bold')
148+
149+
set(ui_threshold_min_edit, 'String', -1)
150+
set(ui_threshold_min_edit, 'Position', [.5 .77 .45 .08])
151+
set(ui_threshold_min_edit, 'Callback', {@cb_comparison_min})
152+
153+
set(ui_threshold_max_text, 'String', 'Max')
154+
set(ui_threshold_max_text, 'Position', [.01 .55 .47 .08])
155+
set(ui_threshold_max_text, 'Fontweight', 'bold')
156+
157+
set(ui_threshold_max_edit, 'String', 1)
158+
set(ui_threshold_max_edit, 'Position', [.5 .57 .45 .08])
159+
set(ui_threshold_max_edit, 'Callback', {@cb_comparison_max})
160+
161+
set(ui_permutation_text, 'String', 'Perumtation Number')
162+
set(ui_permutation_text, 'Position', [.01 .85 .47 .08])
163+
set(ui_permutation_text, 'Fontweight', 'bold')
164+
165+
set(ui_permutation_edit, 'String', 1000)
166+
set(ui_permutation_edit, 'Position', [.5 .87 .45 .08])
167+
set(ui_permutation_edit, 'Callback', {@cb_comparison_permutation})
168+
169+
end
170+
function cb_comparison_threshold(~,~)
171+
setappdata(uiparent, 'threshold', ...
172+
str2double(get(ui_threshold_min_edit, 'String')) : ...
173+
str2double(get(ui_threshold_edit, 'String')) : ...
174+
str2double(get(ui_threshold_max_edit, 'String')))
175+
end
176+
function cb_comparison_min(src, ~)
177+
newdata = get(src, 'String');
178+
set(ui_threshold_min_edit, 'String', newdata);
179+
end
180+
function cb_comparison_max(src, ~)
181+
newdata = get(src, 'String');
182+
set(ui_threshold_max_edit, 'String', newdata);
183+
end
184+
function cb_comparison_permutation(~, ~)
185+
setappdata(uiparent, 'permutation', str2double(get(ui_permutation_edit, 'String')))
186+
end
187+
188+
handle.variables = {'threshold'};
189+
handle.step = ui_threshold_edit;
190+
handle.min = ui_threshold_min_edit;
191+
handle.max = ui_threshold_max_edit;
192+
handle.permutation = ui_permutation_edit;
193+
setappdata(uiparent, 'threshold', ...
194+
str2double(get(ui_threshold_min_edit, 'String')) : ...
195+
str2double(get(ui_threshold_edit, 'String')) : ...
196+
str2double(get(ui_threshold_max_edit, 'String')))
197+
setappdata(uiparent, 'permutation', str2double(get(ui_permutation_edit, 'String')))
198+
end
199+
end
113200
end

braph2/workflows/Connectivity/ComparisonCON_WU.m

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
% getAvailbleSettings - returns the available settings
3737
% getComparison - returns a new comparison
3838
%
39+
% ComparisonCON_WU plot methods (Static):
40+
% getComparisonSettingsPanel - returns a UIPanel
41+
%
3942
% See also Comparison, AnalysisCON_WU, MeasurementCON_WU, RandomComparisonCON_WU.
4043

4144
properties
@@ -616,4 +619,38 @@ function initialize_data(c, varargin)
616619
sub = eval([comparisonClass '(id, label, notes, atlas, measure_code, group_1, group_2, varargin{:})']);
617620
end
618621
end
622+
methods (Static) % Plot ComparisonGUI Child Panel
623+
function handle = getComparisonSettingsPanel(analysis, uiparent) %#ok<INUSL>
624+
% GETCHILDPANEL returns a dynamic UIPanel
625+
%
626+
% HANDLE = GETCHILDPANEL(ANALYSIS, UIPARENT) returns a dynamic
627+
% UIPanel. Modificable settings are: Verbose, Interruptible and
628+
% Permutation.
629+
%
630+
% See also ComparisonST_WU.
631+
632+
set(uiparent, 'Visible', 'on')
633+
634+
ui_permutation_text = uicontrol('Parent', uiparent, 'Units', 'normalized', 'Style', 'text');
635+
ui_permutation_edit = uicontrol('Parent', uiparent, 'Units', 'normalized', 'Style', 'edit');
636+
init_child_panel()
637+
function init_child_panel()
638+
639+
set(ui_permutation_text, 'String', 'Permutation Number')
640+
set(ui_permutation_text, 'Position', [.01 .8 .47 .14])
641+
set(ui_permutation_text, 'Fontweight', 'bold')
642+
643+
set(ui_permutation_edit, 'String', 1000)
644+
set(ui_permutation_edit, 'Position', [.5 .87 .45 .08])
645+
set(ui_permutation_edit, 'Callback', {@cb_comparison_permutation})
646+
end
647+
648+
function cb_comparison_permutation(~, ~)
649+
setappdata(uiparent, 'permutation', str2double(get(ui_permutation_edit, 'String')))
650+
end
651+
handle.variables = [];
652+
handle.permutation = ui_permutation_edit;
653+
setappdata(uiparent, 'permutation', str2double(get(ui_permutation_edit, 'String')))
654+
end
655+
end
619656
end

0 commit comments

Comments
 (0)