Package psychopy :: Module visual :: Class RadialStim
[frames] | no frames]

Class RadialStim

source code


Stimulus object for drawing radial stimuli, like an annulus, a rotating wedge, a checkerboard etc...

Ideal for fMRI retinotopy stimuli!

Many of the capabilities are built on top of the PatchStim.

This stimulus is still relatively new and I'm finding occasional gliches. it also takes longer to draw than a typical PatchStim, so not recommended for tasks where high frame rates are needed.

Instance Methods
 
__init__(self, win, tex='sqrXsqr', mask='none', units='', pos=(0.0, 0.0), size=(1.0, 1.0), radialCycles=3, angularCycles=4, radialPhase=0, angularPhase=0, ori=0.0, texRes=64, angularRes=100, visibleWedge=(0, 360), rgb=None, color=(1.0, 1.0, 1.0), colorSpace='rgb', dkl=None, lms=None, contrast=1.0, opacity=1.0, depth=0, rgbPedestal=(0.0, 0.0, 0.0), interpolate=False)
:Parameters:
source code
 
setSize(self, value, operation='')
Set the stimulus size [X,Y] in the specified (or inheritted) units
source code
 
setAngularCycles(self, value, operation='')
set the number of cycles going around the stimulus
source code
 
setRadialCycles(self, value, operation='')
set the number of texture cycles from centre to periphery
source code
 
setAngularPhase(self, value, operation='')
set the angular phase of the texture
source code
 
setRadialPhase(self, value, operation='')
set the radial phase of the texture
source code
 
draw(self, win=None)
Draw the stimulus in its relevant window.
source code
 
setTex(self, value) source code
 
setMask(self, value) source code
 
__del__(self) source code
 
clearTextures(self)
Clear the textures associated with the given stimulus.
source code
 
setContrast(self, value, operation='') (Inherited from psychopy.visual.PatchStim) source code
 
setPhase(self, value, operation='') (Inherited from psychopy.visual.PatchStim) source code
 
setSF(self, value, operation='') (Inherited from psychopy.visual.PatchStim) source code

Inherited from _BaseVisualStim: setColor, setContr, setDKL, setDepth, setLMS, setOpacity, setOri, setPos, setRGB, setUseShaders

Method Details

__init__(self, win, tex='sqrXsqr', mask='none', units='', pos=(0.0, 0.0), size=(1.0, 1.0), radialCycles=3, angularCycles=4, radialPhase=0, angularPhase=0, ori=0.0, texRes=64, angularRes=100, visibleWedge=(0, 360), rgb=None, color=(1.0, 1.0, 1.0), colorSpace='rgb', dkl=None, lms=None, contrast=1.0, opacity=1.0, depth=0, rgbPedestal=(0.0, 0.0, 0.0), interpolate=False)
(Constructor)

source code 

:Parameters:

    win :
        a :class:`~psychopy.visual.Window` object (required)
    tex :
        The texture forming the image
        
        - 'sqrXsqr', 'sinXsin', 'sin','sqr',None
        - or the name of an image file (most formats supported)
        - or a numpy array (1xN or NxN) ranging -1:1
        
    mask :
        Unlike the mask in the PatchStim, this is a 1-D mask dictating the behaviour
        from the centre of the stimulus to the surround.            
    units : **None**, 'norm', 'cm', 'deg' or 'pix'  
        If None then the current units of the :class:`~psychopy.visual.Window` will be used. 
        See :ref:`units` for explanation of other options.
    pos :
        a tuple (0.0,0.0) or a list [0.0,0.0] for the x and y of the centre of the stimulus.
        Stimuli can be position beyond the window!
    size :
        a tuple (0.5,0.5) or a list [0.5,0.5] for the x and y
        OR a single value (which will be applied to x and y).
        Sizes can be negative and stimuli can extend beyond the window.
    ori : 
        orientation of stimulus in degrees.
    texRes : (default= *128* )
        resolution of the texture (if not loading from an image file)
    angularRes : (default= *100* )
        100, the number of triangles used to make the sti
    radialPhase :
        the phase of the texture from the centre to the perimeter
        of the stimulus
    angularPhase : 
        the phase of the texture around the stimulus
    rgb :
        a tuple (1.0,1.0, 1.0) or a list [1.0,1.0, 1.0]
        or a single value (which will be applied to all guns).
        RGB vals are applied to simple textures and to greyscale
        image files but not to RGB images.

        **NB** units range -1:1 (so 0.0 is GREY). See :ref:`rgb` for further info.

    dkl : a tuple (45.0,90.0, 1.0) or a list [45.0,90.0, 1.0]
        specifying the coordinates of the stimuli in cone-opponent
        space (Derrington, Krauskopf, Lennie 1984). See :ref:`dkl` for further info.
        Triplets represent [elevation, azimuth, magnitude].
        Note that the monitor must be calibrated for this to be
        accurate (if not, example phosphors from a Sony Trinitron
        CRT will be used).
    lms : a tuple (0.5, 1.0, 1.0) or a list [0.5, 1.0, 1.0]
        specifying the coordinates of the stimuli in cone space
        Triplets represent relative modulation of each cone [L, M, S].
        See :ref:`lms` for further info.
        Note that the monitor must be calibrated for this to be
        accurate (if not, example phosphors from a Sony Trinitron
        CRT will be used).
    contrast : (default= *1.0* )
        How far the stimulus deviates from the middle grey.
        Contrast can vary -1:1 (this is a multiplier for the
        values given in the color description of the stimulus)
    opacity :
        1.0 is opaque, 0.0 is transparent
    depth :
        This can potentially be used (not tested!) to choose which
        stimulus overlays which. (more negative values are nearer).
        At present the window does not do perspective rendering
        but could do if that's really useful(?!)

Overrides: _BaseVisualStim.__init__

setSize(self, value, operation='')

source code 
Set the stimulus size [X,Y] in the specified (or inheritted) units
Overrides: _BaseVisualStim.setSize
(inherited documentation)

draw(self, win=None)

source code 

Draw the stimulus in its relevant window. You must call this method after every MyWin.flip() if you want the stimulus to appear on that frame and then update the screen again.

If win is specified then override the normal window of this stimulus.

Overrides: _BaseVisualStim.draw

setTex(self, value)

source code 
Overrides: PatchStim.setTex

setMask(self, value)

source code 
Overrides: PatchStim.setMask

__del__(self)
(Destructor)

source code 
Overrides: PatchStim.__del__

clearTextures(self)

source code 
Clear the textures associated with the given stimulus. As of v1.61.00 this is called automatically during garbage collection of your stimulus, so doesn't need calling explicitly by the user.
Overrides: PatchStim.clearTextures