visiomode.stimuli.variable_contrast_grating.VariableContrastGrating¶
- class visiomode.stimuli.variable_contrast_grating.VariableContrastGrating(background, contrasts=(0, 0.06, 0.12, 0.25, 0.5, 1.0), **kwargs)¶
Bases:
Grating
- __init__(background, contrasts=(0, 0.06, 0.12, 0.25, 0.5, 1.0), **kwargs)¶
Methods
__init__
(background[, contrasts])add
(*groups)add the sprite to groups
add_internal
(group)For adding this sprite to a group internally.
alive
()does the sprite belong to any groups
collision
(x, y)draw
()Regenerate stimuli for a fresh trial
get_child
(child_id)Return all inheriting children as a list.
"Return the human-readable, space-separated name for the class.
Returns a dictionary of stimulus attributes.
get_form
()Generate lowercase identifier for the class.
groups
()list of Groups that contain this Sprite
hide
()kill
()remove the Sprite from all Groups
remove
(*groups)remove the sprite from groups
remove_internal
(group)For removing this sprite from a group internally.
set_centerx
(centerx)show
()sinusoid
(width, height, period[, contrast])update
([timedelta])method to control sprite behavior
Attributes
form_path
Dynamic, read only property for protected _layer attribute.
- classmethod _sinusoid(width: int, height: int, period: int)¶
Generate a sinusoid array in numpy.
- Parameters
width –
height –
period –
Returns:
- add(*groups)¶
add the sprite to groups
Sprite.add(*groups): return None
Any number of Group instances can be passed as arguments. The Sprite will be added to the Groups it is not already a member of.
- add_internal(group)¶
For adding this sprite to a group internally.
- Parameters
group – The group we are adding to.
- alive()¶
does the sprite belong to any groups
Sprite.alive(): return bool
Returns True when the Sprite belongs to one or more Groups.
- generate_new_trial()¶
Regenerate stimuli for a fresh trial
- classmethod get_children()¶
Return all inheriting children as a list.
- classmethod get_common_name()¶
“Return the human-readable, space-separated name for the class.
- get_details()¶
Returns a dictionary of stimulus attributes.
- classmethod get_identifier()¶
Generate lowercase identifier for the class.
- groups()¶
list of Groups that contain this Sprite
Sprite.groups(): return group_list
Returns a list of all the Groups that contain this Sprite.
- kill()¶
remove the Sprite from all Groups
Sprite.kill(): return None
The Sprite is removed from all the Groups that contain it. This won’t change anything about the state of the Sprite. It is possible to continue to use the Sprite after this method has been called, including adding it to Groups.
- property layer¶
Dynamic, read only property for protected _layer attribute. This will get the _layer variable if it exists.
If you try to get it before it is set it will raise an attribute error.
Layer property can only be set before the sprite is added to a group, after that it is read only and a sprite’s layer in a group should be set via the group’s change_layer() method.
- Returns
layer as an int, or raise AttributeError.
- remove(*groups)¶
remove the sprite from groups
Sprite.remove(*groups): return None
Any number of Group instances can be passed as arguments. The Sprite will be removed from the Groups it is currently a member of.
- remove_internal(group)¶
For removing this sprite from a group internally.
- Parameters
group – The group we are removing from.
- update(timedelta=0)¶
method to control sprite behavior
Sprite.update(*args, **kwargs):
The default implementation of this method does nothing; it’s just a convenient “hook” that you can override. This method is called by Group.update() with whatever arguments you give it.
There is no need to use this method if not using the convenience method by the same name in the Group class.