Can't open dataset when using 3dcalc

AFNI version info: Oct 2 2020 (Version AFNI_20.3.00 'Vespasian')

Hi,

I'm learning AFNI by following the tutorials on Andy's Brain Book (specifically this chapter). I was trying to run 3dcalc mentioned in exercise of that chapter:

3dcalc -a stats.sub-08+tlrc'[4]' -b stats.sub-08+tlrc'[1]' -expr 'a-b' -prefix Inc-Con+tlrc

I'm sure that my current working dir contains files "stats.sub-08+tlrc.BRIK" and "stats.sub-08+tlrc.HEAD" But after I ran 3dcalc mentioned above, I got the following warning:

FATAL ERROR: can't open dataset stats.sub-08+tlrc[4]

Question: how to figure out the reason for this warning or any suggestion for addressing it? Many thanks!

Chuan

Hi, Chuan-

Where

Could you please copy+paste this in your terminal:

ls stats.sub-08+tlrc*

... and copy+paste the output here?

thanks,
pt

[ch.yu@c0706a-s7 sub_08.results]$ ls stats.sub-08+tlrc*
ls: cannot access 'stats.sub-08+tlrc*': No such file or directory

If I use ls function only, I saw the stats.sub-08+tlrc files:

Hi, Chuan-

It does not appear that the filename being entered into the 3dcalc command exists, and that is the problem. It may be a permutation or similar filename that exists? What is the output of:

ls

there?

--pt

Given your directory, it looks like that should be with an underscore rather than dash: stats.sub_08+tlrc.
Try:

ls stats.sub_08+tlrc*

-rick

Hi @ptaylor and @rickr

You are right, I just found that the file name I entered in 3dcalc command is incorrect. After correcting the file name, the 3dcalc function works!

Thank you so much!