AFNI Message Board

History of AFNI updates  

|
April 21, 2022 08:58AM
Hello Osman,

I think what you are looking for is a so called "for loop". The exact code for a "for loop" depends on the shell language that you are using (bash, tcsh, zsh, etc.).
A for loop can be created as follows.

Before the code that specifies AFNI proc, you would have to add the for loop code; something along the following lines:

for subject in Subject1 Subject2 Subject3 Subject4...
do

In the code above, you have to specifiy the exact folder names for your subjects. For example, if your subject folders are named "0050772, 0050773, 0050774", then you have to change the subject names in the code above accordingly. Such as "subject1" in my example to "0050772", and so on.

In a next step, you can define all the path names required for preprocessing the data, such as for the raw data, SSwarper results, and everything else needed. Here is an example:

directory_rest=/volumes/.../preprocessing_awake/restingstate/$subject # specifiy your resting-state functional runs path
directory_sswarper=/volumes/.../sswarper_anat1/$subject # specifiy SSwarper results

cd $directory_rest # tell your shell to cd (navigate) into the just assigned resting-state path

Finally, you can insert your AFNI proc script. Using the
$
symbol, you can link the specified paths above with AFNI proc, so that the latter knows where to find your data.

afni_proc.py \
-subj_id ${subject}_Rest \
-out_dir $directory_rest/Results \
-dsets \
	$directory_deoblique/Rest1_deoblique+orig \
-blocks despike tshift align tlrc volreg mask blur regress \
-copy_anat $directory_sswarper_1/anatSS.$subject.nii \
....
-tlrc_NL_warp \
-tlrc_NL_warped_dsets \
	$directory_sswarper/anatQQ.$subject.nii \
	$directory_sswarper/anatQQ.$subject.aff12.1D \
	$directory_sswarper/anatQQ.${subject}_WARP.nii \
...
-execute

done

AFNI proc will then start to preprocess your subjects, one after one.
Subject Author Posted

shell script for the preprocessing step for all subjects Attachments

osman March 29, 2022 08:02AM

Re: shell script for the preprocessing step for all subjects

rick reynolds March 29, 2022 02:16PM

Re: shell script for the preprocessing step for all subjects Attachments

osman March 29, 2022 04:15PM

Re: shell script for the preprocessing step for all subjects

ptaylor March 29, 2022 04:42PM

Re: shell script for the preprocessing step for all subjects

Philipp April 21, 2022 08:58AM



Sorry, only registered users may post in this forum.

Click here to login