LNCD

Table of Contents

Table of Contents

  • sEEG Data Collection & Analysis
    • Data Collection
      • Physical Setup
      • Computer Commands/ Setup
      • Data Retrieval
    • Data Analysis
      • Habit Data
      • Resting State Data
  • LNCD Home
  • Administration
  • Notebooks
  • Journal Club Presentations
  • Publications
  • Current Projects
  • Completed Projects
  • Current Grants
  • Datasets by Project
  • Brain ROIs and Measures
  • ️Tools And Methods
  • Big Data
  • RA Homepage
  • Undergrad Resources
  • Recent Changes
  • Maintenance
  • Site Map
  • Random Page
LNCD
Docs » sEEG Data Collection & Analysis

sEEG Data Collection & Analysis

Data Collection

Physical Setup

  • The task computer is connected to the sEEG computer via the USB hub
  • The cart that has the sEEG computer gets plugged into the wall
  • The power cord on the task computer cart gets plugged into the sEEG computer cart
    • The power strip is in the cabinet, which is locked, but the little key is in the drawer
  • Plug the RT box into the USB hub
  • The photodiode is in the ring box in the black backpack on the task cart. The ring box has a commend strip on it that connects to the command strip on the task screen. The photodiode is then screwed into one of the ANALOG INPUTs on the DAQ. Which is on the sEEG cart, usually in the cabinet (I think), you'll need to uncoil its cord so that it can sit ontop of the cart so that the photodiode cord can reach.
  • Make sure audio is plugged in and go to the computers audio settings (upper right corner) and make sure its on headphones


Computer Commands/ Setup

  • Computer login password: dungeonB104
  • If not already open, open matlab through terminal using command: ptb3-matlab
  • Make sure you're in our folder entitled luna
  • Task command is: Habit('PatientID')


Data Retrieval

  • The brain data will be saved in the subjects folder, on the sEEG computer
  • You can log into onedrive and upload it yourself or ask them to make sure its there
  • The behavioral data will be in the luna folder on the task computer. I just upload to onedrive but you can bring a flashdrive if you want


Data Analysis

  • Taylor's lab has their own github https://github.com/pbe-lab
    • I have pulled (and should continue to update it) their repository, https://github.com/pbe-lab/generalCode which has useful scripts that everyone in the lab uses/ edits. Though they might need to be edited to work for habit.
    • I have pulled this repo and all the sEEG code in Hera/Projects/7TBrainMech/scripts/eeg/Shane/sEEG
    • The sEEG data is saved out in multiple files
      • The .ns2 is the data at 1k Hz sampling rate
      • The .ns5 is 30k Hz but its usually only used to save out any audio that the participant hears, also the photodiode in our case
    • Preprocessing is pretty simple. The hospital collection system already filters out for 60Hz line noise


Habit Data

  • I wrote a script convertHabitDatatoSetFile.m that takes in the .ns2 from the habit folders within each subjects folder
    • Then calls sEEG_ns_to_mat. This is a function from Taylor's lab that I edited. It loads in the ns file and using a function called ns_GetAnalogDataBlock that reads the data and pulls out the 'data block' aka the brain data
      • Returns 3 files
        • matFile (array of time x channels)
        • info (list of channel names)
        • hfile struct
          • Entity
            • channel info, analog or event (trigger channel), labeled 1-number of channels, units (uV)
          • FileInfo
            • info about the different .ns files
          • FilePath
          • Name
          • TimeSpan
    • Calls function extractAndAlignTriggers.m, giving the function the hfile variable
      • Uses ns_GetEventData to extract DAQ triggers
        • Binary signals, either low (0) or high (32767)
        • Must alternate between high and low
        • The sampling rate of the photodiode is 30k, so it loads in the .ns5 files
      • ns_GetAnalogDataBlock.m
        • Pulls out the analog data block (the photodiode)
        • Resamples from 30k to 1k
      • It then loads in the behavioral data which should hold the trigger values (based on when the task flips to the next epoch, and button box responses) so not like our trigger values that are embedded into the brain data
      • This function is trying to line up the photodiode to the behavioral data values
    • Calls function sEEG_mat_to_set(pt, 'habit' , matFile, info)
      • Takes in the subjects data and info
      • Flips the array to be channels x time
      • newDataFrame_selectChannels = newDataFrame(1:size(chans,1),:); %adjusting for the channels actually on the montage
        • The subjects montage is an excel sheet that has the name of the channels and we remove the extra channels that arent on the montage
        • Like ones that might not actually be in the brain, but like in the layers before it
      • Sets the info for the header
        • Sampling rate: 1000
        • nChans: number of channels
        • label: names of the channels
        • nSamples: length of the array (timepoints)
        • nTrials: 1
        • nSamplesPre: 0
      • Uses fieldtrip2eeglab to convert the array of data and using the header info into a set file that EEGLAB can load
      • I then reref to the average (EEG = pop_reref( EEG, []);)
  • chan2roi.m
    • Function that their lab wrote
    • It takes in the patient ID, and a list of their channels and then returns the corresponding ROIs based on the registration of the subjects sEEG and MRIs but that must have alreay been done in brainstorm and saved out and I think Emily does this


Resting State Data

  • Basically the same as the habit, except no behavioral data and corresponding triggers
  • There is a script Restmat_to_set.m that converts the resting state .ns files into .set files that can be loaded into EEGLAB
Previous Next