EEG: Difference between revisions

From CNI Wiki
Jump to navigation Jump to search
imported>Amnorcia
No edit summary
imported>Alexg8
Line 20: Line 20:
= PsychToolBox Display System =
= PsychToolBox Display System =
==General Description==
==General Description==
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.
==MATLAB Commands==
==MATLAB Commands==
==Other Considerations==
==Other Considerations==

Revision as of 17:39, 21 July 2011

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

Storage, Charging, Maintenance

Setting up NetStation with the Scanner

Cabling NetStation: Inside the Control Room for set-up

Cabling NetStation: Inside the Scanner Room for recording

CNI PhysMon Device

PowerDiva Display System

PsychToolBox Display System

General Description

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.

MATLAB Commands

Other Considerations

EEG post-processing

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