Dear all,
I am currently working with 3dTcat and my aim is to cut out distinct time windows from a run and then, in a second step, to save those time windows not into one single new file, but into distinct files.
In other words: there is one input file (a preprocessed and regressed run "fitts.Subject_1+tlrc"). I would like to cut out several sub-brick distances (time windows) in this run and then save those different sub-bricks (time windows) into distinct new files.
However, no matter how I try to adjust my code for this job, 3dTcat always provides me with one single output file; and this file then contains all time windows merged together.
First, I tried it with the following code:
directory=/users/philipp/desktop/fmri/dataset/subjects
for subject in subj1_exp1
do
for fMRIruns (fitts.Subject_1+tlrc)
do
cd $directory/$subject/Preprocessing
echo "Processing $subject ..."
3dTcat \
-prefix $fMRIruns \
-session $directory/$subject/Cut_TimeWindows \
-verb \
-tr 1.0 \
$fMRIruns'[21..75]' \
$fMRIruns'[199..253]' \
$fMRIruns'[427..481]' \
$fMRIruns'[489..543]' \
$fMRIruns'[549..603]' \
$fMRIruns'[659..713]' \
$fMRIruns'[837..891]' \
$fMRIruns'[893..947]' \
$fMRIruns'[955..1009]' \
$fMRIruns'[1013..1067]'
done
done
Then, a friend of mine suggested to use another (third) for-loop that adds the distinct time windows. See the following code:
directory=/users/philipp/desktop/fmri/dataset/subjects
for subject in subj1_exp1
do
for fMRIruns (fitts.Subject_1+tlrc)
do
for TimeWindows ('[21..75]' '[199..253]' '[427..481]' '[489..543]' '[549..603]' '[659..713]' '[837..891]' '[893..947]' [955..1009]' '[1013..1067]')
do
cd $directory/$subject/Preprocessing
echo "Processing $subject ..."
3dTcat \
-prefix $fMRIruns.$TimeWindows \
-session $directory/$subject/Cut_TimeWindows \
-verb \
-tr 1.0 \
$fMRIruns$TimeWindows
done
done
done
The second code in not working at all. The output of this code is "for for for quote>" and then AFNI stops. I think that the problem is that AFNI is searching for a command what it should do with "TimeWindows", and then I do not provide any command beside adding it as "$TimeWindows" behind the input file name of "$fMRIruns" near the end of the code. But I don't know how to solve this problem and I already tried a lot.
Is this problem solveable? Thanks, Philipp