Skip to content

Commit 182d6df

Browse files
committed
adapt test for bids validation
1 parent 6482f92 commit 182d6df

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

manualTests/test_makeRawDataset.m

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,14 @@ function test_makeRawDataset()
7171
saveEventsFile('close', cfg, logFile);
7272

7373
% add dummy stim data
74-
stimLogFile = saveEventsFile('open_stim', cfg, logFile);
74+
stimLogFile.extraColumns.Speed.length = 1;
75+
stimLogFile.extraColumns.LHL24.length = 3;
76+
stimLogFile.extraColumns.is_Fixation.length = 1;
77+
78+
stimLogFile.SamplingFrequency = 100;
79+
stimLogFile.StartTime = 0;
80+
81+
stimLogFile = saveEventsFile('open_stim', cfg, stimLogFile);
7582
for i = 1:100
7683
stimLogFile(i, 1).onset = cfg.mri.repetitionTime * i;
7784
stimLogFile(i, 1).trial_type = 'test';

src/createDataDictionary.m

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,25 @@ function createDataDictionary(cfg, logFile)
3232
'Description', 'types of trial', ...
3333
'Levels', ''), ...
3434
'duration', struct( ...
35-
'Description', 'duration of the event or the block', ...
35+
'Description', 'duration of the event', ...
3636
'Units', 's') ...
3737
);
3838

3939
if contains(fullFilename, '_stim')
40+
41+
samplingFrequency = nan;
42+
startTime = nan;
43+
44+
if isfield(logFile, 'SamplingFrequency')
45+
samplingFrequency = logFile(1).SamplingFrequency;
46+
end
47+
if isfield(logFile, 'StartTime')
48+
startTime = logFile(1).StartTime;
49+
end
4050

4151
jsonContent = struct( ...
42-
'SamplingFrequency', nan, ...
43-
'StartTime', nan, ...
52+
'SamplingFrequency', samplingFrequency, ...
53+
'StartTime', startTime, ...
4454
'Columns', []);
4555

4656
end

0 commit comments

Comments
 (0)