Computing proportion of censored TRs per trial

Hi all! I am using stim_times_IM to get trial-by-trial regressors. In my preprocessing I am also censoring TRs with excess motion. To make things tricky, my trials are variable lengths. However, I am running into a problems where I think some trials are being almost entirely censored. So here's what I am trying to figure out:

  1. Is there some kind of AFNI built in way to figure out how many TRs per trial are being censored? I have been trying to write code to compute this myself using the motion_censor.1d file and my onset times and trial lengths but I haven't been able to pull that off (and am now starting to wonder if that is even possible).
  2. Do you all know if there is any convention about when to cut a trial given the % of TRs that are censored in that trial?

Thank you for your help!

AFNI version info (afni -ver):
afni/24.3.10

Hello,

afni_proc.py almost gives you this information for the response TRs, but it is more difficult for the stimulus TRs. Note that even if an entire stimulus period is censored (which is common, especially for a short event), one would still model the expected BOLD response. So that is one reason afni_proc.py focuses on the response period.

That said, "timing_tool.py -timing_to_1D" is designed to create a 1D file of stimulus time, and it should be able to do what you want. Note that since events are usually not TR-locked, the examples for that oversample time, usually down to 0.1 seconds. But if you specify "-tr 2.0" for example, that would be the resolution.

Consider "Example 6" (a-e) from the -help output.

Anyway, this could be multiplied by the censor file and then fed to "3dTstat -sum" (or even "grep | wc") to count final TRs.

-rick