STIM - stimulus parameters format

=======================================================================
Spikes - Eye Movements - Stimulus (SEMSTIM) MAT file format description
=======================================================================

-----------------------------------------------------------------------
format 1.0 (13.06.02) 
-----------------------------------------------------------------------

Each file contains one structure SEMSTIM_struct -
1xN struct array with fields:
    TrialNum		
    TimeBegin (see NOTE 1) 	// ms
    TimeEnd			// ms
    spikes			// Spike Arrival Times in ms
    eye_time_axis		// ms
    eye_hor			// minarc
    eye_ver			// minarc
    STIM			// See (**)

where N is the number of trials in the file. Each element of the array contains one trial.

** STIM is structure with the following fields (actual field values below are just an example):

Format: 		'1.0'
FileName: 		'0888R010.A18  '
SID: 			3			// Stimulus ID (see NOTE 2)
StabFlag: 		0			// 0 - no stab., 1 - each frame, 2 - even frames
StimulusName: 		'sweep'			// (See NOTE 2)
OneStimDuration: 	250			// ms (see NOTE 4)
TimeBetweenStim: 	0			// ms (see NOTE 4)
Tilt: 			100			// deg (0 - stimulis is horizontal: RadialBoxSize - x, PerpenBoxSize - y)
RadialBoxSize: 		118			// minarc (along preferred orientation, x @ tilt=0)
PerpenBoxSize: 		19			// minarc (perpendicular to preferred orientation, y @ tilt=0)
XStartPos: 		185			// minarc (x center of the stimulus referenced to LLC - lower left corner of monitor) 
YStartPos: 		110			// minarc (y center of the stimulus referenced to LLC)
ExtentStimMotion: 	0			// minarc (see NOTE 5)
StimVelocity: 		0			// minarc/s
FgrRedInt: 		0.3020			// cd/m^2 or RGB 0-255
FgrGreenInt: 		0.3550			// cd/m^2 or RGB 0-255
FgrBlueInt: 		0.3090			// cd/m^2 or RGB 0-255
BckgrRedInt: 		0.3020			// cd/m^2 or RGB 0-255
BckgrGreenInt: 		1.0430			// cd/m^2 or RGB 0-255
BckgrBlueInt: 		0.3090			// cd/m^2 or RGB 0-255
SpatialFreq: 		3			// cpd
TempFreq: 		0			// Hz
Phase: 			135			// deg
Contrast: 		0.5000			// 0.01% (0 - 1)
StimTempType: 		3			// (See NOTE 3)
StimSpatType: 		0			// (See NOTE 3)


-----------------------------------------------------------------------
NOTES:
-----------------------------------------------------------------------

1. TimeBegin can be negative, but stimulus start will always be synchronized with time zero.

2. Table of current stimuli IDs:
===============================
StimulusName 	SID	Meaning
===============================
background	0 	Uniform background
static		1	Static bar
flash		2	Flashing bar
sweep		3	Sweeping bar
wsine		4	Drifting/Stationary windowed sine grating
csine-si	5	Counterphase (Contrast-reversal) grating (sine temporal function)
csine-sq	6	Counterphase (Contrast-reversal) grating (square temporal function)
csine-ramp	7	Counterphase (Contrast-reversal) grating (ramp temporal function)
fwsine		8	Flashing drifting/stationary windowed sine grating
wsquare		9	Drifting/Stationary windowed square grating
sqsweep		10	Inc/Dec sweeping bar
ssine		11	Sweeping split sine grating (two gratings/lobes separated by gap)
flash-n-sweep	12	Flashing and sweeping bar
  
3. Table of current stimulus temporal (t-t) and spatial (s-t) types.

These types were used in the old system, and are obsolete/redundant in the new system, 
except for t-t 'Alternating'/'Repeating' for sweeping bars (sweep and sqsweep stimuli). 
'Alternating' means sweep going forward and backward, 'Repeating' - only forward motion.

All other stimuli are unequivocally defined by SID (see NOTE 2).

* t-t *	
'No motion'	0	
'Alternating'	1
'Flashing'	2
'Repeating'	3

* s-t *				
'Solid tilted rectangular'	0 	// bar
'Sinus'				1	// drifting sinusoidal grating window (up to year 96, now obsolete)
'Gabor'				2	// never used
'6-th deriv of Gaussian'	3	// never used
'Regular texture'		4	// never used
'Random'			5	// never used
'Wsine'				6	// sinusoidal grating drifting WITHIN the window (cf. Sinus)
'Csine-sq'			7	// counterphase (contrast-reversal) grating (square temporal function)
'Ssine'				8	// sweeping split sine grating (two gratings/lobes separated by gap)
'MAX_PAT_TYPE'			9	// never used
'Csine-si'			10	// counterphase (contrast-reversal) grating (sine temporal function)
'Csine-ramp'			11	// counterphase (contrast-reversal) grating (ramp temporal function)
'Fwsine'			12	// flashing (on-off) wsine (see Wsine)
'Wsquare'			13	// square grating drifting WITHIN the window (cf. Wsine)
'SqSweep'			14	// Inc/Dec sweeping bar (one sweep forth/back - INC, other - DEC)

4. OneStimDuration and TimeBetweenStim parameters are used for flashing stimuli: flash and fwsine. 
For all other stimuli, they are redundant.

Before 17 May 2000: OneStimDuration - time stimulus is on, TimeBetweenStim - stimulus is off.
After 17 May 2000: OneStimDuration - time stimulus is off, TimeBetweenStim - stimulus is on.

5. Extent of stimulus motion is used for sweep and sqsweep stimuli. 
The motion is always perpendicular to tilt and stumulus XY position is the middle point of the sweep.