Millisecond Forums

Figuring out what the coordinates of a click map onto

https://forums.millisecond.com/Topic27736.aspx

By nc - 9/10/2019

I have an expert in which I recorded the x and y coordinates of a click with the following code:

<values>
/x = 0
/y = 0
</values

then, for the relevant trials, I added in the following code:

/ ontrialend = [
values.x=trial.excited.responsex;
values.y=trial.excited.responsey
]

My question is this: How can I figure out what those values mapped onto? That is, I have a data file that now gives me x and y coordinates, but how do I figure out what those x and y coordinates are relative to what else was on the screen? The numbers are of course useful in and of themselves, but I'd really like to know where people generally clicked (e.g., "near the red circle") Is there a way for me to visualize where people clicked using these values?
By Dave - 9/10/2019

nc - 9/10/2019
I have an expert in which I recorded the x and y coordinates of a click with the following code:

<values>
/x = 0
/y = 0
</values

then, for the relevant trials, I added in the following code:

/ ontrialend = [
values.x=trial.excited.responsex;
values.y=trial.excited.responsey
]

My question is this: How can I figure out what those values mapped onto? That is, I have a data file that now gives me x and y coordinates, but how do I figure out what those x and y coordinates are relative to what else was on the screen? The numbers are of course useful in and of themselves, but I'd really like to know where people generally clicked (e.g., "near the red circle") Is there a way for me to visualize where people clicked using these values?

If you want to know what these coordinates mean relative to other objects that are presented on the screen, you obviously need to log those other objects' coordinates as well. As for visualizing things, you can have the script create screen captures. https://www.millisecond.com/support/docs/v5/html/language/attributes/screencapture.htm
By nc - 9/10/2019

Dave - 9/10/2019
nc - 9/10/2019
I have an expert in which I recorded the x and y coordinates of a click with the following code:

<values>
/x = 0
/y = 0
</values

then, for the relevant trials, I added in the following code:

/ ontrialend = [
values.x=trial.excited.responsex;
values.y=trial.excited.responsey
]

My question is this: How can I figure out what those values mapped onto? That is, I have a data file that now gives me x and y coordinates, but how do I figure out what those x and y coordinates are relative to what else was on the screen? The numbers are of course useful in and of themselves, but I'd really like to know where people generally clicked (e.g., "near the red circle") Is there a way for me to visualize where people clicked using these values?

If you want to know what these coordinates mean relative to other objects that are presented on the screen, you obviously need to log those other objects' coordinates as well. As for visualizing things, you can have the script create screen captures. https://www.millisecond.com/support/docs/v5/html/language/attributes/screencapture.htm

That makes sense. But, if I already have a bunch of data (i.e., coordinates saved from prior participants), and hadn't used the screen capture feature you pointed me to, is there a way for me to visualize where those coordinates meant relative to the screen?

One thing I was trying to do was write a trial in which I would program an object to appear at the exact coordinates that prior participants had clicked -- the problem is that when I use the /position=(x,y) feature, it seems to take in values that correspond to percentage of screen taken up, and not in reference to the scale used to generate the x- and y-coordinates of participants' clicks. Is there a way to recover the visualization of where people clicked?
By Dave - 9/10/2019

nc - 9/10/2019
Dave - 9/10/2019
nc - 9/10/2019
I have an expert in which I recorded the x and y coordinates of a click with the following code:

<values>
/x = 0
/y = 0
</values

then, for the relevant trials, I added in the following code:

/ ontrialend = [
values.x=trial.excited.responsex;
values.y=trial.excited.responsey
]

My question is this: How can I figure out what those values mapped onto? That is, I have a data file that now gives me x and y coordinates, but how do I figure out what those x and y coordinates are relative to what else was on the screen? The numbers are of course useful in and of themselves, but I'd really like to know where people generally clicked (e.g., "near the red circle") Is there a way for me to visualize where people clicked using these values?

If you want to know what these coordinates mean relative to other objects that are presented on the screen, you obviously need to log those other objects' coordinates as well. As for visualizing things, you can have the script create screen captures. https://www.millisecond.com/support/docs/v5/html/language/attributes/screencapture.htm

That makes sense. But, if I already have a bunch of data (i.e., coordinates saved from prior participants), and hadn't used the screen capture feature you pointed me to, is there a way for me to visualize where those coordinates meant relative to the screen?

One thing I was trying to do was write a trial in which I would program an object to appear at the exact coordinates that prior participants had clicked -- the problem is that when I use the /position=(x,y) feature, it seems to take in values that correspond to percentage of screen taken up, and not in reference to the scale used to generate the x- and y-coordinates of participants' clicks. Is there a way to recover the visualization of where people clicked?

> But, if I already have a bunch of data (i.e., coordinates saved from prior participants), and hadn't used the screen capture feature you pointed me to, is there a way for me to visualize where those coordinates meant relative to the screen?

If you didn't log the relevant objects' positions and didn't log or don't know the resolution of the screen used, then no.

> the problem is that when I use the /position=(x,y) feature, it seems to take in values that correspond to percentage of screen taken up

It assumes percentages by default. You need to supply the unit (here:pixels) if you want something else.

Compare:

<values>
/ x = 30
/ y = 80
</values>

<trial example>
/ stimulusframes = [1=stimulus]
/ validresponse = (57)
</trial>

<text stimulus>
/ items = ("<%values.x%>,<%values.y%>")
/ hposition = values.x
/ vposition = values.y
</text>

Versus:

<values>
/ x = 30
/ y = 80
</values>

<trial example>
/ stimulusframes = [1=stimulus]
/ validresponse = (57)
</trial>

<text stimulus>
/ items = ("<%values.x%>,<%values.y%>")
/ hposition = 1px*values.x
/ vposition = 1px*values.y
</text>
By nc - 9/11/2019

Dave - 9/11/2019
nc - 9/10/2019
Dave - 9/10/2019
nc - 9/10/2019
I have an expert in which I recorded the x and y coordinates of a click with the following code:

<values>
/x = 0
/y = 0
</values

then, for the relevant trials, I added in the following code:

/ ontrialend = [
values.x=trial.excited.responsex;
values.y=trial.excited.responsey
]

My question is this: How can I figure out what those values mapped onto? That is, I have a data file that now gives me x and y coordinates, but how do I figure out what those x and y coordinates are relative to what else was on the screen? The numbers are of course useful in and of themselves, but I'd really like to know where people generally clicked (e.g., "near the red circle") Is there a way for me to visualize where people clicked using these values?

If you want to know what these coordinates mean relative to other objects that are presented on the screen, you obviously need to log those other objects' coordinates as well. As for visualizing things, you can have the script create screen captures. https://www.millisecond.com/support/docs/v5/html/language/attributes/screencapture.htm

That makes sense. But, if I already have a bunch of data (i.e., coordinates saved from prior participants), and hadn't used the screen capture feature you pointed me to, is there a way for me to visualize where those coordinates meant relative to the screen?

One thing I was trying to do was write a trial in which I would program an object to appear at the exact coordinates that prior participants had clicked -- the problem is that when I use the /position=(x,y) feature, it seems to take in values that correspond to percentage of screen taken up, and not in reference to the scale used to generate the x- and y-coordinates of participants' clicks. Is there a way to recover the visualization of where people clicked?

> But, if I already have a bunch of data (i.e., coordinates saved from prior participants), and hadn't used the screen capture feature you pointed me to, is there a way for me to visualize where those coordinates meant relative to the screen?

If you didn't log the relevant objects' positions and didn't log or don't know the resolution of the screen used, then no.

> the problem is that when I use the /position=(x,y) feature, it seems to take in values that correspond to percentage of screen taken up

It assumes percentages by default. You need to supply the unit (here:pixels) if you want something else.

Compare:

<values>
/ x = 30
/ y = 80
</values>

<trial example>
/ stimulusframes = [1=stimulus]
/ validresponse = (57)
</trial>

<text stimulus>
/ items = ("<%values.x%>,<%values.y%>")
/ hposition = values.x
/ vposition = values.y
</text>

Versus:

<values>
/ x = 30
/ y = 80
</values>

<trial example>
/ stimulusframes = [1=stimulus]
/ validresponse = (57)
</trial>

<text stimulus>
/ items = ("<%values.x%>,<%values.y%>")
/ hposition = 1px*values.x
/ vposition = 1px*values.y
</text>

Thank you. That makes sense. A follow up question:

"If you didn't log the relevant objects' positions and didn't log or don't know the resolution of the screen used, then no."
- What do you mean by "log the relevant objects' positions"? Aren't the relevant objects' positions already defined by the experiment script?

To make things more concrete: We showed people a silhouette of a person. We'd like to know where on the silhouette people clicked (e.g., the head? the arms?). I have the size and position of the silhouette, the x,y coordinates of the click, and I can find out the screen resolution that was used. Is there a way to recover the data for participants for whom I didn't set up ccreencaptures?
By Dave - 9/11/2019

nc - 9/11/2019
Dave - 9/11/2019
nc - 9/10/2019
Dave - 9/10/2019
nc - 9/10/2019
I have an expert in which I recorded the x and y coordinates of a click with the following code:

<values>
/x = 0
/y = 0
</values

then, for the relevant trials, I added in the following code:

/ ontrialend = [
values.x=trial.excited.responsex;
values.y=trial.excited.responsey
]

My question is this: How can I figure out what those values mapped onto? That is, I have a data file that now gives me x and y coordinates, but how do I figure out what those x and y coordinates are relative to what else was on the screen? The numbers are of course useful in and of themselves, but I'd really like to know where people generally clicked (e.g., "near the red circle") Is there a way for me to visualize where people clicked using these values?

If you want to know what these coordinates mean relative to other objects that are presented on the screen, you obviously need to log those other objects' coordinates as well. As for visualizing things, you can have the script create screen captures. https://www.millisecond.com/support/docs/v5/html/language/attributes/screencapture.htm

That makes sense. But, if I already have a bunch of data (i.e., coordinates saved from prior participants), and hadn't used the screen capture feature you pointed me to, is there a way for me to visualize where those coordinates meant relative to the screen?

One thing I was trying to do was write a trial in which I would program an object to appear at the exact coordinates that prior participants had clicked -- the problem is that when I use the /position=(x,y) feature, it seems to take in values that correspond to percentage of screen taken up, and not in reference to the scale used to generate the x- and y-coordinates of participants' clicks. Is there a way to recover the visualization of where people clicked?

> But, if I already have a bunch of data (i.e., coordinates saved from prior participants), and hadn't used the screen capture feature you pointed me to, is there a way for me to visualize where those coordinates meant relative to the screen?

If you didn't log the relevant objects' positions and didn't log or don't know the resolution of the screen used, then no.

> the problem is that when I use the /position=(x,y) feature, it seems to take in values that correspond to percentage of screen taken up

It assumes percentages by default. You need to supply the unit (here:pixels) if you want something else.

Compare:

<values>
/ x = 30
/ y = 80
</values>

<trial example>
/ stimulusframes = [1=stimulus]
/ validresponse = (57)
</trial>

<text stimulus>
/ items = ("<%values.x%>,<%values.y%>")
/ hposition = values.x
/ vposition = values.y
</text>

Versus:

<values>
/ x = 30
/ y = 80
</values>

<trial example>
/ stimulusframes = [1=stimulus]
/ validresponse = (57)
</trial>

<text stimulus>
/ items = ("<%values.x%>,<%values.y%>")
/ hposition = 1px*values.x
/ vposition = 1px*values.y
</text>

Thank you. That makes sense. A follow up question:

"If you didn't log the relevant objects' positions and didn't log or don't know the resolution of the screen used, then no."
- What do you mean by "log the relevant objects' positions"? Aren't the relevant objects' positions already defined by the experiment script?

To make things more concrete: We showed people a silhouette of a person. We'd like to know where on the silhouette people clicked (e.g., the head? the arms?). I have the size and position of the silhouette, the x,y coordinates of the click, and I can find out the screen resolution that was used. Is there a way to recover the data for participants for whom I didn't set up ccreencaptures?

> - What do you mean by "log the relevant objects' positions"? Aren't the relevant objects' positions already defined by the experiment script?

That entirely depends on the respective script. In many scripts positions of on-screen objects will be randomized on a per-trial basis, for example, and if you didn't log where a given object ended up in a given trial, you have no way of knowing where it was. I know nothing about what your script did or did not do in that regard, nor do I know what you did or did not decide to log.

> I have the size and position of the silhouette, the x,y coordinates of the click, and I can find out the screen resolution that was used. Is there a way to recover the data for participants for whom I didn't set up ccreencaptures?

If you have all that information, what data is there to recover?