ETAC options in 3dttest++ can cause a path error

AFNI version info (afni -ver): 23.3.14

Dear AFNI developers:
I find an error in 3dttest++. When using 3dttest++ without ETAC option on, the prefix can receive an absolute path. But when ETAC option on, the program will add a local path prefix before the prefix provided by users. This is a example:

3dttest++ -prefix $etacdir/exp_change \
          -setA ${exp_2[@]} -setB ${exp_1[@]} -paired \
          -labelA exp_2 -labelB exp_1 \
          -ETAC -ETAC_blur 6 \
          -ETAC_opt pthr=0.1,0.05 \
          -mask ${group_mask} |& tee $etacdir/exp_change.log

After running this script, the fist fatal error you will encounter is

unable to open file .//media/renyiyuan/Portable_Disk/Portable_Data/fMRI/Main/NIFTI/derivatives/seed_based/raphe_d/ETAC/exp_change.0000.sdat for output

It is obvious that the program will add a "./" before the path. I have simplified the problem. If adding "prefix_clustsim" and "tempdir", the problem will be complicated. But I think the main cause is what I show in code.

You are indeed correct. I actually see a comment in the code about this for cluster simulations:

-Clustsim is not currently working when -prefix uses a full path

... and that produces an error code.

I think actually to run ETAC that you should add "-Clustsim" as an option to your 3dttest++ command. You will then see it error out cleanly in the beginning, with the message:

** FATAL ERROR: Cannot use -Clustsim when -prefix has an absolute path

I am not sure why this happens, but I guess this is something we should look more into.

As a temporary fix at least, I usually cd into my output directory and run 3dttest++ for ETAC there, and then have the absolute paths to the input filenames, as necessary.


Thanks @ptaylor . I think it's better to write a warning in the help file of 3dttest++ before the bug is corrected.