I have been working on implementing custom code in a PsychoPy experiment to measure attention on a picture with mouse movements—specifically, with images blurred, and with a clear circular region of high resolution that moves with the subject’s mouse position. I have been able to get this working in PsychoPy, but not in a way that is usable in Pavlovia. I am looking for a solution to this, because a method for using mouse-based attention tracking in online studies is in high demand in visual cognition labs, due to the pandemic interrupting in-person eyetracking data collection, and online webcam-based eyetracking not being sufficiently accurate for many researchers’ (e.g., ours and several colleagues’) purposes at present. Finding a solution that uses PsychoPy can make this methodology easier for psych researchers who may not have coding backgrounds to utilize as a module in their own studies.
The current implementation runs on a frame-by-frame basis, using the Python Imaging Library (PIL) to open each image as an RGB array, then creating a new image with a circle at the location of the mouse, saving that as an alpha layer and adding that alpha layer to the RGB array before saving it back as an image (creating an image with high-resolution content only in the circle, with the surrounding area transparent). This is then placed on top of a blurred version of the image in the PsychoPy builder view. Mouse location is saved to the output file. I can include the full code of this if anyone would like to take a look at it.
Kansas State University
Les Loschky’s Visual Cognition Lab