|
| |
MatVis format: MatVis('function name', additional parameters...)
Function: 'spatialWindow' and 'spatialWindowS'
Load spatial patterns (images) for trial which are smaller than the defined trial image dimensions.
Parameters :
('spatialWindow', trialNumber, imageNumber, origin, type, image)
('spatialWindowS', trialNumber, [startImageNumber stopImageNumber], origin, type, image)
image = the spatial pattern to be loaded into MatVis.
trialNumber = The particular trial/condition that is to be loaded.
imageNumber = loading a single image into a particular frame number in the trial buffer.
origin = row and column number in the trial frame from the upper left corner for the image.
type = logic parameter for source > destination frame combination (not currently supported).
[startImageNumber stopImageNumber] = When loading a sequence of spatial patterns, these are the start and stop
frames of the condition the sequence of spatial patterns are to be loaded into.
Return:
1 = indicates an internal error occurred in MatVis
0 = successful completion of command
Description:
After the trials have been defined, these spatial functions are used to load the actual patterns into each trial
buffer. When the images have the same dimensions as defined in the trial command the spatial or spatialS command
shoule be used. However, when the images are smaller than the trial definition these spatialWindow commands enable
subregions of the trial frames to be loaded. These commands function the same as the simpler spatial commands except
the distance ([rows columns]) from the upper left corner of the frame is provided for identifying the desired location
of the subregion to be load with the new image. The new image replaces any image that might already exist in the
subregion. In the future we will provide logic operations besides replacement for combining images in the sub regions.
The 'spatialWindowS' function loads a sequence of frames where a row by columns image is stored as a matix of row
by (columns * frames). The matrix passed to MatVis can be either double precision or uint8 data types.
Examples:
1) Load noise patterns into frame one of trial two that when fused would produce a random dot stereogram of
a central square in depth with a two pixel disparity.
background = rand(100,100)*200; square = rand(20,20)*200;
MatVis('spatialWindow',2,1,[0 0],0,background); % left eye noise background
MatVis('spatialWindow',2,1,[120 0],0,background);% right eye noise background (20 pixel gap)
MatVis('spatialWindow',2,1,[39 40],0,square); % left eye central nose square
MatVis('spatialWindow',2,1,[161 40],0,square);% right eye noise background with 2 pixel disparity
2) The same example as above except load 30 frames of sterograms which could be used to produce a dynamic sterogram
( could also be easily achieved using LUTs). Load the images into frames 1-30 of the trial two.
background = rand(100,100*30)*200; square = rand(20,20*30)*200;
MatVis('spatialWindowS',2,1, [1 30], [0 0],0,background); % left eye noise background
MatVis('spatialWindowS',2,1, [1 30], [120 0],0,background);% right eye noise background (20 pixel gap)
MatVis('spatialWindowS',2,1, [1 30], [39 40],0,square); % left eye central noise square
MatVis('spatialWindowS',2,1, [1 30], [161 40],0,square);% right eye noise background with 2 pixel disparity
See Also:
spatialWindow spatialWindowS temporal trial flashImage
|