Closed dshimaoka closed 3 months ago
I think you need two design objects. One for the rsvp (specifying presentations within a trial, I think this is rsvp
in your minimal example) and a separate one to specify presentations across trials. The second of these probably just needs to present the same condition on every trial, and would be passed to block() on line 104.
A distilled version of the issue is here: https://github.com/klabhub/neurostim/issues/220#issue-2482641233
I wish to design a sequence of gabor patches, in which the gabor orientation changes every N presentations. I tried to write one with Adam/Shaun as in the attached code, which resulted in unwanted behaviour as below.
Desired behaviour: Present a sequence of gabor patches, with a RSVP style. One presentation of a patch is followed by a blank period, before presentation of another patch. The orientation of a patch stays for a desired number of presentations (N), then switches to a different orientation (called the roving paradigm).
Actual behaviour: The orientation of a patch stays the same till the end of a trial. The orientation does switch to another across trials. Apparently the sampling function is called only once at the beginning of a trial.
Coding idea: Define a custom sampling function that draws a new orientation once the number of successive presentations reaches a desired number. Every N repeats it draws from a random distribution (of whichever kind). on the other, intervening repeats, it leaves the value unchanged. So this custom sample function just keeps track of how many repeats have happened against a stored target number. To call this sampling function, utilize the jitter plugin. Use the factorial class to define these "conditions" in the rsvp.
Minimal code reproducing the result above: https://github.com/dshimaoka/sog/blob/main/sogRovingMinimal.m