On Thu, Nov 4, 2010 at 11:44 PM, Courtney Haswell
<
[log in to unmask]>
wrote:
> Thanks everyone, I got it working. I was having issues with the
Feat GUI
> allowing me to enter a variable for Total Volumes but I just
edited the .fsf
> file in a text editor to add the variable.
>
> This is my script in case it will help anyone else in the future:
> for runs in 1 2 3 4 5 6 7 8; do
> ANATFILE=$RAWDIR/T1_brain
> RUNDIR=$RAWDIR/run${runs}
> OUTPUTDIR=$FSLDATADIR/run${runs}
> BEHAVDIR=$FSLDATADIR/behavioral/run${runs}
> VOL_TIMEPT=`ls -l $FUNCDIR/run006_0${runs}/*.img | wc -l`
> for i in 'FEAT_template_evst.fsf'; do
> sed -e 's@OUTPUT@'$OUTPUTDIR'@g' \
> -e 's@ANAT@'$ANATFILE'@g' \
> -e 's@VOLPOINTS@'$VOL_TIMEPT'@g' \
> -e 's@RUNDIR@'$RUNDIR'@g' <$i>
$FSLDATADIR/FEAT_run${runs}.fsf
> done
> feat $FSLDATADIR/FEAT_run${runs}.fsf
> ##############
> done
>
> On Thu, Nov 4, 2010 at 11:14 AM, Martin M Monti <
[log in to unmask]>
> wrote:
>>
>> 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
>>>
>
>