EEG

From CNI Wiki
Revision as of 22:02, 29 November 2011 by imported>Notthoff (Added EEG set-up instructions)
Jump to navigation Jump to search

EEG-fMRI Group Meeting Presentions

The EEG-fMRI group has held meetings every other week during the months of April, May, and June. Each week's presentation is available as a pdf file.

Running EEG/fMRI sessions at CNI

General Description

Prep before your study

You will need to charge the amplifier the night BEFORE you are running your study. The amplifier and charger can be found in the mock scanner room. Note that only the amplifier and the plastic cart are MR safe. The charger is MR UNSAFE, so do NOT take it into the scanner room.

Materials

Other materials that you will need can be found in the scanner control room in the cabinets labeled ‘EEG supplies’ as well as above the sink and on the desk next to the linux computer. You will want to bring a stimulus presentation computer (or use the CNI’s) as well as a computer that runs NetStation. You will also need the peripheral gating monitor (please refer to the physio section on this wiki). The EEG nets can be found in the bathroom. There is a medium net (56-58 cm) and a large net (58-61 cm). For most people you will be using the medium net. There is also a small net in the ‘EEG supplies’ cabinet.’

Preparing for the participant

You will need to soak the net that you are going to use in conductive fluid for at least ten minutes before putting it on your participant. Here is how you make the conductive fluid:

  1. Take the empty container out of the left cabinet over the sink.
  2. Fill the container with about two liters of water.
  3. Use the appropriately labeled scoop, and add at least two scoops of electrolytes (Potassium Chloride). This will keep the sponges of the electrodes moist throughout your study. If they dry out you will get a poor signal. Stir so the electrolytes dissolve in the water.
  4. Use the appropriately labeled scoop and add one scoop of shampoo. Stir so the shampoo dissolves in the water.

Setting up the participant with the EEG

  1. Have your participant sit down on a chair near the sink.
  2. Use the measuring tape to measure the participant’s head size (circumference). Measure it at the level between the eyebrows. Use the appropriate size EEG net.
  3. Stretch the net with both hands and place it over the participant’s head. The red electrodes should be lined up in the middle sagitally and coronally. If you need to adjust/move the net be careful because it can break easily. For example, if you need to move it more to the right, start moving it from the left, rather than pulling on the right side.
  4. Once the net is in the correct position fasten the chin strap and make sure that all the electrodes are touching the participant’s head.
  5. Place a ‘sock’ over the net. You can make this sock out of the white medical material from the EEG supplies cabinet. Cut off a piece about 12 inches long. Tie the top part. Cut a small face hole into your ‘sock.’ Place the ‘sock’ over the EEG net on the participant’s head by stretching it with both of your hands. Cut off any excess material from your knot, so it doesn’t take up unnecessary space in the head coil.
  6. Provide earplugs to your participant.

Check electrode contact

  1. Plug the big plug at the end of the EEG net’s cord into the amplifier and make sure it is tight.
  2. Plug the orange optical wiring into the back of the amplifier, one into ‘I/O Data’ and one into ‘Clock Sync.’ Be careful with the optical wiring. It is very sensitive and can break easily.
  3. Plug the black cable labeled ‘NetStation’ into your computer that is running NetStation.
  4. Connect the PPG box to the NetStation computer.
  5. Connect the computer running NetStation to your stimulus computer (e.g., using Ethernet, but it depends on what software you are using; Ethernet is not the best because of the delay in timing; it is better to use a digital pulse).
  6. Open NetStation on your computer (you will have had to specify your own set up of how devices are connected for your study in NetStation).
  7. Go to Panels – Impedence. Set your cut-off for impedence level at 70 kilo-Ohms. Click ‘Measure Impedence.’ This should show you a screen with the grid of 256 electrodes. If the electrodes are recording properly and have good contact they should be showing up in green. Electrodes with poor contact will show up in red. Here is how you troubleshoot the red electrodes:
    1. Make sure that the electrodes are in the correct orientation.
    2. “Wiggle” the electrodes to make sure that they are actually touching the participant’s head.
    3. Use a pipette from the EEG supplies to squirt more conductive fluid into the sponges of the electrodes.
    4. If none of the above helps, it is possible that some of the electrodes have stopped working. We suggest that you proceed with your study, but notify the CNI staff.
  8. Once you have determined that the electrodes have good contact for the most part disconnect the amplifier from the optical wiring. You are ready to set up your participant in the scanner.

Setting up the participant in the scanner

  1. Walk your participant into the scanner room and bring along the plastic cart with the amplifier. DO NOT bring the charger into the scanner room!
  2. Use the 8-channel head coil (the EEG equipment won’t fit into the 32-channel coil).
  3. Make sure to really pad the participant’s head. Otherwise, it can be really painful for them to lie on the electrodes. We recommend that you put extra padding under the participant’s neck, so that most of their head weight rests on their neck, rather than on the electrodes on their head. Also place padding near the top of the participant’s head and by the sides of their head (as usual).
  4. Connect the amplifier to the optical cables in the scanner room. They are in the bottom cabinet closest to the wall to the scanner console room. Connect one of the optical cables to the ‘Data I/O’ port on the amplifier and one to the ‘Clock Sync’ port. Be careful with the optical wiring! Do NOT step on it. Handle it carefully when putting it away.
  5. Set up your participant with pulse/peripheral gating monitoring. Please refer to the physio section on this wiki for instructions on how to do this.
  6. Put the participant in the scanner.

Recording the EEG

To start recording, you can just click ‘record’ in NetStation, but generally it is a better idea to sync the start of recording with your stimulus computer. You can do so by creating a script (e.g., in Matlab) that triggers the scanner and the EEG recording. The stimulus computer will record all the events. You will also need a script that sends the timing information from the stimulus computer to the NetStation computer. It is a good idea to sync the internal clocks of these two computers (you can do this with a script on every single trial). Finally, it is a good idea to match the monitor refresh rate and the two computers’ internal clocks (again, using a script).

Clean up

When you are done with your session you will need to clean the EEG equipment. Rinse the EEG net under clear water. Make sure you keep the cord as dry as possible to prevent it from molding. Soak the EEG net in the disinfectant solution for ten minutes. The disinfectant is good for two weeks, so check the ‘expiration’ date on the lid to see if you need to make new disinfectant. Rinse the EEG net after you have soaked it in the disinfectant. Hang it up in the bathroom to dry.

Setting up NetStation with the Scanner

Cabling NetStation: Inside the Control Room for set-up

The main purpose of this is to verify the impedances of the electrodes before recording. You would need to connect the Control Room Data I/O Fiber Optic Cable (orange cable with white connectors) to both the amplifier and the FireWire/OptConverter. The FireWire/OptConverter then connects through FireWire to the NetStation Computer. After this you can check the Impedance using the NetStation GUI.

Cabling NetStation: Inside the Scanner Room for recording

Using CNI PhysMon Device to record heartbeat for BCG correction

CNI PPG pulse detector device.

The physmon a small hardware device that detects subject cardiac pulses based on the real-time physio data stream from the GE PPG cabinet. See the CNI_widgets page for details on the hardware.

Cabling the PPG


Put the detector on the subject's finger.


PowerDiva Display System

Cabling PowerDiva

PowerDiva laptop cables:

National Instruments Cable (flat black one) connects DIO card to adapter box Video Output Cabling:

LCD monitor: use direct DVI connection to laptop

Goggle system: use DVI to VGA adapter, connect VGA cable to video splitter box (IN). Connect Googles L box output to Goggles L display input and vice versa



Connecting to the FORP buttons

Connect actual button devices inside scanner room: two response-pad set-up

On the FORP console in scanner room press button

Select change mode,

Choose auto configure, press button

Select USB, press button

Scroll to HID NAR 12345, press button

You should see:

USB

HHSC - 2 x 4 - C

HID NAR 12345

PsychToolBox Display System

Overview

An available option is to use Matlab's Psychtoolbox. This has two purposes: serve as a stim computer, and send events into the Netstation recording stream. Triggering events into the scanner using Matlab has been documented extensively, and hence not discussed here. However, when trying to use Matlab to send events to Netstation the are more things to consider.

Recording events into NetStation using Psychtoolbox uses the NetStation command available when you download Psychtoolbox for Matlab. For more details on how this commands work type in the Matlab command window:

>> help NetStation

or

>> doc NetStation

Cabling PsychToolbox

Connecting to NetStation

Simple TCP connection using an ethernet cable from the stim computer (computer running Psychtoolbox) and the NetStation computer. Make sure that only connection is through the TCP port (i.e. turn off Airport in a Mac). On the Netstation computer, use a static IP (i.e. 10.0.0.42) and SubnetMask 255.255.255.0. Also, turn On the Acquisition bar on NetStation (yellow bar on top).

To verify the connection type in the Matlab command window: >> NetStation('Connect', '10.0.0.42')

If a 0 is returned, then the connection was successful. Verify the TCP log on Netstation to verify the connection on the Netstation computer.

MATLAB Commands

Other Considerations

EEG post-processing

Gradient Cleaning

BCG Cleaning

OLD EEG Equipment Wiring Diagram

To connect the pulse oximeter detector computer and the E-prime computer to the NetStation, we use a custom cable provided by Gary Glover.

Diagram of Gary Glover's DIN cable.

There is a DB-9 port in the back of the GE PRG cabinet that streams the physiological monitor data out over an RS232 serial port. We think it sends the data in real time at a rate of 200Hz (one complete 12-byte data frame every 5ms). Here's some Python code to read the serial data format:

   import serial
   from numpy import *
   import pylab
   
   # The serial data stream seems to get reset when the port is opened.
   # So, as long as you don't miss any frames due to a buffer overflow,
   # you should get complete frames by simply reading 12-byte chunks.
   ser = serial.Serial('/dev/ttyUSB0', 115200, timeout=1)
   # Read n frames of data
   n = 10;
   s = ser.read(n*12)
   ser.close()
   
   # tick counter (unsigned short), increments by 1. This is not reset
   # when the port is opened. We assume that it will wrap around.
   tics = fromstring(s,dtype('<H'))[0::6]
   # Assuming the rest are signed shorts.
   ekg1 = fromstring(s,dtype('<h'))[1::6]
   ekg2 = fromstring(s,dtype('<h'))[2::6]
   resp = fromstring(s,dtype('<h'))[3::6]
   ppg  = fromstring(s,dtype('<h'))[4::6]
   # Not sure what this one is:
   misc = fromstring(s,dtype('<h'))[5::6]
   
   pylab.plot(tic,resp)
   pylab.plot(tic,ppg)
   pylab.show()