Get coordinates of image corners

Dear Forum

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!

Hi,

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:

  1. create another exp that presents just the image - one image is enough if they all occupy the same space. No stop duration
  2. put it in a loop that will run 4 times
  3. add a mouse component
  4. 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.
  5. run the exp and in each trial click one of the four corners.
  6. the results will show you the coordinates of the corners of the square and hence the coordinates of the ROI
  7. repeat for the other three corners of the image
  8. 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
Happy
roi.psyexp (12.5 KB)