AFNI command: 3dMatch

Hi everyone,

I’ve been trying to perform the following command:

3dMatch -inset `cat /Users/sondos/Desktop/dualreg_40subj_output3/directory_dualreg_40subj.txt` -refset /Users/sondos/Desktop/dualreg_40subj_output3/merged_Yeo_40sub_standardSpace_matchingZscore.nii.gz  -mask /Users/sondos/Desktop/dualreg_40subj_output3/maskALL.nii.gz -in_min 0 -prefix 3dMatch_40sub

So here, what I’m basically trying to do is run 3dMatch command.
The inset is a text file with 40 subject directories to the files
The refset contains functional activation maps (DMN for instance), this is one file with 7 volumes
the Mask, I chose to be “maskALL.nii.gz” file because this would be subject specific masks for each brain.

This is the following error I receive:
cat: /Users/sondos/Desktop/dualreg_40subj_output3/directory_dualreg_40subj.txt: No such file or directory
++ Loading data.
** FATAL ERROR: Can’t open time series dataset ‘-refset’.

So first of all, this is an actual file and directory
and second is that for some reason it claims that it can’t open -refset

The reason I put a text file as the inset is because I have many files I’d like to be matched against the refset (functional activation regions). Does anyone have suggestions of what I should do?

Hi, Sondos-

I think by "cat"ing the text file, that is like adding lots of arguments after the option name, which confuses the parser and so it doesn’t recognize -refset as an option name.

In any case, the program is not meant to be used in that manner. You should enter the name of a single data set (which can have multiple volumes) after each of the “-inset” and “-refset” options. Those sets much have the same grid space, so that they can be compared voxelwise.

For individual comparisons, the files will have to be analyzed one-by-one. You can loop over the name of files for this inset, for example. If you are familiar with tcsh syntax, this could be done with, say:

set allfiles = `ls SOME_DIR/*HEAD`
foreach vv ( $allfiles )
     set bb = `3dinfo -prefix_noext $vv`
    3dMatch -inset $vv    \
              -refset /Users/sondos/Desktop/dualreg_40subj_output3/merged_Yeo_40sub_standardSpace_matchingZscore.nii.gz  \
              -mask /Users/sondos/Desktop/dualreg_40subj_output3/maskALL.nii.gz \
              -in_min 0 \
              -prefix 3dMatch_40sub_$bb

(This matches some fo the output files prefix with each input file’s name.)