Skip to content

Commit bbf21e7

Browse files
committed
make Levels key in data dictionary an object
1 parent eaff916 commit bbf21e7

File tree

5 files changed

+15
-12
lines changed

5 files changed

+15
-12
lines changed

src/saveEventsFile.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@
189189
'Units', 's'), ...
190190
'trial_type', struct( ...
191191
'Description', 'types of trial', ...
192-
'Levels', ''), ...
192+
'Levels', struct()), ...
193193
'duration', struct( ...
194194
'Description', ...
195195
'duration of the event or the block', ...

src/utils/initializeExtraColumns.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
fieldsToSet.length = 1;
2424
fieldsToSet.bids.LongName = '';
2525
fieldsToSet.bids.Description = '';
26-
fieldsToSet.bids.Levels = '';
26+
fieldsToSet.bids.Levels = struct();
2727
fieldsToSet.bids.TermURL = '';
2828
fieldsToSet.bids.Units = '';
2929

tests/testData/eventsDataDictionary.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
},
66
"trial_type": {
77
"Description": "types of trial",
8-
"Levels": ""
8+
"Levels": {}
99
},
1010
"duration": {
1111
"Description": "duration of the event or the block",
@@ -14,28 +14,28 @@
1414
"Speed": {
1515
"LongName": "",
1616
"Description": "",
17-
"Levels": "",
17+
"Levels": {},
1818
"TermURL": "",
1919
"Units": ""
2020
},
2121
"LHL24_01": {
2222
"LongName": "",
2323
"Description": "",
24-
"Levels": "",
24+
"Levels": {},
2525
"TermURL": "",
2626
"Units": ""
2727
},
2828
"LHL24_02": {
2929
"LongName": "",
3030
"Description": "",
31-
"Levels": "",
31+
"Levels": {},
3232
"TermURL": "",
3333
"Units": ""
3434
},
3535
"LHL24_03": {
3636
"LongName": "",
3737
"Description": "",
38-
"Levels": "",
38+
"Levels": {},
3939
"TermURL": "",
4040
"Units": ""
4141
}

tests/testData/stimDataDictionary.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,35 +10,35 @@
1010
],
1111
"Speed": {
1212
"Description": "",
13-
"Levels": "",
13+
"Levels": {},
1414
"LongName": "",
1515
"TermURL": "",
1616
"Units": ""
1717
},
1818
"LHL24_01": {
1919
"Description": "",
20-
"Levels": "",
20+
"Levels": {},
2121
"LongName": "",
2222
"TermURL": "",
2323
"Units": ""
2424
},
2525
"LHL24_02": {
2626
"Description": "",
27-
"Levels": "",
27+
"Levels": {},
2828
"LongName": "",
2929
"TermURL": "",
3030
"Units": ""
3131
},
3232
"LHL24_03": {
3333
"Description": "",
34-
"Levels": "",
34+
"Levels": {},
3535
"LongName": "",
3636
"TermURL": "",
3737
"Units": ""
3838
},
3939
"is_Fixation": {
4040
"Description": "",
41-
"Levels": "",
41+
"Levels": {},
4242
"LongName": "",
4343
"TermURL": "",
4444
"Units": ""

tests/test_createDataDictionary.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ function test_createDataDictionaryStim()
8181

8282
outputDir = fullfile(fileparts(mfilename('fullpath')), 'output');
8383

84+
delete(fullfile(outputDir, 'source', 'sub-001', 'ses-001', 'func', '*.json'));
85+
delete(fullfile(outputDir, 'source', 'sub-001', 'ses-001', 'func', '*.tsv'));
86+
8487
%% set up
8588

8689
cfg.verbose = false;

0 commit comments

Comments
 (0)