![]() autoLog = False # change after attribs are set self. _init_ ( name = name, autoLog = False ) # set self params self. remove ( 'self' ) super ( Aperture, self ). contains() option 2015, Thomas Emmerling added ImageStim option """ def _init_ ( self, win, size = 1, pos = ( 0, 0 ), anchor = None, ori = 0, nVert = 120, shape = 'circle', inverted = False, units = None, name = None, autoLog = None ): # what local vars are defined (these are the init params) for use by # _repr_ self. See demos/stimuli/aperture.py for example usage :Author: 2011, Yuri Spitsyn 2011, Jon Peirce added units options, Jeremy Gray added shape & orientation 2014, Jeremy Gray added. in a PNG file) will not be included in the mask shape. Note that transparent parts in the image (e.g. Supported shapes: * 'square', 'triangle', 'circle' or `None`: a polygon with appropriate nVerts will be used (120 for 'circle') * integer: a polygon with that many vertices will be used * list or numpy array (Nx2): it will be used directly as the vertices to a :class:`~` * a filename then it will be used to load and image as a :class:`~`. Once disabled, subsequent draw operations affect the whole screen as usual. When enabled, any drawing commands will only operate on pixels within the Aperture. class Aperture ( MinimalStim, ContainerMixin ): """Restrict a stimulus visibility area to a basic shape or list of vertices. gl import psychopy # so we can get the _path_ from psychopy import logging, core import psychopy.event # tools must only be imported *after* event or MovieStim breaks on win32 # (JWP has no idea why!) from import cm2pix, deg2pix, convertToPix from import attributeSetter, setAttribute from import BaseShapeStim from import ImageStim from import MinimalStim, ContainerMixin, WindowMixin import numpy from numpy import cos, sin, radians from nstants import STARTED, STOPPED # Shaders will work but require OpenGL2.0 drivers AND PyOpenGå…ƒ.0+ import pyglet pyglet. ![]() import os # 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. # 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 -*- """Restrict a stimulus visibility area to a basic shape or list of vertices.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |