AFNI Message Board

Dear AFNI users-

We are very pleased to announce that the new AFNI Message Board framework is up! Please join us at:

https://discuss.afni.nimh.nih.gov

Existing user accounts have been migrated, so returning users can login by requesting a password reset. New users can create accounts, as well, through a standard account creation process. Please note that these setup emails might initially go to spam folders (esp. for NIH users!), so please check those locations in the beginning.

The current Message Board discussion threads have been migrated to the new framework. The current Message Board will remain visible, but read-only, for a little while.

Sincerely, AFNI HQ

History of AFNI updates  

|
September 08, 2021 05:15AM
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
Subject Author Posted

3dTcat - Creating/cutting distinct time-series within one code

Philipp September 08, 2021 05:15AM

Re: 3dTcat - Creating/cutting distinct time-series within one code

Philipp September 08, 2021 08:48AM

Re: 3dTcat - Creating/cutting distinct time-series within one code

Philipp September 08, 2021 09:43AM

Re: 3dTcat - Creating/cutting distinct time-series within one code

rick reynolds September 08, 2021 10:19AM