Skip to content

Commit ed17d06

Browse files
Merge pull request #684 from softmatterlab/683-eg-CON_Workflow
CON WORKFLOW + GUI
2 parents 2ad932c + 2fc9de2 commit ed17d06

194 files changed

Lines changed: 30803 additions & 1827 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

braph2/analysis/GUIAnalysis.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ function init_calc()
307307

308308
for j = 1:1:length(available_settings)
309309
as = available_settings{j};
310-
y_correction = 0.2;
310+
y_correction = 0.05;
311311
inner_panel_y = 1 - j * inner_panel_height + y_correction;
312312

313313
texts(j, 1) = uicontrol('Parent', ui_calc_settings_panel, 'Style', 'text', ...

braph2/analysis/GUIAnalysisSettings.m

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ function init_graph_settings()
277277

278278
for j = 1:1:length(available_settings)
279279
as = available_settings{j};
280-
y_correction = 0.2;
280+
y_correction = 0.05;
281281
inner_panel_y = 1 - j * inner_panel_height + y_correction;
282282

283283
texts(j, 1) = uicontrol('Parent', ui_graph_setttings_inner_panel, 'Style', 'text', ...
@@ -294,11 +294,13 @@ function init_graph_settings()
294294
set(fields(j, 1), 'Callback', {@cb_analysis_settings_popup})
295295
elseif isequal(as{1, 2}, 2) % numerical
296296
set(fields(j, 1), 'Style', 'edit');
297+
set(fields(j, 1), 'Position', [0.58 inner_panel_y+0.03 0.40 0.04]);
297298
set(fields(j, 1), 'String', as{1, 3}) % put default
298299
set(fields(j, 1), 'Callback', {@cb_analysis_settings_popup})
299300
else % logical
300301
set(fields(j, 1), 'Style', 'popup');
301302
set(fields(j, 1), 'String', {'true', 'false'})
303+
set(fields(j, 1), 'FontWeight', 'bold')
302304
set(fields(j, 1), 'Callback', {@cb_analysis_settings_popup})
303305
end
304306
end
@@ -339,7 +341,11 @@ function cb_analysis_settings_popup(~, ~)
339341
if rem(j, 2) == 0
340342
correlation_rules_array{k} = ['Analysis' dc{1} '.' childs(j).String];
341343
else
342-
correlation_rules_array{k} = childs(j).String{childs(j).Value};
344+
if childs(j).Value >= 1
345+
correlation_rules_array{k} = childs(j).String{childs(j).Value};
346+
else
347+
correlation_rules_array{k} = childs(j).String;
348+
end
343349
end
344350
end
345351
analysis = ga.getClass();
@@ -608,7 +614,11 @@ function update_matrix()
608614
if rem(j, 2) == 0
609615
correlation_rules_array{k} = ['Analysis' dc{1} '.' childs(j).String];
610616
else
611-
correlation_rules_array{k} = childs(j).String{childs(j).Value};
617+
if childs(j).Value >= 1
618+
correlation_rules_array{k} = childs(j).String{childs(j).Value};
619+
else
620+
correlation_rules_array{k} = childs(j).String;
621+
end
612622
end
613623
end
614624

braph2/analysis/GUIMeasurement.m

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
function GUIMeasurement(measurement_class, analysis, measure_rules)
32
% GUIMEASUREMENT creates a UI figure to specify Measurement settings
43
%
@@ -328,7 +327,14 @@ function calculate(analysis, mlist, g)
328327
m = analysis.getMeasurement(mlist{mi}, gr, rule, value_step, measure_rules{:}); %#ok<NASGU>
329328
end
330329
else
331-
m = analysis.getMeasurement(mlist{mi}, gr, rule, value, measure_rules{:}); %#ok<NASGU>
330+
if length(value) > 1
331+
for vals = 1:1:length(value)
332+
value_step = value(vals);
333+
m = analysis.getMeasurement(mlist{mi}, group, rule, value_step, measure_rules{:}); %#ok<NASGU>
334+
end
335+
else
336+
m = analysis.getMeasurement(mlist{mi}, group, rule, value, measure_rules{:}); %#ok<NASGU>
337+
end
332338
end
333339
msg = ['time = ' int2str(toc(start)) '.' int2str(mod(toc(start)*10, 10)) 's - group = ' gr.tostring() ' - ' mlist{mi}];
334340

braph2/analysis/test_GUIAnalysis.m

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
% test GUIAnalysis
22

3-
%% Init
3+
%% Init ST
44

55
analysis_file = [fileparts(which('example_workflow_ST_WU.m')) filesep() 'example data ST (MRI)' filesep() 'analysis_example_ST_BUT.analysis'];
66
temp = load(analysis_file, '-mat', 'ga', 'BUILD');
@@ -9,4 +9,26 @@
99
GUIAnalysis(ga)
1010

1111
set(gcf, 'CloseRequestFcn', 'closereq')
12-
close(gcf)
12+
close(gcf)
13+
14+
%% Init FNC
15+
16+
analysis_file = [fileparts(which('example_workflow_FNC_WU.m')) filesep() 'example data FNC (fMRI)' filesep() 'analysis_example_FNC_BUT.analysis'];
17+
temp = load(analysis_file, '-mat', 'ga', 'BUILD');
18+
ga = temp.ga;
19+
20+
GUIAnalysis(ga)
21+
22+
set(gcf, 'CloseRequestFcn', 'closereq')
23+
close(gcf)
24+
25+
%% INIT CON
26+
27+
analysis_file = [fileparts(which('example_workflow_CON_WU.m')) filesep() 'example data CON (DTI)' filesep() 'analysis_example_CON_BUT.analysis'];
28+
temp = load(analysis_file, '-mat', 'ga', 'BUILD');
29+
ga = temp.ga;
30+
31+
GUIAnalysis(ga)
32+
33+
set(gcf, 'CloseRequestFcn', 'closereq')
34+
close(gcf)

braph2/analysis/test_GUIAnalysisSettings.m

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,32 @@
66
set(gcf, 'CloseRequestFcn', 'closereq')
77
close(gcf)
88

9-
%% Pass a cohort
9+
%% Pass a ST cohort
1010
cohort_file = [fileparts(which('example_workflow_ST_WU.m')) filesep() 'example data ST (MRI)' filesep() 'cohort_example.cohort'];
1111
temp = load(cohort_file, '-mat', 'cohort', 'selected_group', 'selected_subjects', 'BUILD');
1212
cohort = temp.cohort;
1313

1414
GUIAnalysisSettings(cohort, 'AnalysisST_BUD')
1515

1616
set(gcf, 'CloseRequestFcn', 'closereq')
17-
close(gcf)
17+
close(gcf)
18+
19+
%% Pass a FNC cohort
20+
cohort_file = [fileparts(which('example_workflow_FNC_WU.m')) filesep() 'example data FNC (fMRI)' filesep() 'cohort_example.cohort'];
21+
temp = load(cohort_file, '-mat', 'cohort', 'selected_group', 'selected_subjects', 'BUILD');
22+
cohort = temp.cohort;
23+
24+
GUIAnalysisSettings(cohort, 'AnalysisFNC_BUD')
25+
26+
set(gcf, 'CloseRequestFcn', 'closereq')
27+
close(gcf)
28+
29+
%% Pass a CON cohort
30+
cohort_file = [fileparts(which('example_workflow_CON_WU.m')) filesep() 'example data CON (DTI)' filesep() 'cohort_example.cohort'];
31+
temp = load(cohort_file, '-mat', 'cohort', 'selected_group', 'selected_subjects', 'BUILD');
32+
cohort = temp.cohort;
33+
34+
GUIAnalysisSettings(cohort, 'AnalysisCON_BUT')
35+
36+
set(gcf, 'CloseRequestFcn', 'closereq')
37+
close(gcf)

braph2/atlas/test_PlotBrainGraph.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
close(gcf)
1717
close(gcf)
1818

19-
% %% Edges arrows
20-
%
19+
%% Edges arrows
20+
2121
% bg = PlotBrainGraph(atlas);
2222
% figure
2323
% bg.hold_on()

braph2/cohort/GUICohort.m

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,11 +1318,14 @@ function init_menu()
13181318
set(ui_menu_subjects_move2bottom, 'Callback', {@cb_groups_move2bottom_sub})
13191319

13201320
analysis_list = Analysis.getList();
1321+
analysis_list = reshape(analysis_list', [1 numel(analysis_list)]);
13211322
for i = 1:1:length(analysis_list)
13221323
analysis = analysis_list{i};
1323-
cohort_analysis_menu = uimenu(ui_menu_analysis);
1324-
set(cohort_analysis_menu, 'Label', [Analysis.getName(analysis) ' ...'])
1325-
set(cohort_analysis_menu, 'Callback', {@cb_menu_analysis})
1324+
if isequal(cohort.getSubjectClass(), Analysis.getSubjectClass(analysis))
1325+
cohort_analysis_menu = uimenu(ui_menu_analysis);
1326+
set(cohort_analysis_menu, 'Label', [Analysis.getName(analysis) ' ...'])
1327+
set(cohort_analysis_menu, 'Callback', {@cb_menu_analysis})
1328+
end
13261329
end
13271330

13281331
function cb_menu_analysis(src, ~)

0 commit comments

Comments
 (0)