respyra.core.display¶
PsychoPy window creation, stimulus helpers, and real-time waveform rendering.
Provides thin wrappers around PsychoPy’s visual and monitors modules
that enforce project defaults ('height' units, black background,
pre-created stimuli). Also contains SignalTrace, a pre-allocated
ShapeStim for rendering scrolling waveforms without per-frame allocations,
and draw_signal_trace(), a convenience wrapper with automatic caching.
- respyra.core.display.create_monitor(name, width_cm, distance_cm, size_pix)[source]¶
Create, configure, and save a PsychoPy monitor profile.
- Parameters:
- Return type:
monitors.Monitor
- respyra.core.display.create_window(fullscr=False, monitor=None, units='height', color=(-1, -1, -1), **kwargs)[source]¶
Create a PsychoPy window with sensible project defaults.
- Parameters:
fullscr (bool) – Full-screen mode. Use False during development, True for data collection (enables VSync).
monitor (str or monitors.Monitor or None) – Monitor profile. A string is looked up by name; a Monitor object is used directly; None falls back to PsychoPy’s default.
units (str) – Coordinate system. ‘height’ works without calibration and keeps aspect-ratio-independent sizing.
color (tuple) – Background color in PsychoPy RGB (-1 to 1). Default is black.
**kwargs – Forwarded to
visual.Window(e.g.screen,size,allowGUI,waitBlanking).
- Return type:
visual.Window
- respyra.core.display.show_text_and_wait(win, text, key_list=None, color='white')[source]¶
Draw a text screen and block until the participant presses a key.
- class respyra.core.display.SignalTrace(win, trace_rect=(-0.8, -0.3, 0.8, 0.3), y_range=(0, 50), color='green', line_width=2.0)[source]¶
Bases:
objectPre-created ShapeStim that renders a scrolling waveform.
Create once before your frame loop, then call
draw()each frame with the latest data. This avoids re-creating stimulus objects inside the render loop.- Parameters:
- respyra.core.display.draw_signal_trace(win, data_points, y_range=(0, 50), trace_rect=(-0.8, -0.3, 0.8, 0.3), color='green')[source]¶
Convenience function: draw a signal trace on win this frame.
Internally caches a
SignalTraceper window so the ShapeStim is created only once — safe to call every frame without allocations.