Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export with sessions as string #127

Open
arnodelorme opened this issue May 25, 2022 · 7 comments
Open

Export with sessions as string #127

arnodelorme opened this issue May 25, 2022 · 7 comments

Comments

@arnodelorme
Copy link
Collaborator

Cheng shared some files (file-cheng on my computer)

However, there is no script, and the files actually have numerical sessions (in the file name itself).
Also, when creating a study with these files, the files do not have sessions or subjects defined.

Cheng, please share a script that takes these files as input to recreate the problem.

@arnodelorme
Copy link
Collaborator Author

arnodelorme commented May 25, 2022

I simply used the bids plugin in eeglab to export bids format. I did some scripts to identify the files from the file name etc:
The bids-eeglab plugin will then automatically identify the information. The GUI from eeglab will identify the run/session/group correctly when create a study, however, it creates errors when exporting them to bids format.

Modified script below

for iEEG = 1:length(ALLEEG)
    EEG = ALLEEG(iEEG);
    EEG.subject = extractBefore(EEG.setname,'_'); % find out the subject ID
    EEG.session = str2num(char(extractBetween(EEG.setname,'ses-','_')));
    EEG.condition = char(extractBetween(EEG.setname,'task-','_'));
    EEG.run = str2num(char(extractAfter(EEG.setname,'run-')));
    EEG.task = EEG.condition;
    ALLEEG(iEEG).task = '';
    ALLEEG(iEEG) = EEG;
end

@arnodelorme
Copy link
Collaborator Author

Fixed in 20f89e7

@ChengtengIp
Copy link

Hi Arnaud,

I have tried to export the EEG data using the branch pernet_x from eeglab but it still did not work. I got an error message as below:
image
Best regards,
Cheng

@ChengtengIp
Copy link

The same error message appears again even when I deleted that subject.

@arnodelorme
Copy link
Collaborator Author

arnodelorme commented May 31, 2022 via email

@arnodelorme
Copy link
Collaborator Author

@CPernet can help. He knows how to do that.

@CPernet
Copy link
Contributor

CPernet commented Jun 2, 2022

@ChengtengIp put a few of those subjects in a folder on our server and let see what is failing or not then I can update the function as needed and PR it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants