For the analysis of my eye tracking data I need the coordinates of my images.
I need the coordinates of the corners of the image in order to define my region of interest.
How can I calculate them?
All I have is the coordinate of the centre of the image and its size.
Thank you very much for your help!
If you have not already collected your data, why don’t you use the build-in component regions of interest?
If you have already collected data and each image occupies the same space, I would have done it in the following way:
- create another exp that presents just the image - one image is enough if they all occupy the same space. No stop duration
- put it in a loop that will run 4 times
- add a mouse component
- create a square and through trial and error place it in one of the corners. Or just enter a ROI component AND in the testing tab check the box next to debug mode.
- run the exp and in each trial click one of the four corners.
- the results will show you the coordinates of the corners of the square and hence the coordinates of the ROI
- repeat for the other three corners of the image
- finally it’s a matter of coding to find if a fixation landed within the coordinates of the ROI
I attach an exp that does this (along with a pic for testing). If you run it, the empty square is the polygon component and the red square is the ROI component
I hope this helps - others may have more elegant solutions
roi.psyexp (12.5 KB)