diff --git a/lib/bids-matlab b/lib/bids-matlab index 8bbabd6..d29da99 160000 --- a/lib/bids-matlab +++ b/lib/bids-matlab @@ -1 +1 @@ -Subproject commit 8bbabd640a1515213a4bb3136c1fb168a4147d9c +Subproject commit d29da99636b7628c7db1ae66a56de74c57fb0d04 diff --git a/src/createDataDictionary.m b/src/createDataDictionary.m index 9f83232..bc74ede 100644 --- a/src/createDataDictionary.m +++ b/src/createDataDictionary.m @@ -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 diff --git a/src/saveEventsFile.m b/src/saveEventsFile.m index 3dc2b17..01a8794 100644 --- a/src/saveEventsFile.m +++ b/src/saveEventsFile.m @@ -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') ... ); diff --git a/src/utils/initializeExtraColumns.m b/src/utils/initializeExtraColumns.m index 4bc3f33..7f35fde 100644 --- a/src/utils/initializeExtraColumns.m +++ b/src/utils/initializeExtraColumns.m @@ -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 @@ -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 diff --git a/tests/testData/eventsDataDictionary.json b/tests/testData/eventsDataDictionary.json index c26e9e4..c64ad6e 100644 --- a/tests/testData/eventsDataDictionary.json +++ b/tests/testData/eventsDataDictionary.json @@ -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": "" } } diff --git a/tests/testData/stimDataDictionary.json b/tests/testData/stimDataDictionary.json index 3438c43..fc3ab5f 100644 --- a/tests/testData/stimDataDictionary.json +++ b/tests/testData/stimDataDictionary.json @@ -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": "" } } diff --git a/tests/test_saveEventsFileInit.m b/tests/test_saveEventsFileInit.m index 444ee63..1e6d19d 100644 --- a/tests/test_saveEventsFileInit.m +++ b/tests/test_saveEventsFileInit.m @@ -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 @@ -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