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

Add entry for stimulus folder in pop_exportbids #89

Open
arnodelorme opened this issue Oct 12, 2021 · 4 comments
Open

Add entry for stimulus folder in pop_exportbids #89

arnodelorme opened this issue Oct 12, 2021 · 4 comments
Assignees

Comments

@arnodelorme
Copy link
Collaborator

No description provided.

@arnodelorme
Copy link
Collaborator Author

So you do not have manually copy the folder

@cll008
Copy link
Contributor

cll008 commented Oct 25, 2021

Currently files are already copied via opts.stimuli but AFAIK there's no way to edit this in the GUI. It looks like the most polished way forward is to add a 'pair events and stimuli' menu item under BIDS (or a button in pop_eventinfo) which would edit EEG.events.stim_file based on EEG.event.type (basically functions like opts.stimuli during bids_export). Then we can copy files based on unique entries in EEG.events.stim_file (in this way, re-exports will also copy the stimfiles), and deprecate https://github.com/sccn/bids-matlab-tools/blob/master/bids_export.m#L519-L532

The easy way out is to add another button to locate a stimfile folder, but the code will get even messier. I'm not a fan of adding too many ways to interact with the same field (and don't think we should code in a way that can lead to this):
https://github.com/sccn/bids-matlab-tools/blob/a0190d82907fc045c73a346d770616950c181e85/bids_export.m#L917

I also feel like the snippet for getAllUniqueFieldValues can be a standalone function for EEGLAB.
https://github.com/sccn/bids-matlab-tools/blob/1d17c90170a0e55f5b2a644a6e5ccc1563b43272/pop_eventinfo.m#L508-L525

@dungscout96, any thoughts on how best to include this? Also those GUI editing functions are well written and neat, thanks for that.

@arnodelorme
Copy link
Collaborator Author

Check for field 'stimuli' in event structure and copy files

clear copyfilepersistent;

function copyfilepersistent(fileIn, fileOut)

persistent fileList;

if isempty(fileList)
    fileList = {};
end

if ismember(fileIn, fileList)
    copytfile(fileIn, fileOut)
    fileList{end+1} = fileIn;
end

@arnodelorme
Copy link
Collaborator Author

For the GUI. Add a new GUI to associate event types and stimuli then copy to EEG.event.stim_file for all datasets.

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

2 participants