Beauchamp:ECogAnalysisv2: Difference between revisions

From OpenWetWare
Jump to navigationJump to search
No edit summary
No edit summary
Line 6: Line 6:
   site:openwetware.org/wiki/Beauchamp ExperimentSheet
   site:openwetware.org/wiki/Beauchamp ExperimentSheet


The first step is to define the "S" data structure. To do this we run generateOBJSetting.m script.
The first step is to define the "S" data structure. To do this we run '''generateOBJSetting.m''' script.
   
   
An example can be found in: /Volumes/data/lab/eCog-mfiles
An example can be found in: /Volumes/data/lab/eCog-mfiles

Revision as of 09:19, 16 May 2014

Brain picture
Beauchamp Lab




To search for things on the wiki, use Google's site search feature. For instance, to find an Experiment Sheet, type

 site:openwetware.org/wiki/Beauchamp ExperimentSheet

The first step is to define the "S" data structure. To do this we run generateOBJSetting.m script.

An example can be found in: /Volumes/data/lab/eCog-mfiles

Here are the components of the S data structure:

                fileName: {'YAODatafile017'  'YAODatafile018'}
             chanDesList: {1x68 cell}
                  images: 8
              imageNames: {6x1 cell}
                 kStimOn: 80
               kImageMin: 4096
    kResponse_leftbutton: 128
   kResponse_rightbutton: 129
                      Fs: 2000
               startTime: 0
              sampleTime: 0.5000
         trialTimeCourse: [1x8000 double]

Here are what the elements of the data structure represent:

  1. filename: Name of the raw data file. Each session of an experiment is recorded in a separate datafile.
  2. chanDesList: List of electrodes written according to the montage.
  3. images: Number of different stimuli (conditions) presented in this experiment.
  4. kStimOn: Stimulus onset. The onset of each presented stimulus is registered as an event. Stimulus onset events are always denoted by 80.
  5. kImageMin: Denotes the first stimulus. Every stimulus has a code number but the code number for the first stimulus is always 4096. 4097 denotes the second stimulus, 4098 denotes the third stimulus etc.
  6. kResponse_leftbutton: Left mouse button presses are registered as 128.
  7. kResponse_rightbutton: Left mouse button presses are registered as 129.
  8. Fs: Sampling frequency. The data is recorded at 2000 Hz.
  9. startTime: Start time of the recording.
  10. sampleTime: Time between each sample point (1/Fs) in milliseconds.
  11. trialTimeCourse: Time course of trial. e.g. -1:1/S.Fs:4 (A 5 second trial that consists of 8000 sample points).

Information about data files (i.e which experiment session is recorded under which data file) and electrode montage can be found in the physiology file of each subject. e.g. /Volumes/data/UT/YAO/YAOPhysiology.docx

The next step is to load the appropriate data files and adjust the epochs based on the trial onset times. To do this we run the Preprocessing1.m script. (example copy in /Volumes/data/lab/EcogMfiles ) This script contains the following steps:

  • Loading data files:

Data files of each subject are found on the server: e.g. /Volumes/data/UT/YAO/eCog/ Data for each channel is recorded in a separate .mat file: e.g. YAODatafile021_ch90.mat ( Data file 21, channel 90) During the presentation of the stimuli, audio signal (stimulus sound) is always saved in Channel 129. Stimuli is presented in trials that are separated by a gray screen. A photo diode that is attached on the screen of the presentation computer detects whenever a new video stimulus appears on the screen. This diode signal is always saved in Channel 130.

  • Common Average Re-referencing (CAR) (Optional):

CAR calculates average over all channels at each time point and subtracts that average from each individual channel.

  • Grouping trials:

Trial onset, trial end, trial type and button press press information are saved in a time stamp file. e.g. /Volumes/data/UT/YAO/eCog/YAODatafile021_timeStamp.mat Time stamp file includes eventData file. In eventData file, 4096, 4097, 4098 etc. denotes different stimuli while the following 128 or 129 denotes the behavioral response of the subject to the stimulus. For each trial we assign a number that denotes the stimulus type and response combination for that trial. Then we save these number in a separate matfile called imageIndex.

  • Epoching the signal:

Time stamp file also includes eventTime file. In eventTime file trial onset, trial end and button press press times (in terms of seconds) with respect to the start time of the session is found. Start time of each trial is earlier than the start time of the actual stimulus (appearance of sound or video of the presentation screen). We epoch the trials starting from 1 second before and until 3 or 4 seconds after the audio or video onset. For auditory only trials we use the