time function of circle size


Author
Message
Nakayama Yao
Nakayama Yao
Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)
Group: Forum Members
Posts: 39, Visits: 230
Hi, Dave
I am pretty new about how to program the following design, and wish to seek for some sample scripts from you:
 in inquisit, it uses "size" to define the area covered by the circle.
I wish to set a function between the size of the red circle (located at the center of the screen) s and the lapsed time t.
so as the presented time lapses, the size of the circle lineally shrinks.
such as t=2s.
Thank you in advance for your advice.





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
Nakayama Yao - Tuesday, October 10, 2017
Hi, Dave
I am pretty new about how to program the following design, and wish to seek for some sample scripts from you:
 in inquisit, it uses "size" to define the area covered by the circle.
I wish to set a function between the size of the red circle (located at the center of the screen) s and the lapsed time t.
so as the presented time lapses, the size of the circle lineally shrinks.
such as t=2s.
Thank you in advance for your advice.





If you want to pull this off within a single <trial> element, you would actually define X amount of circular <shape>s, define their respective sizes, and then present them at a rate of one every 2 seconds.

<trial example>
/ stimulustimes = [0=circle1; 2000=circle2; 4000=circle3; 6000=circle4; ...]
...
</trial>

where <shape circle1> is the largest circle, <shape circle2> is one linear "step" smaller, and so forth.

Alternatively, you can have a <trilal> lasting 2 seconds present a single circle <shape>, run that trial X amount of times, and decrease the <shape>'s size linearly /ontrialbegin:

<trial mytrial>
/ ontrialbegin = [values.stepcount += 1;]
/ ontrialbegin = [if (values.stepcount > 1) {
                        shape.circleshape.height -= 10px;
                        shape.circleshape.width -= 10px;
                        };
]
/ stimulusframes = [1=clearscreen, circleshape]
/ trialduration = 200
/ branch = [if (values.stepcount < values.nsteps) trial.mytrial]
</trial>

<shape circleshape>
/ shape = circle
/ color = red
/ size = (500px, 500px)
/ erase = false
</shape>

<values>
/ stepcount = 0
/ nsteps = 50
</values>

<block myblock>
/ trials = [1=mytrial]
</block>

(the trial duration in the above is set to only 200ms to make things go faster)

Nakayama Yao
Nakayama Yao
Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)
Group: Forum Members
Posts: 39, Visits: 230
Dave - Tuesday, October 10, 2017
Nakayama Yao - Tuesday, October 10, 2017
Hi, Dave
I am pretty new about how to program the following design, and wish to seek for some sample scripts from you:
 in inquisit, it uses "size" to define the area covered by the circle.
I wish to set a function between the size of the red circle (located at the center of the screen) s and the lapsed time t.
so as the presented time lapses, the size of the circle lineally shrinks.
such as t=2s.
Thank you in advance for your advice.





If you want to pull this off within a single <trial> element, you would actually define X amount of circular <shape>s, define their respective sizes, and then present them at a rate of one every 2 seconds.

<trial example>
/ stimulustimes = [0=circle1; 2000=circle2; 4000=circle3; 6000=circle4; ...]
...
</trial>

where <shape circle1> is the largest circle, <shape circle2> is one linear "step" smaller, and so forth.

Alternatively, you can have a <trilal> lasting 2 seconds present a single circle <shape>, run that trial X amount of times, and decrease the <shape>'s size linearly /ontrialbegin:

<trial mytrial>
/ ontrialbegin = [values.stepcount += 1;]
/ ontrialbegin = [if (values.stepcount > 1) {
                        shape.circleshape.height -= 10px;
                        shape.circleshape.width -= 10px;
                        };
]
/ stimulusframes = [1=clearscreen, circleshape]
/ trialduration = 200
/ branch = [if (values.stepcount < values.nsteps) trial.mytrial]
</trial>

<shape circleshape>
/ shape = circle
/ color = red
/ size = (500px, 500px)
/ erase = false
</shape>

<values>
/ stepcount = 0
/ nsteps = 50
</values>

<block myblock>
/ trials = [1=mytrial]
</block>

(the trial duration in the above is set to only 200ms to make things go faster)

Thank you, this one is really helpful:).
may I ask another question down here?
I wish to use mouse or touchscreen as response key.
So participants click the center of the screen (50,50), they will get 50 points.
I have noticed I can use the syntax like
<trial a>
/ ontrialend = [if(trial.a.){values.point=50}
But I don't know which one I should put after a in trial.a.
thank you;)





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
Nakayama Yao - Wednesday, October 11, 2017
Dave - Tuesday, October 10, 2017
Nakayama Yao - Tuesday, October 10, 2017
Hi, Dave
I am pretty new about how to program the following design, and wish to seek for some sample scripts from you:
 in inquisit, it uses "size" to define the area covered by the circle.
I wish to set a function between the size of the red circle (located at the center of the screen) s and the lapsed time t.
so as the presented time lapses, the size of the circle lineally shrinks.
such as t=2s.
Thank you in advance for your advice.





If you want to pull this off within a single <trial> element, you would actually define X amount of circular <shape>s, define their respective sizes, and then present them at a rate of one every 2 seconds.

<trial example>
/ stimulustimes = [0=circle1; 2000=circle2; 4000=circle3; 6000=circle4; ...]
...
</trial>

where <shape circle1> is the largest circle, <shape circle2> is one linear "step" smaller, and so forth.

Alternatively, you can have a <trilal> lasting 2 seconds present a single circle <shape>, run that trial X amount of times, and decrease the <shape>'s size linearly /ontrialbegin:

<trial mytrial>
/ ontrialbegin = [values.stepcount += 1;]
/ ontrialbegin = [if (values.stepcount > 1) {
                        shape.circleshape.height -= 10px;
                        shape.circleshape.width -= 10px;
                        };
]
/ stimulusframes = [1=clearscreen, circleshape]
/ trialduration = 200
/ branch = [if (values.stepcount < values.nsteps) trial.mytrial]
</trial>

<shape circleshape>
/ shape = circle
/ color = red
/ size = (500px, 500px)
/ erase = false
</shape>

<values>
/ stepcount = 0
/ nsteps = 50
</values>

<block myblock>
/ trials = [1=mytrial]
</block>

(the trial duration in the above is set to only 200ms to make things go faster)

Thank you, this one is really helpful:).
may I ask another question down here?
I wish to use mouse or touchscreen as response key.
So participants click the center of the screen (50,50), they will get 50 points.
I have noticed I can use the syntax like
<trial a>
/ ontrialend = [if(trial.a.){values.point=50}
But I don't know which one I should put after a in trial.a.
thank you;)





First you would put some stimulus at position 50/50 (i.e. the center of the screen), have your trial display that stimulus, and define it as a /validresponse. Let's call  that stimulus "thecenter" for the sake of example. Note: The stimulus need not be visible, but it can be if you wish.

<trial mytrial>
/ ontrialbegin = [values.stepcount += 1;]
/ ontrialbegin = [if (values.stepcount > 1) {
                        shape.circleshape.height -= 10px;
                        shape.circleshape.width -= 10px;
                        };
]
/ ontrialend = [
    if (trial.mytrial.response == "thecenter") values.points += 50;
]
/ validresponse = (thecenter, circleshape)
/ inputdevice = mouse
/ stimulusframes = [1=clearscreen, thecenter, circleshape, points]
/ trialduration = 2000
/ branch = [if (values.stepcount < values.nsteps) trial.mytrial]
</trial>

<shape circleshape>
/ shape = circle
/ color = red
/ size = (500px, 500px)
/ erase = false
</shape>

<text thecenter>
/ items = ("+")
/ position = (50%, 50%)
/ erase = false
</text>

<text points>
/ items = ("Points: <%values.points%>")
/ position = (50%, 10%)
/ erase = false
</text>

<values>
/ stepcount = 0
/ nsteps = 50
/ points = 0
</values>

<block myblock>
/ trials = [1=mytrial]
</block>

Hope this helps.

Nakayama Yao
Nakayama Yao
Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)
Group: Forum Members
Posts: 39, Visits: 230
Dave - Wednesday, October 11, 2017
Nakayama Yao - Wednesday, October 11, 2017
Dave - Tuesday, October 10, 2017
Nakayama Yao - Tuesday, October 10, 2017
Hi, Dave
I am pretty new about how to program the following design, and wish to seek for some sample scripts from you:
 in inquisit, it uses "size" to define the area covered by the circle.
I wish to set a function between the size of the red circle (located at the center of the screen) s and the lapsed time t.
so as the presented time lapses, the size of the circle lineally shrinks.
such as t=2s.
Thank you in advance for your advice.





If you want to pull this off within a single <trial> element, you would actually define X amount of circular <shape>s, define their respective sizes, and then present them at a rate of one every 2 seconds.

<trial example>
/ stimulustimes = [0=circle1; 2000=circle2; 4000=circle3; 6000=circle4; ...]
...
</trial>

where <shape circle1> is the largest circle, <shape circle2> is one linear "step" smaller, and so forth.

Alternatively, you can have a <trilal> lasting 2 seconds present a single circle <shape>, run that trial X amount of times, and decrease the <shape>'s size linearly /ontrialbegin:

<trial mytrial>
/ ontrialbegin = [values.stepcount += 1;]
/ ontrialbegin = [if (values.stepcount > 1) {
                        shape.circleshape.height -= 10px;
                        shape.circleshape.width -= 10px;
                        };
]
/ stimulusframes = [1=clearscreen, circleshape]
/ trialduration = 200
/ branch = [if (values.stepcount < values.nsteps) trial.mytrial]
</trial>

<shape circleshape>
/ shape = circle
/ color = red
/ size = (500px, 500px)
/ erase = false
</shape>

<values>
/ stepcount = 0
/ nsteps = 50
</values>

<block myblock>
/ trials = [1=mytrial]
</block>

(the trial duration in the above is set to only 200ms to make things go faster)

Thank you, this one is really helpful:).
may I ask another question down here?
I wish to use mouse or touchscreen as response key.
So participants click the center of the screen (50,50), they will get 50 points.
I have noticed I can use the syntax like
<trial a>
/ ontrialend = [if(trial.a.){values.point=50}
But I don't know which one I should put after a in trial.a.
thank you;)





First you would put some stimulus at position 50/50 (i.e. the center of the screen), have your trial display that stimulus, and define it as a /validresponse. Let's call  that stimulus "thecenter" for the sake of example. Note: The stimulus need not be visible, but it can be if you wish.

<trial mytrial>
/ ontrialbegin = [values.stepcount += 1;]
/ ontrialbegin = [if (values.stepcount > 1) {
                        shape.circleshape.height -= 10px;
                        shape.circleshape.width -= 10px;
                        };
]
/ ontrialend = [
    if (trial.mytrial.response == "thecenter") values.points += 50;
]
/ validresponse = (thecenter, circleshape)
/ inputdevice = mouse
/ stimulusframes = [1=clearscreen, thecenter, circleshape, points]
/ trialduration = 2000
/ branch = [if (values.stepcount < values.nsteps) trial.mytrial]
</trial>

<shape circleshape>
/ shape = circle
/ color = red
/ size = (500px, 500px)
/ erase = false
</shape>

<text thecenter>
/ items = ("+")
/ position = (50%, 50%)
/ erase = false
</text>

<text points>
/ items = ("Points: <%values.points%>")
/ position = (50%, 10%)
/ erase = false
</text>

<values>
/ stepcount = 0
/ nsteps = 50
/ points = 0
</values>

<block myblock>
/ trials = [1=mytrial]
</block>

Hope this helps.

Thank Dave, this script is of great help:)
I was trying to calculate the distance error between the (point) area I clicked by mouse and the location of the center in red target.
When i used trial.tap.reponsex and trial.tap.reponsey to record the location I clicked in data, it came out with very large number when i clicked the center of the screen. i guess it was recorded in terms of pixel?
whereas the location of the red target was defined in percentage. Is there a way to standardize those two and calculate the distance error?
Thank you in advance and i appreciate your time;)


 

Attachments
space1.iqx (457 views, 4.00 KB)
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
Nakayama Yao - Tuesday, October 17, 2017
Dave - Wednesday, October 11, 2017
Nakayama Yao - Wednesday, October 11, 2017
Dave - Tuesday, October 10, 2017
Nakayama Yao - Tuesday, October 10, 2017
Hi, Dave
I am pretty new about how to program the following design, and wish to seek for some sample scripts from you:
 in inquisit, it uses "size" to define the area covered by the circle.
I wish to set a function between the size of the red circle (located at the center of the screen) s and the lapsed time t.
so as the presented time lapses, the size of the circle lineally shrinks.
such as t=2s.
Thank you in advance for your advice.





If you want to pull this off within a single <trial> element, you would actually define X amount of circular <shape>s, define their respective sizes, and then present them at a rate of one every 2 seconds.

<trial example>
/ stimulustimes = [0=circle1; 2000=circle2; 4000=circle3; 6000=circle4; ...]
...
</trial>

where <shape circle1> is the largest circle, <shape circle2> is one linear "step" smaller, and so forth.

Alternatively, you can have a <trilal> lasting 2 seconds present a single circle <shape>, run that trial X amount of times, and decrease the <shape>'s size linearly /ontrialbegin:

<trial mytrial>
/ ontrialbegin = [values.stepcount += 1;]
/ ontrialbegin = [if (values.stepcount > 1) {
                        shape.circleshape.height -= 10px;
                        shape.circleshape.width -= 10px;
                        };
]
/ stimulusframes = [1=clearscreen, circleshape]
/ trialduration = 200
/ branch = [if (values.stepcount < values.nsteps) trial.mytrial]
</trial>

<shape circleshape>
/ shape = circle
/ color = red
/ size = (500px, 500px)
/ erase = false
</shape>

<values>
/ stepcount = 0
/ nsteps = 50
</values>

<block myblock>
/ trials = [1=mytrial]
</block>

(the trial duration in the above is set to only 200ms to make things go faster)

Thank you, this one is really helpful:).
may I ask another question down here?
I wish to use mouse or touchscreen as response key.
So participants click the center of the screen (50,50), they will get 50 points.
I have noticed I can use the syntax like
<trial a>
/ ontrialend = [if(trial.a.){values.point=50}
But I don't know which one I should put after a in trial.a.
thank you;)





First you would put some stimulus at position 50/50 (i.e. the center of the screen), have your trial display that stimulus, and define it as a /validresponse. Let's call  that stimulus "thecenter" for the sake of example. Note: The stimulus need not be visible, but it can be if you wish.

<trial mytrial>
/ ontrialbegin = [values.stepcount += 1;]
/ ontrialbegin = [if (values.stepcount > 1) {
                        shape.circleshape.height -= 10px;
                        shape.circleshape.width -= 10px;
                        };
]
/ ontrialend = [
    if (trial.mytrial.response == "thecenter") values.points += 50;
]
/ validresponse = (thecenter, circleshape)
/ inputdevice = mouse
/ stimulusframes = [1=clearscreen, thecenter, circleshape, points]
/ trialduration = 2000
/ branch = [if (values.stepcount < values.nsteps) trial.mytrial]
</trial>

<shape circleshape>
/ shape = circle
/ color = red
/ size = (500px, 500px)
/ erase = false
</shape>

<text thecenter>
/ items = ("+")
/ position = (50%, 50%)
/ erase = false
</text>

<text points>
/ items = ("Points: <%values.points%>")
/ position = (50%, 10%)
/ erase = false
</text>

<values>
/ stepcount = 0
/ nsteps = 50
/ points = 0
</values>

<block myblock>
/ trials = [1=mytrial]
</block>

Hope this helps.

Thank Dave, this script is of great help:)
I was trying to calculate the distance error between the (point) area I clicked by mouse and the location of the center in red target.
When i used trial.tap.reponsex and trial.tap.reponsey to record the location I clicked in data, it came out with very large number when i clicked the center of the screen. i guess it was recorded in terms of pixel?
whereas the location of the red target was defined in percentage. Is there a way to standardize those two and calculate the distance error?
Thank you in advance and i appreciate your time;)


 

> it came out with very large number when i clicked the center of the screen. i guess it was recorded in terms of pixel?

Yes, that is correct. X and Y coordinates are given in pixels.

> Is there a way to standardize those two and calculate the distance error?

Sure. To get from pixels to percentage you can simply divide by display.height (or display.canvasheight) and display.width (or display.canvaswidth) respectively. You can, in addition, use Inquisit's trigonometric functions if you need something more elaborate, such as calculating Euclidean distance. See e.g. the Spatial Delayed Response Task as an example of how this can be done: https://www.millisecond.com/download/library/spatialdelayedresponsetask/

To see the SDRT'S calculations on-screen, make sure to add the "debuginfo" to <trial point>'s /stimulusframes first:

<trial point>
...
/ stimulusframes = [1=clearscreen,fixationcross,cue,cursor, debuginfo]
...
</trial>

Hope this helps.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search