Print

Print


Hi Courtney,

  if you look back in the archive there are a couple of posts on the 
topic. What you want to do is to write a 'sample" script, which you can 
do from the GUI, then open it and replace all the important variables of 
the .fsf file you want to change with something unique and easy to spot 
(say.. ###SUB### for the subject name, ###VOL###, etc). This will now be 
your "master fsf copy"
Then, the following shows how to create a .fsf file for each subject, 
changing the values that you have set into a "variable" (for example, 
the SubjectName and the TRNumber)

foreach sub (sub1 sub2 sub3)            #subject loop
set nvols = `fslnvols ${sub}_run1.*` #pull out the TRs for each sub
echo $sub $nvols                                #tell me subject and TR 
number
#Replace values and put in sub's directory
sed -e "s/###SUB###/${sub}/g" \
        -e "s/###VOL###/${nvols}/g" \
         Run1_Sample.fsf > /imaging/mm03/LingMath/FSL/${sub}/run1.fsf
end

then you can just make a loop to launch the feat analysis from the shell

Cheers

  Martin

On 04/11/10 13:24, Courtney Haswell wrote:
> Hi FSL users,
>
> For fMRI analysis, I use a Feat template and the sed command to create all of my .fsf files. I have a bit of a problem now in that all of the runs and paradigms have a different number of timepoints, so therefore a different number of total volumes in each run for each subject. Is there a way to change the total number of volumes through scripting in the .fsf file after it has been created before I run "feat" on it? It will not allow me to enter a variable for "Total Volumes" only a number. I would prefer not to have to create the .fsf files manually for every run of every subject.
>
> Thank you,
> Courtney
>