Uploaded StimuliTo upload your own visual stimuli as a sequence of images, you can use the stimulus type frameset within a .stm file. This stimulus file is basically a list of the names of stimulus movies with a few other parameters. An example .stm file is given next, and the binary format for the frameset (.fst) files that contain the stimulus image frames is given below.
The names of the .fst files above are chosen by the user, and the path is given relative to the location of the .stm file in which these are referenced. The .fst files have the following binary format. The first eight entries are integers (4-bytes) with the following interpretation:#------------------------------------------------------------------------------ # # fst_sine_dir - testing the .fst file # #------------------------------------------------------------------------------ stim_type frameset # Stimulus type stim_samp 1000.0 # Stimulus sampling rate (images/s) stim_nrpt 1 # Number of repeats stim_mean_zero 0 fst_file_1 dir.00.fst # [c] Name of the frameset (.fst) file fst_bgval 0.0 # Background value if a mask is applied fst_op none # Operation if 'fst_file_2' is defined, "mask" or "none" fst_pix_offset_x -1 # Pixel offset for placing undersize images fst_pix_offset_y -1 # Pixel offset for placing undersize images tf 8.0 # Dummy, to all an F1 analysis at the proper TF dwell 1 # Time units to present each stimulus frame contrast 0 # Dummy, to link to variations in contrast direction 0 # Dummy, to link to variations in direction VARLINK_fst_file_1 dir.00.fst dir.01.fst dir.02.fst dir.03.fst dir.04.fst dir.05.fst dir.06.fst dir.07.fst dir.08.fst dir.09.fst dir.10.fst dir.11.fst dir.12.fst dir.13.fst dir.14.fst dir.15.fst dir.16.fst VARLINK_direction 0 0 22 45 67 90 112 135 157 180 202 225 247 270 292 315 337 VARLINK_contrast 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ### Parameters below are controlled by the model during execution stim_frame_xn 32 # x size (pixels) stim_frame_yn 32 # y size (pixels) stim_frame_tn 2048 # t size (image frames) stim_frame_sscale 0.10 # spatial scale (deg/pix) stim_frame_tscale 0.002 # temporal scale (s/frame)
Following this header information, tn frames are stored (or tn times 2 if the stimulus is binocular - binoc_code =2), each having xn times yn values. Each value is stored as an unsigned short (fcode = 2). The ordering of the values within each frame is (reading the text below from left to right, then top to bottom):
- Endian check - must be 16909061
- Version code - 1 indicates the first version of the .fst format
- xn - the number of image pixels along the x-axis
- yn - the number of image pixels along the y-axis
- tn - the number of image frames in the movie
- fcode - format code, 2 indicates data is stored as unsigned short int (2-bytes) [Not implemented yet: 1-unsigned char, 3-int, 4-float]
- color_code - 0-achromatic [Not imp'd yet: 2-two color modulation 3-full RGB]
- binoc_code - 0-monocular, 2-binocular interleaved
where (0,0) is meant to be displayed in the lower left corner, and (xn,0) in the lower right corner.(0,0) (1,0) ... (xn,0) (0,1) (1,1) ... (xn,1) ... (0,yn) (1,yn) ... (xn,yn)An example of a C-code routine that writes a .fst file given a 3-dimensional floating point arrray.
The iModel Stimulus Viewer can be used to view frameset stimuli and is available to download. Follow the Downloads link at the left (on the iModel homepage), and click on StimV.