From 7fa0bb583dab603410de1f646c3938a838167a09 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Wed, 6 Dec 2023 16:30:25 +0100 Subject: [PATCH 1/4] update bids matlab --- lib/bids-matlab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 94aa5290f6226dff9b739522051ea1a5becc0bb0 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Wed, 6 Dec 2023 16:42:36 +0100 Subject: [PATCH 2/4] remove levels from trial type column --- src/saveEventsFile.m | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/saveEventsFile.m b/src/saveEventsFile.m index 3dc2b17..edfdc57 100644 --- a/src/saveEventsFile.m +++ b/src/saveEventsFile.m @@ -182,15 +182,11 @@ % 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', ... - 'Levels', struct()), ... - 'duration', struct( ... - 'Description', ... + 'trial_type', struct('Description', 'types of trial'), ... + 'duration', struct('Description', ... 'duration of the event or the block', ... 'Units', 's') ... ); From b2246fcbe55f4f6a02be378cd0033b5041006a8f Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Wed, 6 Dec 2023 17:03:41 +0100 Subject: [PATCH 3/4] add dummy term URL --- src/createDataDictionary.m | 3 +-- src/saveEventsFile.m | 3 ++- src/utils/initializeExtraColumns.m | 5 ++--- tests/testData/eventsDataDictionary.json | 8 ++++---- tests/testData/stimDataDictionary.json | 10 +++++----- tests/test_saveEventsFileInit.m | 6 +++--- 6 files changed, 17 insertions(+), 18 deletions(-) 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 edfdc57..01a8794 100644 --- a/src/saveEventsFile.m +++ b/src/saveEventsFile.m @@ -185,7 +185,8 @@ 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 of the event or the block', ... 'Units', 's') ... diff --git a/src/utils/initializeExtraColumns.m b/src/utils/initializeExtraColumns.m index 4bc3f33..497429d 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 = '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..6d24cf3 100644 --- a/tests/testData/eventsDataDictionary.json +++ b/tests/testData/eventsDataDictionary.json @@ -15,28 +15,28 @@ "LongName": "", "Description": "", "Levels": {}, - "TermURL": "", + "TermURL": "www.TODO.later", "Units": "" }, "LHL24_01": { "LongName": "", "Description": "", "Levels": {}, - "TermURL": "", + "TermURL": "www.TODO.later", "Units": "" }, "LHL24_02": { "LongName": "", "Description": "", "Levels": {}, - "TermURL": "", + "TermURL": "www.TODO.later", "Units": "" }, "LHL24_03": { "LongName": "", "Description": "", "Levels": {}, - "TermURL": "", + "TermURL": "www.TODO.later", "Units": "" } } diff --git a/tests/testData/stimDataDictionary.json b/tests/testData/stimDataDictionary.json index 3438c43..9dfd052 100644 --- a/tests/testData/stimDataDictionary.json +++ b/tests/testData/stimDataDictionary.json @@ -12,35 +12,35 @@ "Description": "", "Levels": {}, "LongName": "", - "TermURL": "", + "TermURL": "www.TODO.later", "Units": "" }, "LHL24_01": { "Description": "", "Levels": {}, "LongName": "", - "TermURL": "", + "TermURL": "www.TODO.later", "Units": "" }, "LHL24_02": { "Description": "", "Levels": {}, "LongName": "", - "TermURL": "", + "TermURL": "www.TODO.later", "Units": "" }, "LHL24_03": { "Description": "", "Levels": {}, "LongName": "", - "TermURL": "", + "TermURL": "www.TODO.later", "Units": "" }, "is_Fixation": { "Description": "", "Levels": {}, "LongName": "", - "TermURL": "", + "TermURL": "www.TODO.later", "Units": "" } } diff --git a/tests/test_saveEventsFileInit.m b/tests/test_saveEventsFileInit.m index 444ee63..fccc67a 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 = '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 = '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 = 'www.TODO.later'; expectedStrcut(1).extraColumns.LHL24.bids.Units = ''; %% test From 12ff9c5d19a4ddbf6548d0eefd443b2aa4a56d16 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Wed, 6 Dec 2023 17:49:54 +0100 Subject: [PATCH 4/4] try proper URI --- src/utils/initializeExtraColumns.m | 2 +- tests/testData/eventsDataDictionary.json | 8 ++++---- tests/testData/stimDataDictionary.json | 10 +++++----- tests/test_saveEventsFileInit.m | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/utils/initializeExtraColumns.m b/src/utils/initializeExtraColumns.m index 497429d..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 = 'www.TODO.later'; + fieldsToSet.bids.TermURL = 'https://www.TODO.later'; fieldsToSet.bids.Units = ''; % convert the cell of column name into a structure diff --git a/tests/testData/eventsDataDictionary.json b/tests/testData/eventsDataDictionary.json index 6d24cf3..c64ad6e 100644 --- a/tests/testData/eventsDataDictionary.json +++ b/tests/testData/eventsDataDictionary.json @@ -15,28 +15,28 @@ "LongName": "", "Description": "", "Levels": {}, - "TermURL": "www.TODO.later", + "TermURL": "https://www.TODO.later", "Units": "" }, "LHL24_01": { "LongName": "", "Description": "", "Levels": {}, - "TermURL": "www.TODO.later", + "TermURL": "https://www.TODO.later", "Units": "" }, "LHL24_02": { "LongName": "", "Description": "", "Levels": {}, - "TermURL": "www.TODO.later", + "TermURL": "https://www.TODO.later", "Units": "" }, "LHL24_03": { "LongName": "", "Description": "", "Levels": {}, - "TermURL": "www.TODO.later", + "TermURL": "https://www.TODO.later", "Units": "" } } diff --git a/tests/testData/stimDataDictionary.json b/tests/testData/stimDataDictionary.json index 9dfd052..fc3ab5f 100644 --- a/tests/testData/stimDataDictionary.json +++ b/tests/testData/stimDataDictionary.json @@ -12,35 +12,35 @@ "Description": "", "Levels": {}, "LongName": "", - "TermURL": "www.TODO.later", + "TermURL": "https://www.TODO.later", "Units": "" }, "LHL24_01": { "Description": "", "Levels": {}, "LongName": "", - "TermURL": "www.TODO.later", + "TermURL": "https://www.TODO.later", "Units": "" }, "LHL24_02": { "Description": "", "Levels": {}, "LongName": "", - "TermURL": "www.TODO.later", + "TermURL": "https://www.TODO.later", "Units": "" }, "LHL24_03": { "Description": "", "Levels": {}, "LongName": "", - "TermURL": "www.TODO.later", + "TermURL": "https://www.TODO.later", "Units": "" }, "is_Fixation": { "Description": "", "Levels": {}, "LongName": "", - "TermURL": "www.TODO.later", + "TermURL": "https://www.TODO.later", "Units": "" } } diff --git a/tests/test_saveEventsFileInit.m b/tests/test_saveEventsFileInit.m index fccc67a..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 = 'www.TODO.later'; + 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 = 'www.TODO.later'; + 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 = 'www.TODO.later'; + expectedStrcut(1).extraColumns.LHL24.bids.TermURL = 'https://www.TODO.later'; expectedStrcut(1).extraColumns.LHL24.bids.Units = ''; %% test