Coordinates python inline script
Hello, I encountered a really confusing phenomenon. While creating a new experiment, I coded a fixation check for eyetracking purposes using an inline script. I am using the newest OpenSesame version (3.3.2) and I figured, that you cannot disable or enable uniform coordinates any longer. I went forward assuming that inside the inline script 0/0 is at the top left corner. It worked just fine. Then I isolated the inline script to save it for further experiments. When I run the isolated version, the fixation dot, that is supposed to be in the middle, is now at the bottom right corner! It seems that in this version 0/0 is in the middle of the screen. How is that possible? It's the exact same code and I set the resolution in both versions to 1024 x 768 and used the same backend (psycho_legacy).
I attached the isolated version.

Comments
It seems to be a problem specific to my new version of OS on my home pc. I tried both OS files on my pc at work (v. 3.2.1 installed) and there the code that I attached previously works as you would it expect it to when playing with the enabling or disabling of uniform coordinates.
Hi Christina,
As is correctly described in the comments in the beginning of your script, Pygaze uses the top left as origin of the coordinate system (0,0), whereas the default in Opensesame is the middle of the screen (which apparently cannot be changed anymore). So, the code to produce the fixation dot should be drawing the cross at the bottom right corner of the screen.
I don't know why you would see the fixation dot in the middle of the screen in another version of the experiment, that shouldn't happen actually without changing anything.
Generally, I would recommend that you don't change Opensesame's coordinates, but instead just subtract half the width and height from the gaze position you sample from the eyelink.
Bottom line, this experiment that you attach works pretty much like I would expect it to work. If you can reproduce the behaviour of the other version, that would be weirder and I would like to look into that one to find out what is happening.
Hope this is clearer,
Eduard
Hello Eduard,
thank you for your reply. Good to know which behaviour shoud be expected from the code that I attached: fixation dot at the bottom right corner because the coordinate system of OS has 0/0 in its middle and I use var.width / 2 and var.height / 2 as x,y-coordinates for the dot. The confusion didn't end though.
I deleted OS from my home pc in order to re-install it (same version: 3.3). Now, it gets even wilder. Irrespective of the code (for uniform coordinates enabled or disabled => in the middle or 0/0 in top left corner; or uniform coordinates disabled and embedded in the above mentioned experimental code), the fixation dot stays in the middle.
Then I used the fixation check for enabled uniform coordinates (which assumes that 0/0 is in the middle) embedded in the experiment and the fixation dot appeared in the top left corner. So it seems, that here 0/0 in the inline script is in the top left corner.
Running the files, OS returns the following message in the command promt:
[2020-06-23 13:50:01,699:OpenScienceFramework:889:WARNING] Could not connect to cogsci.nl to get OSF settings: Error transferring http://cogsci.nl/dschreij/osfsettings.json - server replied: Not Found
[2020-06-23 13:50:01,699:OpenScienceFramework:890:WARNING] Using cached OSF settings instead
Could that connection problem be the reason for the odd behaviour? The files were created under an older version. Could it be, that the coordinate system used in the inline script (enabling / disabling uniform coordinates) is still written down in the code somewhere?
I attached all the files. I refer to enabled uniform coordinates with "FixCheckrelative" and to disabled unification with "FixCheckabsolute".
Thank you!
Sorry, here is "FixCheckabsolute" (unification disabled)
I'll look into your experiment later today. Sounds wild indeed. However, the error message that you see is unrelated and shouldn't worry you.
Hi Christina,
I am a little disappointed about the wildness of the situation. It behaves exactly like I would expect.
Your relative experiment has (0,0) defined as the middle of the screen. If uniform coordinates is enabled, the dot appears in the middle as it should; if it is disabled it appears in the top left corner.
Your absolute experiment has (width/2,height/2) defined as the middle of the screen. If uniform coordinates is enabled, the dot appears in the bottom right; if it is disabled it appears in the middle.
In both experiments, if I try the advanced dummy and move my mouse on the fixdot, it disappears (confirming I fixated).
So, precisely how it should be. All in all, I am confused what is happening. i don't see an issue.
I am on a linux system and did the conda installation, even though possible, I doubt that this is the issue.
Could you maybe make screenshots of the unexpected behavior? Together with the settings that make you think it is unexpected?
Eduard
I guess my whole point is that with 3.3.2 I cannot disable or enable uniform coordinates any longer. So the coordinate system in the inline script is fixed. You said that the coordinate system should have 0/0 in its middle. Under these circumstances the files that I sent you should behave differently because they assume different coordinate systems in the inline script (because they were originally intented to work with OS 3.2). But they don't, the results of the scripts are exactly the same, at least for my OS installation. They both produce the same behaviour: the fixation dot appears in the middle of the screen. It does what I want it to, but I wonder why (the coordinates in the scripts differ after all!).
Thank you for your patience.
Have a great day,
Christina
Hi Christina,
You can still disable them. You just don't have the checkbox anymore. But of you open the general script (in the same tab), one of the first parameters that is being set, is uniform coordinates, and when I tried it, it actually does change the coordinate system.
As for your two scripts. Even though you specified the middle differently each time (once with 0,0, and once with width/2,height/2), you also set uniform coordinates differently (first one true, second one false). Therefore they produce the same results. So if you went to the general settings tab, open the script, and change the uniform_coordinates parameter, you should observe a change.
Could you confirm?
Eduard
Thank you so much! That was the information that I needed. Yes, I can confirm!
Have a great day :)
top!