sccn / EEG-BIDS

21 stars 17 forks source link

bug v6.0: a task which contains "task" in it's name results in error #107

Closed behinger closed 4 months ago

behinger commented 2 years ago

Hi! Disclaimer: Maybe there is some restrictions on words in BIDS that I was missing.

I have a bids file with ...task-dualtask... which results in an error in

L306 tStart = strfind(tmpFileName,'task');

The reason being, that strfind returns two elements. I dont even think selecting the first is correct, I think ...desc-MyTaskDesc_task-dualtask is valid BIDS too

I fixed it with:

tStart = strfind(tmpFileName,'_task-');
                        % find the next underscore after the "task" element
                        tEnd=underScores(find(underScores==tStart)+1);
                    task = tmpFileName(tStart+1:tEnd);

Where I was not sure, whether task should be task-taskDescription or only taskDescription

Should I do a pull request?

bug occured when updating from v5.X (forgot which) to v6.0

dungscout96 commented 4 months ago

Apology for the late response. We have now looked up task name following the _ character, which should resolve this issue. https://github.com/sccn/bids-matlab-tools/blob/4e4875978a4767791f45e9f7abc7336603213cf5/pop_importbids.m#L483 Let us know if it still causes error