![]() :class:`.ShapeStim` for more documentation/examples on how to set position. fieldPos : array_like Specifying the location of the centre of the stimulus using a :ref:`x,y-pair `. a GratingStim, TextStim.)!! DotStim assumes that the element uses pixels as units. element : object This can be any object that has a ``.draw()`` method and a ``.setPos()`` method (e.g. For 'walk' noise dots vary their direction every frame, but keep a constant speed. For 'direction' noise dots follow a random, but constant direction. For 'position', noise dots take a random position every frame. noiseDots : str Determines the behaviour of the noise dots, taken directly from Scase et al's (1996) categories. This corresponds to Scase et al's (1996) categories of RDK. If 'different' then the choice of which is signal and which is noise gets randomised on each frame. signalDots : str If 'same' then the signal and noise dots are constant. If changed while drawing, the lives of all dots will be randomly initiated again. Dot lives are initiated randomly from a uniform distribution from 0 to dotLife. dotLife : int Number of frames each dot lives for (-1=infinite). dotSize : float Dot size specified in pixels (overridden if `element` is specified). If changed while drawing, dots outside new envelope will be respawned. Defines the envelope used to present the dots. Attributes - fieldShape : str *'sqr'* or 'circle'. The maximum number of dots that can be drawn is limited by system performance. If further customisation is required, then the DotStim should be subclassed and its _update_dotsXY and _newDotsXY methods overridden. For further detail about the different configurations see :ref:`dots` in the Builder Components section of the documentation. The default settings (as of v1.70.00) is for the noise dots to have identical velocity but random direction and signal dots remain the 'same' (once a signal dot, always a signal dot). All six possible motions they describe can be generated with appropriate choices of the `signalDots` (which determines whether signal dots are the 'same' or 'different' on each frame), `noiseDots` (which determines the locations of the noise dots on each frame) and the `dotLife` (which determines for how many frames the dot will continue before being regenerated). For a review of possible types and their pros and cons see Scase, Braddick & Raymond (1996). This single class can be used to generate a wide variety of dot motion types. class DotStim ( BaseVisualStim, ColorMixin, ContainerMixin ): """This stimulus class defines a field of dots with an update rule that determines how they change on every call to the. gl import psychopy # so we can get the _path_ from psychopy import logging # tools must only be imported *after* event or MovieStim breaks on win32 # (JWP has no idea why!) from import attributeSetter, setAttribute from import val2array from import ( BaseVisualStim, ColorMixin, ContainerMixin, WindowMixin ) from psychopy.layout import Size import numpy as np # some constants _piOver2 = np. options = False import ctypes GL = pyglet. # Shaders will work but require OpenGL2.0 drivers AND PyOpenGå…ƒ.0+ import pyglet pyglet. ![]() # Ensure setting pyglet.options to False is done prior to any # other calls to pyglet or pyglet submodules, otherwise it may not get picked # up by the pyglet GL engine and have no effect. # Provide a visible wrapper function to refresh all the dot locations so that # the whole field can be more easily refreshed between trials. # Update the dot direction immediately for 'walk' as otherwise when the # coherence varies some signal dots will inherit the random directions of # previous walking dots. This stops the concentration of dots at # one side of field when lifetime is long. # Replaces out of bounds but still live dots at opposite edge of aperture # instead of randomly within the field. # Distributed under the terms of the GNU General Public License (GPL). """ # Part of the PsychoPy library # Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2022 Open Science Tools Ltd. #!/usr/bin/env python # -*- coding: utf-8 -*- """This stimulus class defines a field of dots with an update rule that determines how they change on every call to the.
0 Comments
Leave a Reply. |