Millisecond Forums

get data X Y positions of a trail on inquisit 5

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

By jolimie971 - 4/4/2016

Hello,

I've seen that it's possible to draw a trail, but it is possible to get the x y coordinates in function of time ?

Thanks,
Mandy
By Dave - 4/4/2016

Possibly. See https://www.millisecond.com/forums/FindPost18175.aspx for an example and further links to alternative approaches.
By jolimie971 - 4/18/2016

Bonjour,
Thanks for the reply, it was exactly what I wanted except that I was wandering how to get the decimals values of x and y rather than interger mode ?
I do not know If I have to change the values function or the trial and how to do it.

<values>
/ x = 0px
/ y = 0px
/ mirrorx = 0.00
/ mirrory = 0.00
/ mousexpath = ""
/ mouseypath = ""
/ trialcount = 0
</values>

<expressions>
/ x = 1.00px*abs(values.x-(values.mirrorx*display.width))
/ y = 1.00px*abs(values.y-(values.mirrory*display.height))
</expressions>


<trial start>
/ stimulusframes = [1=clickhere]
/ validresponse = (lbuttondown)
/ ontrialend = [values.x=trial.start.responsex; values.y=trial.start.responsey]
/ branch = [trial.record]
/ recorddata = false
</trial>

<trial record>
/ ontrialbegin = [values.trialcount=values.trialcount+1]
/ stimulusframes = [1=dot, coordinates]
/ validresponse = (mousemove, lbuttondown, rbuttondown)
/ numframes = 1
/ ontrialend = [values.x=trial.record.responsex; values.y=trial.record.responsey]
/ ontrialend = [values.mousexpath=concat(concat(values.mousexpath, values.x)," ")]
/ ontrialend = [values.mouseypath=concat(concat(values.mouseypath, values.y)," ")]
/ ontrialend = [insert(counter.x, values.x, values.trialcount)]
/ ontrialend = [insert(counter.y, values.y, values.trialcount)]
/ ontrialend = [insert(counter.duration, trial.record.latency, values.trialcount)]
/ branch = [if(trial.record.response=="lbuttondown")trial.end]
/ branch = [if(trial.record.response=="rbuttondown")trial.pause]
/ branch = [if(trial.record.response=="mousemove")trial.record]
/ recorddata = false
</trial>

<trial pause>
/ stimulusframes = [1=coordinates]
/ validresponse = (mousemove, lbuttondown)
/ numframes = 1
/ ontrialend = [values.x=trial.pause.responsex; values.y=trial.pause.responsey]
/ branch = [if(trial.pause.response=="lbuttondown")trial.record else trial.pause]
/ recorddata = false
</trial>

<trial end>
/ stimulusframes = [1=blank, goodbye]
/ validresponse = (lbuttondown)
/ recorddata = true
</trial>

<trial playback>
/ ontrialbegin = [values.x=counter.x.selectedvalue; values.y=counter.y.selectedvalue]
/ stimulusframes = [1=dot, coordinates]
/ validresponse = (noresponse)
/ numframes = 1
/ trialduration = counter.duration.selectedvalue
/ branch = [if(counter.x.unselectedcount<=0)trial.end else trial.playback]
/ recorddata = false
</trial>

**************************************************************************************************************
**************************************************************************************************************
Stimulus Elements
**************************************************************************************************************
**************************************************************************************************************
<shape dot>
/ shape = circle
/ size = (3.00%, 4.00%)
/ color = (blue)
/ erase = false
/ hposition = expressions.x
/ vposition = expressions.y
</shape>
By Dave - 4/18/2016

> Thanks for the reply, it was exactly what I wanted except that I was wandering how to get the decimals values of x and y rather than interger
> mode?

x and y coordinates are given in terms of pixels, which are always integers. They range from 0 (the upper left corner of your display) to the display's width-1 and height-1 respectively. I.e., suppose you have a 800 x 600 pixel display, then the x coordinates would range from 0 to 799 horizontally, and the y coordinates from 0 to 599 vertically in one-pixel increments.

Given the above, I'm honestly not sure what you mean by "decimal values of x and y". Please explain.