Sequence of stimuli

Here we create a stimulus with an adaptor before each presentation.

For this we convert the program written to a series of directions first. And then add the adaptor. This follows on from Creating Series of Stimuli, which in turn follows from Create Basic Stimuli


Step 1: Convert from x-location series to direction series

First step is to go into the grouped workflows and change the variable parameter from Location to Angle

This is within the Stim1 node of the GratingAtLocation. Also, once we change the variable, it would be good to rename the group from GratingAtLocation to DirectionalGrating


Step 2: Change Range

We previously had the inputs going from -1 to 1 on Parameter Range for location in Normalized Coordinates. We can make these now go from 0 to 180 degrees.


Step 3: Add Adaptor to workflow

Within Stim1 we add another datastream that is a basic DrawGratings stimulus with some timing. It will have to Subscribe to DrawStimuli

We group the newly made nodes and rename as AdaptorStimulus

We can externalize DueTime from the Timer, which will be the time the adaptor will remain on for.

And bring this out further to the main workflow

We can now rename this as ‘AdaptorTime’


Step 4: Concat Adaptor with stimulus

We can now place the adaptor in front of the stimulus within the DirectionalGrating group. First Remove Connection between Stim1 and WorkflowOutput

(Right click on Stim1, choose RemoveConnection and then click on WorkflowOutput)

Add a concat after the AdaptorStimulus.

Connect the output of Stim1 to Concat and the output of Concat to WorkflowOutput.


Step 5: Add a delay, use make random a broadcasted signal

Add a delay after the DirectionalGrating and Concat if you want to add a inter-stimulus interval.

In case we use random numbers in multiple places, we like to broadcast a Random number across multiple places. Therefore, we convert it into a BehaviorSubject.

In this example, Permutation needs to subscribe to it.


Step 6: Create Initial adaptor

We are no going to add an adaptation stimulus to before the onset of all the directional stimuli. The easiest way to do this in this workflow, is to first go into the DirectionalGrating node and choose the Adaptation Stimuli

We can then copy these nodes, and paste them into the main Workflow.


Step 7: Concat Initial adaptor

We now Concat this with the original datastream.

We also add another delay before moving onto the set of DirectionalGratings.


Step 8: Fine tuning with grouping

For ease with understanding what is happening, we can group a series of nodes for Convienience.

This was we can just see that we first have the InitialAdaptor, followed by AllStim which includes the DirectionalGratings.



Done!