Sitelet https://github.com/cortex-lab/Rigbox/issues/308
Skip to content

Add modulating plaid stimuli #308

Description

@k1o0

Users have had issues with the order of textures in Signals. An example that uses inverted contrasts will hopefully make things clearer. Below is an example of a modulating plaid that takes into account the layer order:

%%% Create a modulating plaid
% Creates some sinewave gratings then modulates their contrasts, accounting
% for layer opacity.  
%%%

% Setup playground
PsychDebugWindowConfiguration % Make our screen transparant
[t, setgraphic] = sig.test.playgroundPTB; 
vs = StructRef; % This mimicks the fourth input arg of your expDef

% Create our stimuli

% This is a vertical sinewave grating
vertical = vis.grating(t, 'sine', 'none');
vertical.orientation = 0;
vertical.contrast = (sin(t) * 0.5) + 0.5;

% This is a horizontal sinewave grating
horizontal = vis.grating(t, 'sine', 'none');
horizontal.orientation = 90;
horizontal.contrast = sin(t);

[horizontal.show, vertical.show] = deal(true); % show both

vs.horizontal = horizontal;
vs.vertical = vertical;

% Render stimulus 
setgraphic(vs)
% Programmatically press the play button
startstop = get(findobj(gcf, 'String', 'Play'), 'Callback');
startstop() % Play button callback

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions