EEG

From CNI Wiki
Revision as of 18:49, 7 June 2011 by imported>Laimab
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 pdf file. Week 1, Week 2, Week 3, Week 4,

CNI PhysMon Device

CNI PPG pulse detector device.

We recently completed a small device to detect subject pulses based on the real-time physio data stream from the GE PPG cabinet. This device is installed and ready for use. See the CNI_widgets page for details on the hardware.

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()