sccn / EEG-BIDS

21 stars 17 forks source link

Missing `duration` condition in line 179 is not reached. #210

Open neuromechanist opened 5 months ago

neuromechanist commented 5 months ago

When all events in a task do not have a duration ("instantaneous" events or onsets/offsets), it might be best to remove the EEG.event.duration field and then have n/a for all rows in BIDS _events.tsv.

The following line should be modified to implement this feature: https://github.com/sccn/bids-matlab-tools/blob/b53c87f624373f1c0bc02b85278a4c888e38a7be/bids_writeeventfile.m#L112

The second condition should be removed. The line should looklike:

        if ~any(strcmp(bids_fields,'duration')), opt.eInfo(end+1,:) = { 'duration' 'duration' }; end

Then the code would put n/a for duration:

https://github.com/sccn/bids-matlab-tools/blob/b53c87f624373f1c0bc02b85278a4c888e38a7be/bids_writeeventfile.m#L179-L183

I tested this feature in RC3 of the HBN dataset: /home/sshirazi/yahya/cmi_bids_R3_RC3