Using the shape function for randomized stimuli in a search experiment


Using the shape function for randomized stimuli in a search experiment...
Author
Message
jrajsic
jrajsic
Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)
Group: Forum Members
Posts: 3, Visits: 8
Hello there,

I've just started using Inquisit in the last few weeks, coming from a background using Matlab and the Psychophysics toolbox to program experiments. Although I've looked through a number of forum posts, documentation, and sample scripts, I'm having some beginner's difficulties in figuring out how to best approach designing experiments in Inquisit. My apologies if the following questions have been asked already, but I haven't been able to find them.

I'd like to program a variation on the "Additional Singleton Task" (Theeuwes, J. (1992). Perceptual Selectivity for Color and Form. Perception & Psychophysics. 51(6), 599-606.). In this task, 8 shapes are presented in circular formation around the middle of the screen on each trial. There are typically 7 identical shapes, and 1 odd shape, as well as 7 identical colors, as well as 1 odd colors, with randomized positions. However, no one object has both of these unique features (for example, it could be green/square, red/circle, green/circle, green/circle, green/circle, etc., but not green/square, red/circle, red/circle, red/circle, etc.). I've unsuccessfully experimented with a handful of approaches, and I believe, from reading the forums, that I will need to create 8 <shape > objects, one for each location, to be used by the <trial > element. I'm hoping that the coordinates, colors, and shapes, of these objects can be randomized using lists. However, I've run in to two problems.

First, it doesn't look like lists can contain shape descriptors as items (e.g., /item = (rectangle, circle, circle...)). I can pass colors from a list to the /color property, but seem to be having problems with shape.
Second, I am having a problem randomizing the /vposition of shapes. /hposition seems to be fine, being drawn randomly from lists. It might be a mistake in how I'm yoking the y and x coordinates from my reading of the forums.

It'd be great to get some help with these issues! Eventually, I'll want to build on additional features, but I hope that once I get my logic straightened out on how to create these randomized shapes, I'll have a better idea of how to create the rest of my stimuli.

In case it helps, here is the dysfunctional code that I've created so far; please let me know if there is a simple way to create this experiment, as I'd prefer to avoid what seems to be the alternative (generating an image of each of the hundreds of combinations of shapes and colors to be drawn to the screen).

<shape bgimg>
/position = (50%,50%)
/size = (100%,100%)
/color = (0,0,0)
</shape>

<text fixation>
/items = ("+")
/position = (50%,50%)
/height = 100%
/width = 100%
/color = (255,255,255)
</text>

<shape shape1>
/color = list.redtarg_cols.nextvalue
/hposition = list.xpositions.nextvalue
/vposition = list.ypositions.currentvalue
/shape = list.shapes.nextvalue
/size = (10%,10%)
</shape>
<shape shape2>
/color = list.redtarg_cols.nextvalue
/hposition = list.xpositions.nextvalue
/vposition = list.ypositions.currentvalue
/shape = list.shapes.nextvalue
/size = (10%,10%)
</shape>
<shape shape3>
/color = list.redtarg_cols.nextvalue
/hposition = list.xpositions.nextvalue
/vposition = list.ypositions.currentvalue
/shape = list.shapes.nextvalue
/size = (10%,10%)
</shape>
<shape shape4>
/color = list.redtarg_cols.nextvalue
/hposition = list.xpositions.nextvalue
/vposition = list.ypositions.currentvalue
/shape = list.shapes.nextvalue
/size = (10%,10%)
</shape>
<shape shape5>
/color = list.redtarg_cols.nextvalue
/hposition = list.xpositions.nextvalue
/vposition = list.ypositions.currentvalue
/shape = list.shapes.nextvalue
/size = (10%,10%)
</shape>
<shape shape6>
/color = list.redtarg_cols.nextvalue
/hposition = list.xpositions.nextvalue
/vposition = list.ypositions.currentvalue
/shape = list.shapes.nextvalue
/size = (10%,10%)
</shape>
<shape shape7>
/color = list.redtarg_cols.nextvalue
/hposition = list.xpositions.nextvalue
/vposition = list.ypositions.currentvalue
/shape = list.shapes.nextvalue
/size = (10%,10%)
</shape>
<shape shape8>
/color = list.redtarg_cols.nextvalue
/hposition = list.xpositions.nextvalue
/vposition = list.ypositions.currentvalue
/shape = list.shapes.nextvalue
/size = (10%,10%)
</shape>

<list redtarg_cols>
/items = ("green","red","green","green","green","green","green","green")
/selectionmode = sequence
/selectionrate = always
</list>

<list shapes>
/items = ("circle","rectangle","rectangle","rectangle","rectangle","rectangle","rectangle","rectangle")
/selectionmode = sequence
/selectionrate = always
</list>

<list xpositions>
/items = (50%,68%,75%,68%,50%,32%,25%,32%)
/replace = false
/selectionmode = random
/selectionrate = always
</list>

<list ypositions>
/items = (25%,32%,50%,68%,75%,68%,50%,32%)
/selectionmode = list.xpositions.currentindex
/selectionrate = always
</list>

<trial targRedCircle>
/stimulustimes = [0=bgimg,fixation;1000=bgimg,shape1,shape2,shape3,shape4,shape5,shape6,shape7,shape8]
/beginresponsetime = 1100
/response = timeout(1000)
/validresponse = (44,53)
</trial>



Thanks in advance,
Jason

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 105K
> First, it doesn't look like lists can contain shape descriptors as items (e.g., /item = (rectangle, circle, circle...)). I can pass colors from a list
> to the /color property, but seem to be having problems with shape.

That is correct. A <shapes> /shape cannot be changed at runtime (a given <shape> element is either always a rectangle, or always a cricrle, etc., as initially defined per its /shape attribute). It is possible to change / set a <shape> element's color, size, or position at runtime.

I.e., at a minimum, you will have to define 16 <shape> elements (8 circles, 8 squares). Or, perhaps, more succinctly, use <text> elements.

As for the vpositions, your /vposition attributes need to read

/vposition = list.ypositions.nextvalue

instead of

/vposition = list.ypositions.currentvalue


<defaults>
/ screencolor = black
/ txbgcolor = transparent
/ fontstyle = ("Arial", 15%)
/ canvasaspectratio = (1,1)
</defaults>

<shape bgimg>
/position = (50%,50%)
/size = (100%,100%)
/color = (0,0,0)
</shape>

<text fixation>
/items = ("+")
/vjustify = center
/position = (50%,50%)
/height = 100%
/width = 100%
/color = (255,255,255)
</text>

<item shapeitems>
/ 1 = "●"
/ 2 = "■"
</item>

<text shape1>
/vjustify = center
/items = shapeitems
/select = list.shapes.nextvalue
/txcolor = list.redtarg_cols.nextvalue
/hposition = list.xpositions.nextvalue
/vposition = list.ypositions.nextvalue
/size = (10%,10%)
</text>
<text shape2>
/vjustify = center
/items = shapeitems
/select = list.shapes.nextvalue
/txcolor = list.redtarg_cols.nextvalue
/hposition = list.xpositions.nextvalue
/vposition = list.ypositions.nextvalue
/size = (10%,10%)
</text>
<text shape3>
/vjustify = center
/items = shapeitems
/select = list.shapes.nextvalue
/color = list.redtarg_cols.nextvalue
/hposition = list.xpositions.nextvalue
/vposition = list.ypositions.nextvalue
/size = (10%,10%)
</text>
<text shape4>
/vjustify = center
/items = shapeitems
/select = list.shapes.nextvalue
/txcolor = list.redtarg_cols.nextvalue
/hposition = list.xpositions.nextvalue
/vposition = list.ypositions.nextvalue
/size = (10%,10%)
</text>
<text shape5>
/vjustify = center
/items = shapeitems
/select = list.shapes.nextvalue
/txcolor = list.redtarg_cols.nextvalue
/hposition = list.xpositions.nextvalue
/vposition = list.ypositions.nextvalue
/size = (10%,10%)
</text>
<text shape6>
/vjustify = center
/items = shapeitems
/select = list.shapes.nextvalue
/txcolor = list.redtarg_cols.nextvalue
/hposition = list.xpositions.nextvalue
/vposition = list.ypositions.nextvalue
/size = (10%,10%)
</text>
<text shape7>
/vjustify = center
/items = shapeitems
/select = list.shapes.nextvalue
/txcolor = list.redtarg_cols.nextvalue
/hposition = list.xpositions.nextvalue
/vposition = list.ypositions.nextvalue
/size = (10%,10%)
</text>
<text shape8>
/vjustify = center
/items = shapeitems
/select = list.shapes.nextvalue
/txcolor = list.redtarg_cols.nextvalue
/hposition = list.xpositions.nextvalue
/vposition = list.ypositions.nextvalue
/size = (10%,10%)
</text>

<list redtarg_cols>
/items = ("green","red","green","green","green","green","green","green")
/selectionmode = sequence
/selectionrate = always
</list>

<list shapes>
/items = (1,2,2,2,2,2,2,2)
/selectionmode = sequence
/selectionrate = always
</list>

<list xpositions>
/items = (50%,68%,75%,68%,50%,32%,25%,32%)
/replace = false
/selectionmode = random
/selectionrate = always
</list>

<list ypositions>
/items = (25%,32%,50%,68%,75%,68%,50%,32%)
/selectionmode = list.xpositions.currentindex
/selectionrate = always
</list>

<trial targRedCircle>
/stimulustimes = [0=bgimg,fixation;1000=bgimg,shape1,shape2,shape3,shape4,shape5,shape6,shape7,shape8]
/beginresponsetime = 1100
/response = timeout(1000)
/validresponse = (44,53)
</trial>

jrajsic
jrajsic
Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)
Group: Forum Members
Posts: 3, Visits: 8
That works great, thanks! I had no idea that text versions of these shapes were possible. Very handy. A (hopefully quick) follow-up question about these text-shapes: how can I adjust their size? When using the /size property, that seems to affect a white square that the (relatively small) shapes are drawn on.

Thanks again,
Jason

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 105K
For <text> elements, /size specifies the dimensions of the bounding rectangle around any characters. The characters' size is controlled via /fontstyle. (In the example I posted, the fontstyle is defined in the <defaults> element).

You can manipulate a given <text> element's font size by setting the fontheight property:

<defaults>
/ screencolor = black
/ txbgcolor = transparent
/ fontstyle = ("Arial", 10%)
/ canvasaspectratio = (1,1)
</defaults>

<shape bgimg>
/position = (50%,50%)
/size = (100%,100%)
/color = (0,0,0)
</shape>

<text fixation>
/items = ("+")
/vjustify = center
/position = (50%,50%)
/height = 100%
/width = 100%
/color = (255,255,255)
</text>

<item shapeitems>
/ 1 = "●"
/ 2 = "■"
</item>

<text shape1>
/vjustify = center
/items = shapeitems
/select = list.shapes.nextvalue
/txcolor = list.redtarg_cols.nextvalue
/hposition = list.xpositions.nextvalue
/vposition = list.ypositions.nextvalue
/size = (10%,10%)
</text>
<text shape2>
/vjustify = center
/items = shapeitems
/select = list.shapes.nextvalue
/txcolor = list.redtarg_cols.nextvalue
/hposition = list.xpositions.nextvalue
/vposition = list.ypositions.nextvalue
/size = (10%,10%)
</text>
<text shape3>
/vjustify = center
/items = shapeitems
/select = list.shapes.nextvalue
/color = list.redtarg_cols.nextvalue
/hposition = list.xpositions.nextvalue
/vposition = list.ypositions.nextvalue
/size = (10%,10%)
</text>
<text shape4>
/vjustify = center
/items = shapeitems
/select = list.shapes.nextvalue
/txcolor = list.redtarg_cols.nextvalue
/hposition = list.xpositions.nextvalue
/vposition = list.ypositions.nextvalue
/size = (10%,10%)
</text>
<text shape5>
/vjustify = center
/items = shapeitems
/select = list.shapes.nextvalue
/txcolor = list.redtarg_cols.nextvalue
/hposition = list.xpositions.nextvalue
/vposition = list.ypositions.nextvalue
/size = (10%,10%)
</text>
<text shape6>
/vjustify = center
/items = shapeitems
/select = list.shapes.nextvalue
/txcolor = list.redtarg_cols.nextvalue
/hposition = list.xpositions.nextvalue
/vposition = list.ypositions.nextvalue
/size = (10%,10%)
</text>
<text shape7>
/vjustify = center
/items = shapeitems
/select = list.shapes.nextvalue
/txcolor = list.redtarg_cols.nextvalue
/hposition = list.xpositions.nextvalue
/vposition = list.ypositions.nextvalue
/size = (10%,10%)
</text>
<text shape8>
/vjustify = center
/items = shapeitems
/select = list.shapes.nextvalue
/txcolor = list.redtarg_cols.nextvalue
/hposition = list.xpositions.nextvalue
/vposition = list.ypositions.nextvalue
/size = (10%,10%)
</text>

<list redtarg_cols>
/items = ("green","red","green","green","green","green","green","green")
/selectionmode = sequence
/selectionrate = always
</list>

<list shapes>
/items = (1,2,2,2,2,2,2,2)
/selectionmode = sequence
/selectionrate = always
</list>

<list xpositions>
/items = (50%,68%,75%,68%,50%,32%,25%,32%)
/replace = false
/selectionmode = random
/selectionrate = always
</list>

<list ypositions>
/items = (25%,32%,50%,68%,75%,68%,50%,32%)
/selectionmode = list.xpositions.currentindex
/selectionrate = always
</list>

<trial targRedCircle>
/ ontrialbegin = [text.shape1.fontheight = 20%]
/stimulustimes = [0=bgimg,fixation;1000=bgimg,shape1,shape2,shape3,shape4,shape5,shape6,shape7,shape8]
/beginresponsetime = 1100
/response = timeout(1000)
/validresponse = (44,53)
</trial>

jrajsic
jrajsic
Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)Associate Member (186 reputation)
Group: Forum Members
Posts: 3, Visits: 8
Perfect! Thank you so much!

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search