sccn / EEG-BIDS

21 stars 17 forks source link

Running of EEGLAB within a BIDS code folder #88

Closed Andesha closed 2 years ago

Andesha commented 2 years ago

As discussed in the (now) closed pull request, our lab is having issues with running EEGLAB from within a BIDS code folder.

In your examples, it appears as if the data files are already in BIDS format. We used EEGLAB to both initialize and make data BIDS compliant.

The procedure our lab used, using our fork, looked as follows:

  1. Make a new project folder, and create a code and sourcedata folder inside of it.
  2. Initialize a new instance of EEGLAB within the code folder. This is because EEGLAB is necessary for initializing (resampling, etc) the data, and later for writing it into BIDS format
  3. Clone plugins as necessary
  4. Use standard EEGLAB approach to read/initialize bdf files from sourcedata, and write set files back to sourcedata
  5. In the root of the code folder inside of the project, write/modify the bids_export_example.m to read the set files from sourcedata to write your standard subject folders, i.e. sub-001 which contain your various sidecars

This achieves files both being initialized and made BIDS compliant all from within EEGLAB. I understand this is potentially different than how others install or use EEGLAB, however our projects had to use separate versions of EEGLAB due to conflicts (we have both biosemi and EGI in our lab).

The sticking point here is that the plugin does not appear to like writing to a parent directory. In fact, if you are not strictly careful, you may end up deleting all of your data.

In sum: we would like to request this behavior being supported. If it would be better to discuss this during a meeting please let me know.

Thanks! Tyler

arnodelorme commented 2 years ago

Hi Tyler, it is unclear what you are trying to do. We modified the examples last week. You should check them out. Standard procedure:

  1. Write export script
  2. Add commands to copy sourcedata folder if any

Let us know.

arnodelorme commented 2 years ago

If you need to anonymize the file names in sourcedata, then you need to write your own script (but it is just a couple of lines).

arnodelorme commented 2 years ago

Added one more example today. We could jump on a call to discuss further if you want.