7
7
end
8
8
9
9
function test_bids_query_basic()
10
- % Test BIDS queries on ds007
10
+ % Test BIDS queries
11
11
% This dataset comes from https://github.com/bids-standard/bids-examples
12
12
% and is downloaded automatically by the continuous integration framework
13
13
% and is required for the tests to be run.
@@ -30,8 +30,6 @@ function test_bids_query_basic()
30
30
subjs = arrayfun(@(x ) sprintf(' %02d ' , x ), 1 : 20 , ' UniformOutput' , false );
31
31
assert(isequal(bids .query(BIDS , ' subjects' ), subjs ));
32
32
33
- assert(isempty(bids .query(BIDS , ' sessions' )));
34
-
35
33
assert(isequal(bids .query(BIDS , ' runs' ), {' 01' , ' 02' }));
36
34
37
35
tasks = { ...
@@ -46,10 +44,6 @@ function test_bids_query_basic()
46
44
data = bids .query(BIDS , ' data' , ' sub' , ' 01' , ' task' , ' stopsignalwithpseudowordnaming' );
47
45
assertEqual(size(data , 1 ), 4 );
48
46
49
- mods = {' anat' , ' func' };
50
- assert(isequal(bids .query(BIDS , ' modalities' ), mods ));
51
- assert(isequal(bids .query(BIDS , ' modalities' , ' sub' , ' 01' ), mods ));
52
-
53
47
assert(isempty(bids .query(BIDS , ' runs' , ' type' , ' T1w' )));
54
48
55
49
runs = {' 01' , ' 02' };
@@ -79,31 +73,32 @@ function test_bids_query_basic()
79
73
end
80
74
81
75
function test_bids_query_sessions()
82
- %
83
- % parse a folder with sessions
84
- %
85
76
86
77
pth_bids_example = get_test_data_dir();
87
78
88
79
BIDS = bids .layout(fullfile(pth_bids_example , ' synthetic' ));
89
-
90
- % test
91
80
sessions = {' 01' , ' 02' };
92
81
assert(isequal(bids .query(BIDS , ' sessions' ), sessions ));
93
82
assert(isequal(bids .query(BIDS , ' sessions' , ' sub' , ' 02' ), sessions ));
94
83
84
+ BIDS = bids .layout(fullfile(pth_bids_example , ' ds007' ));
85
+
86
+ assert(isempty(bids .query(BIDS , ' sessions' )));
87
+
95
88
end
96
89
97
90
function test_bids_query_modalities()
98
- %
99
- % parse a folder with different modalities per session
100
- %
101
91
102
92
pth_bids_example = get_test_data_dir();
103
93
94
+ BIDS = bids .layout(fullfile(pth_bids_example , ' ds007' ));
95
+
96
+ mods = {' anat' , ' func' };
97
+ assert(isequal(bids .query(BIDS , ' modalities' ), mods ));
98
+ assert(isequal(bids .query(BIDS , ' modalities' , ' sub' , ' 01' ), mods ));
99
+
104
100
BIDS = bids .layout(fullfile(pth_bids_example , ' 7t_trt' ));
105
101
106
- % test
107
102
mods = {' anat' , ' fmap' , ' func' };
108
103
109
104
assert(isequal(bids .query(BIDS , ' modalities' ), mods ));
0 commit comments