Present Picture at Pseudorandomized Locations


Author
Message
jmsaito
jmsaito
Associate Member (120 reputation)Associate Member (120 reputation)Associate Member (120 reputation)Associate Member (120 reputation)Associate Member (120 reputation)Associate Member (120 reputation)Associate Member (120 reputation)Associate Member (120 reputation)Associate Member (120 reputation)
Group: Forum Members
Posts: 9, Visits: 19
I am creating a working memory task where I will present participants with 1-3 colored circles at 1 of 8 pre-allocated positions along an imaginary circle. After a brief delay, I will present a placeholder circle at the location of each originally-presented circles, and participants will report the color of the circle in the bolded placeholder.

I want to ensure that when 3 colored circles are presented....
1) The location of each circle is different
2) The locations from trial to trial are different

What is the best way to set this up? I have created a hard-coded list of nearly every variable that requires pseudorandomizing, but it's not clear how to hard code pseudorandomized locations along an imaginary circle, especially if the radius of that imaginary circle needs to change based on the size of the participants' computer monitor.

Thanks!
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: 12K, Visits: 98K
jmsaito - 1/25/2022
I am creating a working memory task where I will present participants with 1-3 colored circles at 1 of 8 pre-allocated positions along an imaginary circle. After a brief delay, I will present a placeholder circle at the location of each originally-presented circles, and participants will report the color of the circle in the bolded placeholder.

I want to ensure that when 3 colored circles are presented....
1) The location of each circle is different
2) The locations from trial to trial are different

What is the best way to set this up? I have created a hard-coded list of nearly every variable that requires pseudorandomizing, but it's not clear how to hard code pseudorandomized locations along an imaginary circle, especially if the radius of that imaginary circle needs to change based on the size of the participants' computer monitor.

Thanks!

I don't understand what the issue is. Can you clarify "it's not clear how to hard code pseudorandomized locations along an imaginary circle, especially if the radius of that imaginary circle needs to change based on the size of the participants' computer monitor" and why that's supposed to be an impediment?

You also may want to take a look at how stimuli along a circle's radius are set up in this script: https://www.millisecond.com/download/library/spatialdelayedresponsetask/

jmsaito
jmsaito
Associate Member (120 reputation)Associate Member (120 reputation)Associate Member (120 reputation)Associate Member (120 reputation)Associate Member (120 reputation)Associate Member (120 reputation)Associate Member (120 reputation)Associate Member (120 reputation)Associate Member (120 reputation)
Group: Forum Members
Posts: 9, Visits: 19
Dave - 1/25/2022
jmsaito - 1/25/2022
I am creating a working memory task where I will present participants with 1-3 colored circles at 1 of 8 pre-allocated positions along an imaginary circle. After a brief delay, I will present a placeholder circle at the location of each originally-presented circles, and participants will report the color of the circle in the bolded placeholder.

I want to ensure that when 3 colored circles are presented....
1) The location of each circle is different
2) The locations from trial to trial are different

What is the best way to set this up? I have created a hard-coded list of nearly every variable that requires pseudorandomizing, but it's not clear how to hard code pseudorandomized locations along an imaginary circle, especially if the radius of that imaginary circle needs to change based on the size of the participants' computer monitor.

Thanks!

I don't understand what the issue is. Can you clarify "it's not clear how to hard code pseudorandomized locations along an imaginary circle, especially if the radius of that imaginary circle needs to change based on the size of the participants' computer monitor" and why that's supposed to be an impediment?

You also may want to take a look at how stimuli along a circle's radius are set up in this script: https://www.millisecond.com/download/library/spatialdelayedresponsetask/
The reference in the example script is useful, thanks!


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: 12K, Visits: 98K
jmsaito - 1/25/2022
Dave - 1/25/2022
jmsaito - 1/25/2022
I am creating a working memory task where I will present participants with 1-3 colored circles at 1 of 8 pre-allocated positions along an imaginary circle. After a brief delay, I will present a placeholder circle at the location of each originally-presented circles, and participants will report the color of the circle in the bolded placeholder.

I want to ensure that when 3 colored circles are presented....
1) The location of each circle is different
2) The locations from trial to trial are different

What is the best way to set this up? I have created a hard-coded list of nearly every variable that requires pseudorandomizing, but it's not clear how to hard code pseudorandomized locations along an imaginary circle, especially if the radius of that imaginary circle needs to change based on the size of the participants' computer monitor.

Thanks!

I don't understand what the issue is. Can you clarify "it's not clear how to hard code pseudorandomized locations along an imaginary circle, especially if the radius of that imaginary circle needs to change based on the size of the participants' computer monitor" and why that's supposed to be an impediment?

You also may want to take a look at how stimuli along a circle's radius are set up in this script: https://www.millisecond.com/download/library/spatialdelayedresponsetask/
The reference in the example script is useful, thanks!


Here is a condensed version loosely based on the circle position logic in the SDRT. On every trial, it picks three different angles for three on-screen objects A, B, and C. The faint circle you see is merely there as a visual aid, to help you see that the objects are placed along the circle's radius. You can play around with the /canvassize setting to check whether everything adapts to different canvas / monitor sizes as intended.

<defaults>
/ screencolor = grey
/ txbgcolor = transparent
/ canvasaspectratio = (4,3)
/ canvassize = (50%, 50%) // play around with this
</defaults>

<parameters>
/ circle_size = 0.7 // as fraction of canvas height
</parameters>

<values>
/ angle = 0 // only used temporarily

/ angle_a = 0 // chosen angle for object A
/ x_a = 0 // calculated x position for object A
/ y_a = 0 // calculated y position for object A

// same for object B
/ angle_b = 0
/ x_b = 0
/ y_b = 0

// same for object C
/ angle_c = 0
/ x_c = 0
/ y_c = 0
</values>

<expressions>
/ diameter_inpx = 1px * parameters.circle_size * display.canvasheight
/ radius_inpx = 0.5 * expressions.diameter_inpx
/ x0 = 1px*(display.canvaswidth/2)
/ y0 = 1px*(display.canvasheight/2)
/ theta = (values.angle-90)*(m_pi/180)
/ deltax = expressions.radius_inpx*cos(expressions.theta)
/ deltay = expressions.radius_inpx*sin(expressions.theta)
/ x = 1px*round(expressions.x0+expressions.deltax)
/ y = 1px*round(expressions.y0+expressions.deltay)
</expressions>

<list angles>
/ items = (
    10,20,30,40,50,60,70,80,
    100,110,120,130,140,150,160,170,
    190,200,210,220,230,240,250,260,
    280,290,300,310,320,330,340,350)
/ selectionrate = always
</list>

<text a>
/ items = ("A")
/ hposition = values.x_a
/ vposition = values.y_a
/ erase = false
</text>

<text b>
/ items = ("B")
/ hposition = values.x_b
/ vposition = values.y_b
/ erase = false
</text>

<text c>
/ items = ("C")
/ hposition = values.x_c
/ vposition = values.y_c
/ erase = false
</text>

// this is not necessary to have and merely serves as visual aid
<shape imaginary_circle>
/ shape = circle
/ color = azure
/ size = (expressions.diameter_inpx, expressions.diameter_inpx)
/ erase = false
</shape>

<trial mytrial>
/ ontrialbegin = [
    list.angles.reset();
    // pick angle for object A
    values.angle_a = list.angles.nextvalue;
    values.angle = values.angle_a;
    // calculate position
    values.x_a = expressions.x;
    values.y_a = expressions.y;
    // pick angle for object B
    values.angle_b = list.angles.nextvalue;
    values.angle = values.angle_b;
    // calculate position
    values.x_b = expressions.x;
    values.y_b = expressions.y;
    // pick angle for object C
    values.angle_c = list.angles.nextvalue;
    values.angle = values.angle_c;
    // calculate position
    values.x_c = expressions.x;
    values.y_c = expressions.y;
]
/ stimulusframes = [1=clearscreen, imaginary_circle, a, b, c]
/ validresponse = (57)
</trial>

<block myblock>
/ trials = [1-8 = trial.mytrial]
</block>



GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search