ONR Extracting Markers from .xdf Files Using MoBi (Manually) - LeoLedesma237/LeoWebsite GitHub Wiki

Overview

To do event-related potential (ERPs) analyses, we need to know when in time a stimulus was presented in the EEG data. In typical EEG research, trigger codes can be written into the software displaying the tasks that save the EEG files with this marker information. For ONR, however, we are creating and saving .xdf files that contain marker and EEG data saved separately.

The goal of this script is to use some MATLAB code to extract the markers from the EEG Pilot data. There are 5 parts to this process and one of them has sub parts included as well. They are as follows:

  • Part 1: Opening 'Pilot IDs need Mobi.xlsx'
  • Part 2: Opening 'Extracting Markers from XDF Files.m' + sub parts
  • Part 3: Verify that the extracted markers were saved
  • Part 4: Documenting extracted marker success in 'MoBI ID Status Tracker.xlsx'
  • Part 5: Repeating the process

Part 1: Open 'Pilot IDs need Mobi.xlsx'

  • This is a list of GnG and Nback files from the Pilot IDs that need Mobi. This means these are .xdf files which we do not have extracted marker information from.

Files that need to go through MoBi

Part 2: Open 'Extracting Markers from XDF Files.m'

  • This is a MATLAB script that is divided into three parts.
  • To run MATLAB code in chunks, highlight the lines of code of interest, right-click it and then click on Evaluation Selection in Command Window F9.

Part 2a: Type in the name of the data enterer

  • This part needs to be done one time. Do it every time you open MATLAB for the day. As long as this code is run and MATLAB stays open then it is not required to re-run.

Part 2b: Type in the ID Number and the Testing Day

  • Only two lines of code need to be changed in this chunk. That is the value for the object ID and Day. Type in the ID number and the testing day in accordance with the file names in Part 1.
  • Highlight and run the lines of code as shown below.
  • Keep note on the bottom left corner for the 'busy' sign. Wait for it to go away.

Open file in Mobi Lab

  • Wait for the EEGLAB GUI (Blue Box) to appear- should take 2-3 minutes.

Part 2c: Manually assigning 'Data' and 'Events'

  • We need to tell Mobi Lab which of the 6 streams are the EEG data and which ones are the markers.

Exporting Steps

Assigning Data and Events

  • This should take 2-3 minutes to finish
  • You will know it is done because Creating a new ALLEEG dataset will appear in the bottom of the Command Window.
  • Close out of the EEGLAB Gui and the 'Export to EEGLAB' Gui.

Part 2d: Saving the markers as a .CSV

  • Highlight the save portion of the code and run it as shown below.

Saving the markers as a CSV

  • Wait for the 'Busy' notation on the bottom left corner to go away.
  • Should take about 1 minute.

Part 3: Verify the markers were saved

  • The code from Part 2d should create a .CSV file with the marker information saved.
  • Confirm this by going into the EEG_DATA_PILOT_CSV_Files directory.

Verifying Markers were Extracted

Part 4: Open 'MoBI ID Status Tracker.xlsx'

  • We need to keep track if an .xdf file (aka a GnG EEG file) had their markers extracted succesfully.
  • If there were any problems that prevented this from occurring, then this needs to be documented for further inspection.

Documenting Successful Marker Extraction

Part 5: Go back to Part 2b

  • If there are still files in Part 1 that need to be processed through Mobi.
  • This means we do not have their marker data information saved as a .CSV file yet.
  • Keep in mind, these files will not update immediately after markers have been saved.