If fRSN_P2-0015*.nii resolves in 90 files, that will not work. 3dcopy works like the shell 'cp' command (without directories), copying one dataset at a time. For this it would be good to write a little loop, going from ...-01.nii to ...-90.nii.
But, writing the conversion in loop will create BRIK and HEAD files for each .nii file. I want to create a single BRIK and HEAD file for the whole session per subject. Is there any way in AFNI to do that?
Just adding a bit to @pmolfese's likely solution to what is desired here, if you are wanting to concatenate or glue together your set of files (which is different than copying each individually).
you can type ls -1 fRSN_P2-0015*.nii and verify visually that the order of the displayed column of files is the order in which you would like these datasets to be glued together; the top of the column will be the first (or [0]th in zerobased counting terms) volume.
the following command can then be used to concatenate them to a new BRIK/HEAD file:
3dTcat -prefix DSET_NEW fRSN_P2-0015*.nii
If you wanted the output to be a (compressed) NIFTI formatted file, you could use:
Just to add another technique, you can also use catenation in memory without writing the file to disk. This kind of remastering happens on the fly with either quotes or parentheses around the input datasets. From the help of 3dcalc :
CATENATED AND WILDCARD DATASET NAMES
------------------------------------
Datasets may also be catenated or combined in memory, as if one first
ran 3dTcat or 3dbucket.
An input with space-separated elements will be read as a concatenated
dataset, as with 'dset1+tlrc dset2+tlrc dset3+tlrc', or with paths,
'dir/dset1+tlrc dir/dset2+tlrc dir/dset3+tlrc'.
The datasets will be combined (as if by 3dTcat) and then treated as a
single input dataset. Note that the quotes are required to specify
them as a single argument.
Getting back to the party here, note that if this is a time series, you will probably want slice timing and a TR set. Those could both be included in the 3dTcat command. After the fact, 3drefit could be used to add or modify them.
rick
The
National Institute of Mental Health (NIMH) is part of the National Institutes of
Health (NIH), a component of the U.S. Department of Health and Human
Services.