Visual#
The psychos.visual module provides tools to easily create, display, and control visual stimuli, supporting precise control over timing, appearance, and spatial configuration for behavioral experiments.
Window#
A Pyglet-based window class used to display, contain, and refresh visual stimuli during experiments.
|
Custom window for displaying visual elements. |
Retrieve the current default window. |
Visual Stimuli#
Basic building blocks with predefined and parametrizable visual stimuli to easily create behavioral experiments.
|
A class to represent text in a Pyglet window using a Label component. |
|
A class to display an image in a Pyglet window using the Sprite component. |
|
|
|
|
|
A Gabor stimulus for psychophysical experiments. |
|
A class to display an image in a Pyglet window using the Sprite component. |
|
A circle shape that can be drawn on the screen. |
|
Interactive slider widget for Pyglet windows. |
Units system#
Different unit systems to configure the sizes and positions of visual stimuli within the window (e.g., pixels, centimeters, visual degrees, screen percentage, etc.). Most units are transparently integrated into windows and stimuli, but direct access to these classes is provided for custom cases or defining new unit types.
|
Abstract base class for different unit systems that transform normalized or other unit types into pixel values. |
|
Pixel unit system. |
A unit system that normalizes coordinates and sizes with respect to the window dimensions. |
|
Percentage unit system. |
|
|
VW (viewport width) unit system. |
|
VH (viewport height) unit system. |
|
Centimeter (cm) unit system. |
|
Viewport Diagonal (vd) unit system. |
|
Millimeter (mm) unit system. |
|
Points (pt) unit system. |
|
Degrees of visual angle (deg) unit system. |
|
Inches (in) unit system. |
Synthetic Stimuli#
Utility functions for creating synthetic stimuli, such as Gabor patches or scaled textures, useful for generating precise visual stimuli programmatically.
|
Generate a 2D Gabor patch as a numpy array (grayscale), with an optional Gaussian envelope. |
|
Generate a 3D (color) Gabor patch as a numpy array by mapping a grayscale 2D Gabor (computed via gabor_2d) into RGB values using a colormap. |
|
Rescale a numpy array based on the specified method. |