Initial delay in the output values of realtime receiver

Dear AFNI Team,

I am currently using the realtime plug-in to write the ROI average at each TR into a text file. I do this by opening 3 terminals: (i) the first terminal for running along with the the -write_text_data option. (ii) the second for running afni -rt along with the AFNI_REALTIME environment variables. (iii) The third for running DImon in -rt mode.

I notice that there is a delay of a few (~3-4) TRs before any data is written into the text file. This happens only initially for the very first TRs. Specifically, after a delay of about 3 TRs the text file is dumped with 3 lines simultaneously, corresponding to the ROI averages for the first 3 TRs respectively. Following that, each line is written sequentially (as expected) at each TR.

The behavior described above is not just for how the text file is written using the -write_text_data option, but is also replicated in the terminal when using the -show_data option.

I have tried increasing and decreasing the value passed using the -pause option in Dimon, and used rtfeedme instead of Dimon, but always run into this delay problem. In fact, when testing at the scanner while acquiring dicom images in realtime, this initial delay increases to approximately 5 TRs.

I was wondering as to what the reason for this delay was, and if there was any way to eliminate (or considerably minimize) it?

Any help would be much appreciated. Thank you.


That 3 TR delay is likely due to the choice of time point 3 as the
registration base. The motion parameters and ROI averages are
not computed until there is volume registered data, and the realtime
plugin does not have volume registered data until it has the base

If you want results sooner, try setting the base index to 0, or even
using a pre-existing registration base volume.

Does that seem like what you are running into?

  • rick

Hi Rick,

Thank you so much for the prompt reply! Setting the registration base to 0 has fixed the issue for now. Will try using a pre-existing registration base volume using the afni -rt -DAFNI_REALTIME_External_Dataset… while running the plug-in at the scanner, and check if that helps fix this problem entirely.

Thank you once again.


That’s great, Ketan! I am interested to hear
how things go.

  • rick