psychopy.org | Reference | Downloads | Github

Centering and decentering task

I am trying to build an experiment in psychopy that is called decentering/centering task. Participants see a face and have the Task to move the eye (we got pictures for many angles in 1° steps). in the centering task they start with a person looking to the right or left (30°). Participants are using a slider to move the persons eyes to that point where they have the impression the face is looking them in the eyes (lets say 10°). So with every step they ar moving the slider, the picture should change to the specific picture. In the other task it is just vice versa.
I watched many youtube-videos and tried to figure out a way to realize that task in Psychopy, but till now I didn´t find a way.
Does any of you have an idea to implement that task in Psychopy, I would be so thankful for any ideas you have!

You need to tell us how you expect to control the image. e.g. if you have many image files, do they have a standard naming format containing the angle and direction information so that they can be referred to programatically?

Thanks for your quick answer!
Yes, we got 41 pictures, each with a specific name, starten from 20°left , 19°left… till 20°right (please ignore the 30° in the first description, that just depends on the distance). With the help of that I am able to referre to them.
So participants are seeing a picture in which the gaze angle is changing, depending on what position particiapants are puting the curser on the slider.
Do you have any idea how to implement that in Psychopy, so far I just tried it in the builder view.
Thanks a lot in advance!

Like I said, we need to know the naming scheme for your files. But in essence, you would just construct a string that takes the current value of the slider and concatenates it with the other elements of your filename (e.g. a '.png' suffix), and uses that to update the texture for an image stimulus.

This could probably be done with a line or two of code inserted into the “Every frame” tab of a code component so that it runs continuously to update the stimulus dynamically in response to the changing value of the slider.

Thanks again! Is there an example of a string that takes the current value of the slider and concatenates it with the other elements of the filename, and uses that to update the texture for an image stimulus?