Diff of vstim


[[FrontPage]]

*Visual stimulus presentation program [#lee07167]
You need to prepare a sequence file as text and image files as PING. 

 vstim0: no DIO feature(any environment)
 vstim: DIO available(require NIDAQ environment[NI USB-6501])

Only PING image files are supported now. All of the image files should be in the current directory.

Usage:
 >vstim0 sequence.txt <RET>
 >vstim0 sequence.txt -t<RET>
- -t: this flag can be set for test mode. The stimulus is shown in a smaller window.~

To make a log file,
 >vstim sequence.txt | tee -a vstim_log.txt<RET>

Key control after starting the program
|i|showing the information about the display|
|q,Q|Quit the program|

Input trigger channel: DIO1~8~
Output trigger channels: DIO9-16~

DIO1 is used for MRI trigger input. DIO2-8 are used for the subject responses.
Key press of 'z', 'x','c','v','/' are also corresponding to the input triggers.
|z,Z|2|
|x,X,/|3|
|c,C|4|
|v,V|5|
Supported image file : ONLY png/PNG~
Supported OS: MacOS10.6-10.11~

**Sequence file format [#rf00ed92]

***GLOBAL SETTING [#g0b745ce]
|SCREEN|Full screen display setting. It's recommended to fit to your screen's dimension.|
|SIZE|Display size(disabled now)|
|BACK|Background color setting(R,G,B)|
|SHIFT|Image origin(center) shift in the screen. (0,0) is center.|
|FIX|Fixation setting(type,color,size,linewidth)|
|CTABLE|Colortable setting (r1,g1,b1,a1,r2,g2,b2,a2,...)|
|FTASK|secondary task sequence|
|FDUR|durations for the secondary task|

***SEQUENCE [#b2d2b9f3]
# INDEX PNG_FILE_NAME X Y DURATION NEXT_IDX JUMP_IDX FIXATION CONDITION
|INDEX|index number started from 1 |
|PNG_FILE_NAME|png file name or "BLANK" or "TRIGGER" |
|X|horizontal image shift from the origin|
|Y|vertical image shift from the origin|
|DURATION|Duration time(ms) for the stimulus(When you set a negative value here, an MRI trigger changes the frame to the Jump index. '-1' to wait forever to receive a MRI trigger)|
|NEXT_IDX|Where to go after the stimulus or MRI trigger input|
|JUMP_IDX|Where to go when response button was pressed or when the number of repetition was completed|
|FIXATION|Fixation display flag|
|CONDITION|Condition setting, 1(left),2(right) and 3(both) will make auditory triggers. Decimal value for trigger out, e.g. setting 3 gives trigger on DIO channel 9 and 10.|
|REPEAT|Number of the repetition setting(0 for no repetition). The negative value indicates that the program receive the button press and change the frame to the Jump index.|
(*)Button press reception is only available when the repeat parameter is negative value)~
(*)When the Jump parameter is negative, stimulus changes immediately and the residual time will be added to the next stimulus.

- With shift setting, image boarder line is sometimes shown(Reported by Chisato)-solved. -- [[Ken]] &new{2015-11-06 (Fri) 06:54:16};

Sample sequence file:
Without the onset trigger adjustment for the blocks 
 SCREEN 1920 1080 8 60 #Xsize Ysize ColorDepth RefreshRate
 SIZE 1920 1080  #DrawAreaXsize DrawAreaYsize
 BACK .5 .5 .5           #BackGroundColor(R,G,B) 0~1
 FIX 1 1 40 8    #Type ColorIdx size width
 FTASK 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2
 FDUR 1500 100 2000 100 1800 100 2500 100 5000 100 500 100 2500 100 4000 100
 // num fname x y time next jump fix condition repeat
 1 wait.PNG 0 0 -1 0 0 0 0 0
 2 N.png 0 0 20000 0 0 1 1 0
 3 AN.png 0 0 125 4 0 1 4 0
 4 BN.png 0 0 125 3 5 1 6 80
 5 N.png 0 0 20000 0 0 1 1 0 
 6 NA.png 0 0 125 7 0 1 8 0
 7 NB.png 0 0 125 6 8 1 10 80
 8 N.png 0 0 20000 0 0 1 1 0
 9 A.png 0 0 125 10 0 1 12 0
 10 B.png 0 0 125 9 11 1 14 80
 11 N.png 0 0 20000 0 0 1 1 0
 12 NA.png 0 0 125 13 0 1 8 0
 13 NB.png 0 0 125 12 14 1 10 80
 14 N.png 0 0 20000 0 0 1 1 0 
 15 AN.png 0 0 125 16 0 1 4 0
 16 BN.png 0 0 125 15 17 1 6 80
 17 N.png 0 0 20000 0 0 1 1 0 
 18 A.png 0 0 125 19 0 1 12 0
 19 B.png 0 0 125 18 2 1 14 80

Sample sequence file2:
With the onset trigger adjustment for the blocks 
 SCREEN 1920 1080 8 60 #Xsize Ysize ColorDepth RefreshRate
 SIZE 1920 1080  #DrawAreaXsize DrawAreaYsize
 BACK .5 .5 .5           #BackGroundColor(R,G,B) 0~1
 FIX 1 1 40 8    #Type ColorIdx size width
 FTASK 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2
 FDUR 1500 100 2000 100 1800 100 2500 100 5000 100 500 100 2500 100 4000 100
 // num fname x y time next jump fix condition repeat
 1 wait.PNG 0 0 -1 0 0 0 0 0
 2 N.png 0 0 19800 0 0 1 1 0
 3 N.png 0 0 -1 0 0 1 1 0
 4 AN.png 0 0 125 5 0 1 4 0
 5 BN.png 0 0 125 4 6 1 6 79
 6 AN.png 0 0 -125 7 8 1 4 0
 7 BN.png 0 0 -125 6 8 1 6 80
 8 N.png 0 0 19800 0 0 1 1 0 
 9 N.png 0 0 -1 0 0 1 1 0 
 10 NA.png 0 0 125 11 0 1 8 0
 11 NB.png 0 0 125 10 12 1 10 79
 12 NA.png 0 0 -125 13 14 1 8 0
 13 NB.png 0 0 -125 12 14 1 10 80
 14 N.png 0 0 19800 0 0 1 1 0
 15 N.png 0 0 -1 0 0 1 1 0
 16 A.png 0 0 125 17 0 1 12 0
 17 B.png 0 0 125 16 18 1 14 79
 18 A.png 0 0 -125 19 20 1 12 0
 19 B.png 0 0 -125 18 20 1 14 80
 20 N.png 0 0 19800 0 0 1 1 0
 21 N.png 0 0 -1 0 0 1 1 0
 22 NA.png 0 0 125 23 0 1 8 0
 23 NB.png 0 0 125 22 24 1 10 79
 24 NA.png 0 0 -125 25 26 1 8 0
 25 NB.png 0 0 -125 24 26 1 10 80
 26 N.png 0 0 19800 0 0 1 1 0 
 27 N.png 0 0 -1 0 0 1 1 0 
 28 AN.png 0 0 125 29 0 1 4 0
 29 BN.png 0 0 125 28 30 1 6 79
 30 AN.png 0 0 -125 31 32 1 4 0
 31 BN.png 0 0 -125 30 32 1 6 80
 32 N.png 0 0 19800 0 0 1 1 0 
 33 N.png 0 0 -1 0 0 1 1 0 
 34 A.png 0 0 125 35 0 1 12 0
 35 B.png 0 0 125 34 36 1 14 79
 36 A.png 0 0 -125 37 2 1 12 0
 37 B.png 0 0 -125 36 2 1 14 80
 

*Known issue [#k5192f55]
Most of the cases, vstim terminate with segmentation error. So far we didn't have any serious problem on it. The issue is caused by DIO with OPENGL, so vstim0 doesn't have the issue.