-
Notifications
You must be signed in to change notification settings - Fork 27
/
limo_get_anova_files.m
63 lines (56 loc) · 1.84 KB
/
limo_get_anova_files.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
function [Names,Paths,Files,txtFile] = limo_get_anova_files(varargin)
% routine to get multifiles from different directories
%
% FORMAT [Names,Paths,Files] = limo_get_anova_files(gp,filter,title)
% OUTPUT Names , Paths, Full File names are returned as cells
%
% Arnaud Delorme
% ------------------------------
% Copyright (C) LIMO Team 2023
Names = {};
Paths = {};
Files = {};
txtFile = '';
limo_settings_script;
if ~isempty(limo_settings.workdir)
cd(limo_settings.workdir);
end
dirContent = dir('AN(C)OVA*');
if isempty(dirContent)
txt = 'For 2nd-level contrast, you need to run an ANOVA first. What do you want to do instead?';
options = { 'Cancel ', 'Run 1st-level contrast', 'Pick ANOVA folder' };
res = limo_questdlg(txt, '2nd-level contrast', options{:}, options{end});
if contains(res, options{1}) % cancel
return
elseif contains(res, options{2}) % first level
[Names,Paths,Files,txtFile] = limo_get_result_files(varargin);
return;
else
path = uigetdir('*.*','Pick the ANOVA folder');
if isequal(path, 0)
return;
end
end
end
if length(dirContent) > 1
uiList = { {'style' 'text' 'string' 'Pick an ANOVA folder' } ...
{ 'style' 'popupmenu' 'string' {dirContent.name} 'value', length(dirContent) }};
res = inputgui('uilist', uiList, 'geometry', { [1] [1] }, 'cancel', 'Browse');
if ~isempty(res)
path = fullfile(dirContent(res{1}).folder, dirContent(res{1}).name);
else
path = uigetdir('*.*','Pick the ANOVA folder');
if isequal(path, 0)
return;
end
end
else
path = fullfile(dirContent.folder, dirContent.name);
end
res = dir(fullfile(path, 'LIMO.mat'));
if isempty(res)
limo_errordlg('LIMO.mat file not found in folder')
else
Names = { 'LIMO.mat' };
Paths = { path };
end