Timming inside fMRI with variable choice times

OS (e.g. Win10): Win10
PsychoPy version (e.g. 1.84.x): 2023.2.3
Standard Standalone? (y/n) If not then what?:y

I am quite new to Psychopy and I plan to implement an online task that was designed through Psychopy in the scanner. I wanted to see the feasibility of accurate timing (non-slipping timing) within this design. This task will have variable presentation times (jittered time responses due to the fMRI adaptation) but also inherently has variable presentation due to variable decision time. Would that make it ineligible for non-slipping timing?
At the same time in Builder mode, when I open the existing task (that does not have the jittered time responses but has the variable presentation following a key press), I can see routines that have a green and a blue colour but none are red (or grey). Does that mean instead that non-slipping timing is feasible?
In the past, I have worked with Cogent (now discontinued) where I would simply add timers before and after every event (from a global clock) so as to to make sure that any time slipping would not influence my analysis (even if it results in a slight deviation in duration). In this case, I would need the timing of stimuli presentation to be accurate as it interferes with the design of the imaging task.

I would appreciate any clarification on this.

Thank you in advance,

George

Hello George

You might want to take a look at Peirce, J. W., Hirst, R. J. & MacAskill, M. R. (2022). Building Experiments in PsychoPy. 2nd Edn London: Sage. Your library might have it :smile: The requirements you mention are possible in PsychoPy, but are too general to be answered properly.

Best wishes Jens

Hi Jens,

Thank you very much for your fast reply.

I have indeed seen the documentation regarding an fMRI study but I am a bit puzzled about what happens in terms of accurate timing and how to ensure non-slip timing.

To be more specific, participants will be making choices so the duration of the trial will be variable due to this. At the same time, the documentation in the Builder view indicates that any Routine that can use non-slip timing is showing as green rather than red, but in my existing script, there are only blue and green routines. Is blue the same as red here?
In the end, is the fact that my choice duration is variable, a reason why non-slip timing is not possible?

Would you happen to have any recommendations for an alternative methodology regarding timing? Is there a way to time everything before and after any stimulus change, based on a global clock, in an accurate way (even if there is some delay in the stimuli presentation)? I cannot find something specifically for that in the current documentation and I want to see if that is possible in Psychopy or if need to shift to a different presentation software.

Thank you very much for your help once more,

Best,

George

Hello George

as a matter of fact, I have never paid much attention to colours. I know that stimuli are blue and response devices are orange.

It may be that the colours have been changed for non-time slipping routines. See here. There are red and green routines.

However, in a recent version of PsychoPy the routine colours are blue and green.

Best wishes Jens

Hi Jens,

Thanks again for the prompt reply. So does that mean that non-slip timing is not a viable option when the routines are blue in this case?

Regarding my other questions:

In the end, is the fact that my choice duration is variable, a reason why non-slip timing is not possible?

Is this a valid assumption?

Would you happen to have any recommendations for an alternative methodology regarding timing? Is there a way to time everything before and after any stimulus change, based on a global clock, in an accurate way (even if there is some delay in the stimuli presentation)?

Do you have an input on this?

Thank you once again for your help.

George

Hello George

I do not know whether the colour change was a design change or indicates that non-slip timing is not available.

You can send a pulse whenever you want and record it with our fMRI-data.

Best wishes Jens

Hi Jens,

Thank you for your reply.

What do you mean exactly by recording it with your fMRI-data? Is there a way to add a global clock in general and refer everything to this global clock with consistency in timing and presentation of stimuli?

In lay terms can I count on the consistency of the timing commands to be efficient in the recording of the time, even if there is time-slipping?

All the best,

George

Hello George

to be sure that your timing-events are consistent and appear at the intended time you need extra hardware that allows you the measure your timing-event, e.g an oscilloscope. Software can only inform you about the time the software initiated the intended action, play a sound, show an image aso, however the operating system and the drives responsible for the device might infer.

Best wishes Jens

Hi Jens,

That is great. I was mainly asking if I can ensure the timing commands are accurate even if there is time slipping occurring. More specifically, if I put a global clock at the beginning of the task, and then have everything recorded in reference to this initial clock, will I be able to infer the exact time that the stimuli were presented (plus or minus a few microseconds)?

For example and as a clarification, these were the steps I would be planning:

  1. I start the experiment and start recording time in reference to a global clock.
  2. I time from this global clock when the first pulse from the fMRI comes, in order to start the experiment (and synchronise the timing of events with the imaging scans from this timepoint afterwards).
  3. I have relative times (to the first fMRI trigger) around when each stimulus started and ended.

In the above design could I rely that I would have an accurate representation of when each event (i.e. stimulus presentation, button press etc) occurred in time (even if there is a deviation of a few microseconds due to time-slipping)? How would that be implemented in the builder?

Thank you once more for your help.

George

As a better clarification, I do not have a problem if there is any time slipping per trial but I want to know that if I time everything in reference to a global clock at the beginning of the task, then I could relly on accurate timing of this and identify any delay that is happening in terms of stimulus presentation by calling the clock function at the points of interest. Would that be a viable strategy?

Thank you again for your help with this.

Best,

George

Hello George

Well, you need an external measurement to be sure that the timing is accurate. The software timer itself will be accurate, but you will not know if the stimulus presentation is as intended. The accuracy of the presentation depends on your local installation, which you need to measure.

However, I do not think that a few ms are very important for an fMRI measurement, given its low temporal resolution. Only if the error adds up to seconds, it will hamr your experiment.

Best wishes Jens

Hi Jens,

Indeed, I was referring to whether the software timer will be accurate. If the presentation is a few ms off, that does not matter for my design.

I was just trying to double-check that I can adequately measure time in relation to the starting point of my experiment. Then I would just measure when each stimulus presentation occurred in relation to this starting point and thus I could get an accurate timing of when my stimulus was presented even if that stimulus is not accurately timed per se.

In any case, I can now mark this post as resolved given your last clarification.

Thanks a lot.

George