3dClustSim Results to Overlay Dataset's Header

Hello AFNI Experts,
How do I add my 3dClustSim results to my overlay dataset’s header? Below is my 3dClustSim code.

module load AFNI/18.2.05-intel-2016a-Python-2.7.11
3dClustSim -mask mask2IIT2.nii
-nodec -acf 0.33910251948052 3.23117512987013 7.8156487012987 -iter 10001
-pthr .05 .025 .01 .005 .001
-athr .05 .025 .01 .005 .001
-prefix clusterFA_table


I stole the recipe for doing this, below, from what afni_proc.py would do if you included the option “-regress_run_clustsim yes” there (and why not have this done in your processing that way?). In the output of afni_proc.py processing, the generated script would essentially use the following to store the 3dClustSim results in your output stats* header for you.

Add the following option to your 3dClustSim command:

-cmd o.clustsim.acf.cmd

… so that a 3drefit command is generated+stored in that output text, to be applied soon after.

Then, add the following commands to your tcsh script file, after your 3dClustSim command:

set cmd = ( `cat o.clustsim.acf.cmd` )
$cmd DSET

… where DSET is your dset of interest (such as “stats.$subj+tlrc”). This essentially runs the script from o.clustim*cmd to dump information into your DSET of interest.