A quick tour of blinking stim and its routines.

Notes from the stimulus documentation:



% Blinks all squares of an imaginary grid on the screen. In a BLINKINGSTIM,

% each square is blinked one at a time. This differs from STOCHASTICGRIDSTIM,

% where squares in the grid are modulated randomly on every frame. The blinking

% stimulus can drive the blinks in either 'sequential' or 'random' order (see parameters).


% BLSp can either be the string 'graphical' (in which case the user is

% prompted for the remaining parameters), the string 'default' (in which case

% default parameter values are used) or it can be a structure as described

% below.


% One may also use


% [BLS] = BLINKINGSTIM('graphical',OLDBLS)


% which will offer the parameters of OLDBLS as the initial values

% for BLS.


% The parameters for the BLSp structure are as follows:


% BG - 1x3 RGB color of background.

% value - 1x3 RGB color of hilighted square

% random - 1x1 0/1 Should the order of presentation be random (otherwise sequential)?

% repeat - 1x1 Number of times to repeat showing each square.

% fps - 1x1 The data frame rate to try to match; if less than 0, then take bgpause

% as absolute times to try to achieve

% bgpause 1x1 If fps >0, then this the number of data frames to pause

% OR

% 1x2 If fps <0, then it should be 1x2, bgpause(1) is the amount of time (in seconds)

% to display each data frame, and bgpause(2) is the amount of time (in seconds)

% to pause between frames.

% rect - 1x4 The rectangle on the screen where the stimulus

% should be shown.

% Use [topleft_x topleft_y botright_x botright_y].

% pixSize - 1x2 pixSize = [X Y], where X and Y are the width

% and height of each grid square. Use values less

% than 1 to use the fraction of the whole rectangle

% instead. (ex: [25 25])

% randState - 35x1 Random state to use (ex: rand('state'))

% dispprefs - cell displayprefs options (or use '{}' for defaults)




z = load('stims.mat');

s = get(z.saveScript,1); % get the first stimulus, should be blinkingstim

p = getgridpositions(s);

o = getgridorder(s);

params = getparameters(s);

[stimids,stimtimes,frametimes] = read_stimtimes_txt(dirname); % dirname should be directory name

% load spikestimes from exported file from spike2




xlabel('Position number');

ylabel('Firing rate (spikes/sec)');

IM = [];

for i=1:size(p,1),

IM(p(i,2),p(i,1)) = rmean(i);