Note: Sometimes the paths don't work and you have to play around with the brackets. Notice that the path to your image is put in between quotation marks. Once you have made a dedicated directory for your stimulus images, you can create a variable called path and give it the name of the subdirectory, that is, the path relative to your script file. You could also have you image files I the same directory as your psychopy script, but if you have many files that can become a mess. To keep things tidy, the recommendation is to create a subdirectory in the same directory where your psychopy script is saved. from psychopy import visual, eventįirst, it is important to tell psychopy where to look for our image files. Note that we are not importing the glob module from psychopy, we are directly importing it from python. However the images we will be using are saved somewhere in our computer, so we will also need a module for retrieving files from a directory. For now we will import the visual module and the event module from psychopy. To start enabling Python to work with an image, we must first import the right modules. This section will focus on teaching you how to insert images within your experiment screen, and how to manipulate their size and location on the screen. For example an experiment where participants have to evaluate emotion on images. Square stimuli in the periphery will, therefore, become more spaced apart but they will also get larger and rhomboid in the pixels that they occupy.Every now and then you will need to create experiments in PsychoP圓 that show images to the participants. ‘degFlat’: This corrects the calculations of degrees for flatness of the screen for each vertex of your stimuli. This means that an evenly spaced grid of visual stimuli will appear warped in position but will ‘degFlatPos’ : This accounts for flat screens in calculating position coordinates of visual stimuli but leaves size and spatial frequency uncorrected.
![psychopy picture size psychopy picture size](http://image.slidesharecdn.com/demographicsandpsychographics-130205082846-phpapp02/95/demographics-and-psychographics-6-638.jpg)
![psychopy picture size psychopy picture size](https://aws1.discourse-cdn.com/business7/uploads/psychopy/optimized/2X/8/83c49971f4e57de1d45ffe9ef62ea8721f36f83a_2_1035x646.png)
For most studies this form of calculation is preferred, as it does not result in a warped appearance of visual stimuli, but if you need greater precision at far eccentricities then choose one of the alternatives below. For moderate eccentricities the error is small (a 0.2% error in size calculation at 3 deg eccentricity) but grows as stimuli are placed further from the centre of the screen (a 2% error at 10 deg). This isn’t actually true for standard flat screens - a degree of visual angle at the edge of the screen spans more pixels because it is further from the eye. ‘deg’ : Most people using degrees of visual angle choose to make the assumption that a degree of visual angle spans the same number of pixels at all parts of the screen. There are actually three variants: ‘deg’, ‘degFlat’, and ‘degFlatPos’ Requires : information about the screen width in cm and pixels and the viewing distance in cm This is, of course, dependent on the distance that the participant sits from the screen as well as the screen itself, so make sure that this is controlled, and remember to change the setting in Monitor Center if the viewing distance changes. Use degrees of visual angle to set the size and location of the stimulus. For running an experiment it’s usually best to use something like ‘cm’ or ‘deg’ so that the stimulus is a fixed size irrespective of the monitor/window.įor all units, the centre of the screen is represented by coordinates (0,0), negative values mean down/left, positive values mean up/right.įor help understanding spatial units visually, try the builder demo “spatialUnits” under “Understanding PsychoPy” (version 2021.2).
![psychopy picture size psychopy picture size](https://aws1.discourse-cdn.com/business7/uploads/psychopy/optimized/2X/0/09db179348c0d5fe3fd7fba07a646af1f35328d2_2_1035x646.jpeg)
For conducting demos, the two normalised units (‘norm’ and ‘height’) are often handy because the stimulus scales naturally with the window size. Your choice of unit depends on the circumstances. In PsychoPy ®, after providing information about your monitor, via the Monitor Center, you can simply specify your stimulus in the unit of your choice and allow PsychoPy ® to calculate the appropriate pixel size for you. In most other systems you provide the stimuli at a fixed size and location in pixels, or percentage of the screen, and then have to calculate how many cm or degrees of visual angle that was. One of the key advantages of PsychoPy ® over many other experiment-building software packages is that stimuli can be described in a wide variety of real-world, device-independent units.