psychopy.org | Reference | Downloads | Github

Total run duration differs between computed and measured value

For my fMRI experiment, I need to compute the exact number of seconds (expressed in TRs) that a run of my experiment takes. I define a “run” to be a chunk of 16 trials, and there are 4 such runs in the experiment, as per the conditions file.

I computed the run duration as the number of trials times the average duration of each trial (itself a sum between a jittered-duration fixation cross, stimulus presentation, and response window), and I also looked in the log file (event timings) of one test run, to see how long the run duration actually was, between the onset of the first trial and the offset of the last. To my surprise, between the computed and the measured total run duration, the amount of time differs by around 14 seconds (270s vs 284s).

I’ve done several sanity checks but cannot figure out whence this difference arises. Could this be likely due to some aspect of the Builder that I am overlooking, or have I necessarily made a mistake somewhere in the calculation and need to look harder?

Thanks!!

OS (e.g. Win10): Win10
PsychoPy version (e.g. 1.84.x): 3.1.5

Are your routines coloured green, indicating that non-slip timing is in effect? Otherwise (if coloured red) there will be some slippage, which will accumulate over time.

They are actually neither red, nor green just the default grey (RGB=200,150,150)!

Hate to tell you this, but (RGB=200,150,150) is a pinkish-red.

Ah yes, that would be my colour-blindness at work there :slight_smile: (it was clearly not a proper grey just by looking at the RGB value haha)

So I guess that there slippage in the timings then? DOes this mean I need to use non-slip timing, as explained here? Or can I simply rely on the measured duration of the run in seconds, and set the scanner to acquire the corresponding number of volumes?

You really should strive to use non-slip timing if possible. You don’t state why that currently isn’t achieved, but do look into a variety of past topics on this:

1 Like

@Michael, thank you very much for these suggestions, to which I had overlooked to reply. I don’t think in my case I can use non-slip timing, because I have audio stimuli of variable duration, and an event-related design. The question would thus be whether I can rely on the timings recorded in the CSV as to when each event in the trial (e.g. sound starting and stopping, fixation crosses, the usual lot) exactly occurred.

Since this is fMRI, I’d not need a temporal precision much greater than hundreds of ms.

Thanks again for your help!!