EEG
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
Using CNI PhysMon Device to record heartbeat for BCG correction
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
Cabling PsychToolbox
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
MATLAB Commands
Other Considerations
EEG post-processing

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.

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