Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/createDataDictionary.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ function createDataDictionary(cfg, logFile)
startTime = logFile(1).StartTime;
end

jsonContent = struct( ...
'SamplingFrequency', samplingFrequency, ...
jsonContent = struct('SamplingFrequency', samplingFrequency, ...
'StartTime', startTime, ...
'Columns', []);
end
Expand Down
9 changes: 3 additions & 6 deletions src/saveEventsFile.m
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,12 @@
% before calling openFile.

% initialize holy trinity (onset, trial_type, duration) columns
logFile(1).columns = struct('onset', struct( ...
'Description', ...
logFile(1).columns = struct('onset', struct('Description', ...
'time elapsed since experiment start', ...
'Units', 's'), ...
'trial_type', struct( ...
'Description', 'types of trial', ...
'trial_type', struct('Description', 'types of trial', ...
'Levels', struct()), ...
'duration', struct( ...
'Description', ...
'duration', struct('Description', ...
'duration of the event or the block', ...
'Units', 's') ...
);
Expand Down
5 changes: 2 additions & 3 deletions src/utils/initializeExtraColumns.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
fieldsToSet.bids.LongName = '';
fieldsToSet.bids.Description = '';
fieldsToSet.bids.Levels = struct();
fieldsToSet.bids.TermURL = '';
fieldsToSet.bids.TermURL = 'https://www.TODO.later';
fieldsToSet.bids.Units = '';

% convert the cell of column name into a structure
Expand All @@ -35,8 +35,7 @@

for iExtraColumn = 1:nbExtraColumns
extraColumnName = logFile(1).extraColumns{iExtraColumn};
tmp.(extraColumnName) = struct( ...
'length', 1);
tmp.(extraColumnName) = struct('length', 1);
tmp.(extraColumnName) = setDefaultFields(tmp.(extraColumnName), fieldsToSet);
end

Expand Down
8 changes: 4 additions & 4 deletions tests/testData/eventsDataDictionary.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,28 @@
"LongName": "",
"Description": "",
"Levels": {},
"TermURL": "",
"TermURL": "https://www.TODO.later",
"Units": ""
},
"LHL24_01": {
"LongName": "",
"Description": "",
"Levels": {},
"TermURL": "",
"TermURL": "https://www.TODO.later",
"Units": ""
},
"LHL24_02": {
"LongName": "",
"Description": "",
"Levels": {},
"TermURL": "",
"TermURL": "https://www.TODO.later",
"Units": ""
},
"LHL24_03": {
"LongName": "",
"Description": "",
"Levels": {},
"TermURL": "",
"TermURL": "https://www.TODO.later",
"Units": ""
}
}
10 changes: 5 additions & 5 deletions tests/testData/stimDataDictionary.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,35 @@
"Description": "",
"Levels": {},
"LongName": "",
"TermURL": "",
"TermURL": "https://www.TODO.later",
"Units": ""
},
"LHL24_01": {
"Description": "",
"Levels": {},
"LongName": "",
"TermURL": "",
"TermURL": "https://www.TODO.later",
"Units": ""
},
"LHL24_02": {
"Description": "",
"Levels": {},
"LongName": "",
"TermURL": "",
"TermURL": "https://www.TODO.later",
"Units": ""
},
"LHL24_03": {
"Description": "",
"Levels": {},
"LongName": "",
"TermURL": "",
"TermURL": "https://www.TODO.later",
"Units": ""
},
"is_Fixation": {
"Description": "",
"Levels": {},
"LongName": "",
"TermURL": "",
"TermURL": "https://www.TODO.later",
"Units": ""
}
}
6 changes: 3 additions & 3 deletions tests/test_saveEventsFileInit.m
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function test_saveEventsFileInitExtraColumns()
expectedStrcut(1).extraColumns.Speed.bids.LongName = '';
expectedStrcut(1).extraColumns.Speed.bids.Description = '';
expectedStrcut(1).extraColumns.Speed.bids.Levels = struct();
expectedStrcut(1).extraColumns.Speed.bids.TermURL = '';
expectedStrcut(1).extraColumns.Speed.bids.TermURL = 'https://www.TODO.later';
expectedStrcut(1).extraColumns.Speed.bids.Units = '';

%% test
Expand All @@ -83,13 +83,13 @@ function test_saveEventsFileInitExtraColumnsArray()
expectedStrcut(1).extraColumns.Speed.bids.LongName = '';
expectedStrcut(1).extraColumns.Speed.bids.Description = '';
expectedStrcut(1).extraColumns.Speed.bids.Levels = struct();
expectedStrcut(1).extraColumns.Speed.bids.TermURL = '';
expectedStrcut(1).extraColumns.Speed.bids.TermURL = 'https://www.TODO.later';
expectedStrcut(1).extraColumns.Speed.bids.Units = '';
expectedStrcut(1).extraColumns.LHL24.length = 3;
expectedStrcut(1).extraColumns.LHL24.bids.LongName = '';
expectedStrcut(1).extraColumns.LHL24.bids.Description = '';
expectedStrcut(1).extraColumns.LHL24.bids.Levels = struct();
expectedStrcut(1).extraColumns.LHL24.bids.TermURL = '';
expectedStrcut(1).extraColumns.LHL24.bids.TermURL = 'https://www.TODO.later';
expectedStrcut(1).extraColumns.LHL24.bids.Units = '';

%% test
Expand Down