Hi-
I looked at the script that afni_proc.py creates for some insight into this. In particular, I looked at the AFNI Bootcamp script for the big Tuesday session on using afni_proc.py, which is AFNI_data6/FT_analysis/s05.ap.uber. Running that script creates a file called ‘proc.FT’, and reading that commented script, the first part under the “auto block: outcount” block has useful suggestions for creating the outlier censor files; the “regress” block code has some helpful lines for dealing with enorm and combining the censor files. I am not sure if you have multiple runs or not, but this afni_proc.py command does (it has 3), so part of the work of creating the censoring files is concatenating information from separate runs.
++ For the outcount file:
In the first for loop, 3dToutcount is run a few times to create outcount.r*.1D file. Those exist in the results directory, so you don’t need to create those. I will also leave out the part of checking for pre-steady state TRs. I will also include the creation of the “runs” variable from above in the script (basically, specifying that there are 3 runs of data). That leaves:
# set list of runs
set runs = (`count -digits 2 1 3`)
foreach run ( $runs )
1deval -a outcount.r$run.1D -expr "1-step(a-0.05)" > rm.out.cen.r$run.1D
end
# catenate outlier censor files into a single time series
cat rm.out.cen.r*.1D > outcount_${subj}_censor.1D
In the above, the 0.05 value is the threshold, which you could set differently. The outcount_${subj}_censor.1D is the output censor file (combined with the enorm-calculated censor file later-- see below).
++ For the motion/enorm censoring:
This is the command that creates motion_${subj}enorm.1D, motion${subj}CENSORTR.txt and motion${subj}_censor.1D:
# create censor file motion_${subj}_censor.1D, for censoring motion
1d_tool.py -infile dfile_rall.1D -set_nruns 3 \
-show_censor_count -censor_prev_TR \
-censor_motion 0.3 motion_${subj}
Note that the input file is the dfile_rall.1D, with the addition information of the number of runs present. The “-censor_motion 0.3” is what sets the enorm motion censor limit. I think you could do something similar for your processing, rather than just using the enorm file itself.
++ For combining the censoring:
The next command after that uses 1deval to combine the censoring
# combine multiple censor files
1deval -a motion_${subj}_censor.1D -b outcount_${subj}_censor.1D \
-expr "a*b" > censor_${subj}_combined_2.1D
How is that? It becomes a lot simpler if you only have one run, but I left in the more general case here.
–pt