Selim Onat

I am a neuroscientist working currently on how humans make generalizations based on what they have previously learnt. To do so, I am using a variety of methodologies including fMRI (1), autonomous (2), as well as eye-movement recordings (3).

This research emanates from the well-established field of "stimulus generalization" following mainly the "lineage" of Hovland, Hull and Roger Shepard (4), and including the more recent computational work of Josua Tenenbaum (5). Furthermore, it integrates work on anxiety disorders, as it is believed that these mechanisms are impaired in people suffering from anxiety problems.

In the past, I have been working on how the nervous system processes natural scenes both at the electrophysiological and sensory-motor level. Since the times of Hubel and Wiesel, visual processing had been
overwhelmingly studied with artificial stimuli such as moving edges. However this type of stimuli suffer from an ecological validity problem, as they only rarely occur in real-life. We therefore investigated cortical processing during viewing of natural movies. This previous work focused on visual processing using mostly the technique of voltage-sensitive dye imaging and eye-tracking.

Testing Stimulus Presentation Program using Emulated Scanner Pulses

If you fancy Psychophysics toolbox to present stimuli during an fMRI experiment, you will need to know exactly at which time point the volume acquisition occurs with respect to important events of the experiment, such as for example stimulus onsets. 

Scanners usually send pulses and these are needed to be recorded by the stimulus computer in order to solve this problem. In the specific setup I am using, these pulses are collected in a circuit, called cogent-box, and accumulated. This cumulated count is sent to the serial port of the stimulus computer in the form of 2 bytes. The stimulus program can now correctly time events from different sources e.g. stimulus onsets and the start of volume acquisitions.

The downside is generally that one would need to go to the scanner's console room and run few dummy experiments with the scanner until the presentation code is devoid of any bugs.

However, it would be much nicer to test the stimulus presentation program in the office without the need of having a scanner sending pulses. Therefore some labs have a mobile version of the cogent box with the aim of testing your presentation program without the need of having a scanner to send pulses. But even then, today many modern computers do not have serial ports, making impossible the use such mobile boxes. 

A software solution can circumvent many of the problems associate to a mobile box. In a modern computer, one may create any arbitrary number of virtual ports (Serial or Parallel), read and write data to and from these ports. There are softwares that let you specify any number of virtual ports easily, for example "Virtual Serial Port Deriver". 

Once you have this software you can create a pair of virtual serial port, say COM1 and COM2. You can fire the Matlab, use COM2  and write information in the form of two bytes (to emulate what the cogent-box would be doing in response to pulses received from the scanner at each TR). These two bytes imitates the situation where the cogent-box is counting the number of volumes that have been so far acquired. In another instance of Matlab, running in parallel to the first one, you can set COM1 and read data from it. This will be analogous to the situation you are in the scanner room, without the need of a mobile cogent box or a scanner.

The following psychophysics toolbox function can be used to send pulses.

function SendPulses(N,TR)
%function SendPulses(N)
%Sends N pulses to COM2 serial port. TR is the interpulse TR (that is
%the "TR").
%Selim Onat, 24-Jan-2013 10:55:53

box.port = IOPort('OpenSerialPort', 'COM2');
counter  = 0;
t        = GetSecs;%now
t        = t:TR:t+TR*N;%time of the future pulses
for n = 1:N
    tobesent = [floor(n./255) n];%two byte to be sent
    WaitSecs('untiltime',t(n));%wait and fire.
    [~,t_]=IOPort( 'Write' , box.port , [char(tobesent(1))+1,char(tobesent(2))]);
    counter = counter +1;
    fprintf('Pulse No: %3d sent at %0.10g was due to at %0.10g\n',counter,t_,t(n));
    drawnow%give some time for Control-C