picture

 elements

An image from an image file (jpeg, bmp, etc.) or MATLAB image array.

For any trial you define in an experiment script, you can make one or more 

picture

 objects using function 

picture

Object and input them to addTrial.

For any trial you define in an experiment script, you can make one or more 

picture

 objects using function 

picture

Object and input them to addTrial.

Input properties

Adjustable properties

You can allow the subject to adjust the following input properties of an object of this type during the experiment using an adjuster element. If you need to make other properties adjustable, you can copy the element type using newPbType and edit it.

position
nn_eyes
rotation
opacity

(None)

(None)

fileName
dataExpr

No defaults

Set one of:

fileName is a string that is name of picture file to show. Include path if the file is not in the MATLAB current folder or search path (or not the first file with that name on the search path). File can be any format MATLAB imread accepts.

OR

dataExpr: Use this to get the picture from an image array in the base MATLAB workspace. The image array is an n (px height) × m (px width) × 1/2/3/4 (1 = L, 2 = LA, 3 = RGB, 4 = RGBA) numeric array. By default values should be 0–255, but you can change this using bitDepth below. dataExpr is a string that is the expression pointing to the data. This can be just a variable name, or it can include indexes, field names, etc.

e.g.
<cds>"pictureData"<cds>
<cds>"pictures{5}"<cds>
<cds>"albums.cats(2).pic"<cds>

bitDepth

Default: 8

PsychBench automatically detects this for most pictures loaded from files. If it can't, or if you use dataExpr above to get the picture from an image array, then you can specify bits per pixel color component (e.g. RGB) here. Usually leave at default = 8 (each pixel component between 0–255).

height

Default: 1 px in picture = 1 px on screen

A number that is height on screen to show at (deg).

OR a string setting overall size of the picture on screen:

<cds>"fit"  <cds> – fit picture to window
<cds>"fitw" <cds> – fit picture width to window
<cds>"fith" <cds> – fit picture height to window
<cds>"fill" <cds> – fill window with picture
<cds>"px"   <cds> – native resolution: 1 pixel in picture = 1 pixel on screen (scaled down if you use a partial screen window)

All the fit and fill options assume the picture is centered in the window.

crop
mask

Defaults: show whole picture

crop is a 1x4 vector <cd>[x_tl y_tl x_br y_br]<cd> setting part of the picture to show. + = right/down, <cd>[0 0]<cd> = top left of picture. Units are px in the picture file/data (independent of your screen). For right and bottom you can use <cd>inf<cd> to mean that edge of the picture (e.g. <cd>[0 0 inf inf]<cd> = show whole picture). crop applies before properties height/position/rotation, i.e. they apply to the cropped part.

OR

mask is the same except except it applies after properties height/position/rotation, i.e. they apply to the whole picture and then anything outside the masked part is just not shown.

noise

Default: no noise

A string or row cell array containing inputs to MATLAB imnoise to apply noise to the picture. You can set noise = a string if all you need is the noise type, or = a row cell array (with first member a string) if you need additional inputs. Always omit what would be the first input to imnoise, which is the image matrix.

e.g. <cd>{<cd><cds>"gaussian"<cds><cd>, 0.25, 0.5}<cd> = Gaussian noise with mean intensity 0.25 and variance 0.5

Note if you use noise, the image will show as grayscale.

Input properties all visual elements have

position

Input properties all adjuster elements have

adjust

Input properties all objects have

report
info

Record properties

PsychBench uses record properties to record information during experiments. You can't set record properties but you can see them in experiment results using input property report.