#!/bin/sh #{{{ copyright and script setup # feat - main FEAT command-line script # # Stephen Smith, FMRIB Image Analysis Group # # Copyright (C) 2002-2008 University of Oxford # # Part of FSL - FMRIB's Software Library # http://www.fmrib.ox.ac.uk/fsl # fsl@fmrib.ox.ac.uk # # Developed at FMRIB (Oxford Centre for Functional Magnetic Resonance # Imaging of the Brain), Department of Clinical Neurology, Oxford # University, Oxford, UK # # # LICENCE # # FMRIB Software Library, Release 5.0 (c) 2012, The University of # Oxford (the "Software") # # The Software remains the property of the University of Oxford ("the # University"). # # The Software is distributed "AS IS" under this Licence solely for # non-commercial use in the hope that it will be useful, but in order # that the University as a charitable foundation protects its assets for # the benefit of its educational and research purposes, the University # makes clear that no condition is made or to be implied, nor is any # warranty given or to be implied, as to the accuracy of the Software, # or that it will be suitable for any particular purpose or for use # under any specific conditions. Furthermore, the University disclaims # all responsibility for the use which is made of the Software. It # further disclaims any liability for the outcomes arising from using # the Software. # # The Licensee agrees to indemnify the University and hold the # University harmless from and against any and all claims, damages and # liabilities asserted by third parties (including claims for # negligence) which arise directly or indirectly from the use of the # Software or the sale of any products based on the Software. # # No part of the Software may be reproduced, modified, transmitted or # transferred in any form or by any means, electronic or mechanical, # without the express permission of the University. The permission of # the University is not required if the said reproduction, modification, # transmission or transference is done without financial return, the # conditions of this Licence are imposed upon the receiver of the # product, and all original and amended source code is included in any # transmitted product. You may be held legally responsible for any # copyright infringement that is caused or encouraged by your failure to # abide by these terms and conditions. # # You are not permitted under this Licence to use this Software # commercially. Use for which any financial return is received shall be # defined as commercial use, and includes (1) integration of all or part # of the source code or the Software into a product for sale or license # by or on behalf of Licensee to third parties or (2) use of the # Software or any derivative of it for research with the final aim of # developing software products for sale or license to a third party or # (3) use of the Software or any derivative of it for research with the # final aim of developing non-software products for sale or license to a # third party, or (4) use of the Software to provide any service to an # external organisation for which payment is received. If you are # interested in using the Software commercially, please contact Isis # Innovation Limited ("Isis"), the technology transfer company of the # University, to negotiate a licence. Contact details are: # innovation@isis.ox.ac.uk quoting reference DE/9564. # the next line restarts using wish \ exec $FSLTCLSH "$0" "$@" source $env(FSLDIR)/tcl/fslstart.tcl if { [ lindex $argv 0 ] == "" } { puts " Usage: feat " exit 1 puts " Usage: feat \[options\] If no options are set then the whole design.fsf is processed Misc options (these need to come before the partial analysis options): -I : run just session of the multiple setups in -D : use as the working output directory (instead of what is in ) Partial analysis options: -init : run basic first-level initialisation -prestats : run first-level pre-stats -film : run first-level timeseries stats using FILM -poststats : run post-stats (first or higher-level) -reg : run first-level registration -gfeatprep : run higher-level preparation -flame1 : run higher-level stats part 1 (pre-FLAME) -flame2 : run higher-level stats part 2 (FLAME) -flame3 : run higher-level stats part 3 (post-FLAME) -gica : run higher-level MELODIC -stop : clean-up logs files etc. " } set fsfroot [ file rootname [ lindex $argv 0 ] ] if { [ string range $fsfroot 0 0 ] != "/" } { set fsfroot [ pwd ]/$fsfroot } set session 0 set done_something 0 feat5:setupdefaults feat5:load -1 1 ${fsfroot}.fsf if { [ catch { for { set argindex 1 } { $argindex < $argc } { incr argindex 1 } { switch -- [ lindex $argv $argindex ] { -I { incr argindex 1 set session [ lindex $argv $argindex ] } -D { incr argindex 1 set fmri(outputdir) [ lindex $argv $argindex ] } -init { feat5:proc_init $session set done_something 1 } -prestats { feat5:proc_prestats $session set done_something 1 } -film { feat5:proc_film $session set done_something 1 } -poststats { incr argindex 1 set RERUNNING [ lindex $argv $argindex ] incr argindex 1 set STDSPACE [ lindex $argv $argindex ] feat5:proc_poststats $RERUNNING $STDSPACE set done_something 1 } -reg { feat5:proc_reg $session set done_something 1 } -gfeatprep { feat5:proc_gfeatprep set done_something 1 } -flame1 { feat5:proc_flame1 $session set done_something 1 } -flame2 { feat5:proc_flame2 set done_something 1 } -flame3 { feat5:proc_flame3 set done_something 1 } -gica { feat5:proc_gica set done_something 1 } -stop { feat5:proc_stop set done_something 1 } } } } errMsg ] } { feat5:proc_stop return -code error "$errMsg" } #}}} # if we haven't processed a single-task job, this must be a full analysis: if { $done_something == 0 } { if { ! $fmri(inmelodic) } { if { $fmri(level) == 1 } { #{{{ FEAT first-level analysis for { set session 1 } { $session <= $fmri(multiple) } { incr session 1 } { #{{{ setup FEAT output directory if { $fmri(analysis) == 0 || $fmri(analysis) == 4 } { #{{{ copy old featdir if required, and backup old files inside set FD $feat_files($session) if { $fmri(newdir_yn) } { set oldFD $FD set FD [ new_filename $oldFD ] file copy $oldFD $FD } cd $FD new_file old if { $fmri(analysis) == 0 } { fsl:exec "/bin/mkdir -p old ; /bin/cp design* old" -n } else { fsl:exec "/bin/mkdir -p old ; /bin/mv design* old ; /bin/cp old/design.fsf old/design.png old/design.lev ." -n fsl:exec "/bin/mv ?endered_thresh_* cluster_* lmax_* prob_mask_* thresh_* tsplot stats/cope* stats/neff* stats/tstat* stats/varcope* stats/zstat* stats/fstat* stats/zfstat* old" -n } #}}} } else { #{{{ setup new featdir name if { $fmri(outputdir) != "" } { if { $fmri(multiple) == 1 } { set FD [ feat5:strip $fmri(outputdir) ].feat } else { set FD [ file rootname $feat_files($session) ]_[ file rootname [ file tail $fmri(outputdir) ] ].feat } } else { set FD [ feat5:strip [ remove_ext $feat_files($session) ] ].feat } if { ! [ info exists fmri(overwrite_yn) ] || $fmri(overwrite_yn) == 0 } { set FD [ new_filename $FD ] } fsl:exec "/bin/mkdir -p $FD" -n #}}} } cd $FD set FD [ pwd ] fsl:exec "mkdir -p logs" -n set logout ${FD}/logs/feat1 fsl:exec "/bin/cp ${fsfroot}.fsf design.fsf" set confevs "" if { [ file exists confoundevs.txt ] } { set confevs "confoundevs.txt" } set haltForModel 1 if { ! [ info exists fmri(featModelOpts) ] } { set fmri(featModelOpts) "" set haltForModel 0 } set featModelID 0 if { $fmri(analysis) != 0 } { set featModelID [ fsl:exec "${FSLDIR}/bin/feat_model design $confevs" $fmri(featModelOpts) -N feat0_model -l logs ] } set fsfroot ${FD}/design #}}} #{{{ setup web pages if { ! [ file exists .files ] } { fsl:exec "mkdir .files;cp ${FSLDIR}/doc/fsl.css .files;ln -s ${FSLDIR}/doc/images .files/images" } fsl:echo report.html "
FEAT Report
$FD
Started at [ exec date ]        STILL RUNNING.
Registration  -  Pre-stats  -  Stats  -  Post-stats  -  Log

" -o if { ! [ file exists report_prestats.html ] } { fsl:echo report_prestats.html " FSL

Prestats

...not yet run..." -o } if { ! [ file exists report_stats.html ] } { fsl:echo report_stats.html " FSL

Stats

...not yet run..." -o } if { ! [ file exists report_poststats.html ] } { fsl:echo report_poststats.html " FSL

Poststats

...not yet run..." -o } if { ! [ file exists report_reg.html ] } { fsl:echo report_reg.html " FSL

Registration

...not yet run..." -o } fsl:echo logs/feat0 " FSL

Progress Report / Log

Started at [ exec date ]

Feat main script

" -o

fsl:echo logs/feat9 "

























" if { $fmri(featwatcher_yn) } { FmribWebHelp file: ${FD}/report_log.html } else { fsl:echo "" "To view the FEAT progress and final report, point your web browser at ${FD}/report_log.html" } #}}} set initID -1 set prestatsID -1 set filmID -1 set poststatsID -1 set regID -1 if { ! [ info exists fmri(totalVoxels) ] || $fmri(totalVoxels) < 0 || $fmri(totalVoxels) == "totalVoxels" } { set fmri(totalVoxels) 10000000 } if { $fmri(filtering_yn) || $fmri(stats_yn) } { set initID [ fsl:exec "${FSLDIR}/bin/feat ${fsfroot}.fsf -D $FD -I $session -init" -b 10 -N feat0_init -l logs ] } if { $fmri(reginitial_highres_yn) || $fmri(reghighres_yn) || $fmri(regstandard_yn) } { set howlong [ expr 30 + 30 * $fmri(regstandard_nonlinear_yn) ] set regID [ fsl:exec "${FSLDIR}/bin/feat ${fsfroot}.fsf -D $FD -I $session -reg" -b $howlong -h $initID -N feat1b_reg -l logs ] } if { $fmri(filtering_yn) || $fmri(stats_yn) } { set howlong [ expr int( $fmri(npts) / 10 ) ] if { $fmri(regunwarp_yn) } { set howlong [ expr int( $fmri(npts) / 3 ) ] } if { $fmri(melodic_yn) } { set howlong 300 } set jobHalt "" if { $haltForModel != 0 } { set jobHalt "-h $featModelID" } if { $fmri(totalVoxels) > 80000000 } { set howlong [ expr int( $fmri(npts) / 4 ) ] } set prestatsID [ fsl:exec "${FSLDIR}/bin/feat ${fsfroot}.fsf -D $FD -I $session -prestats" -b $howlong -h $regID -h $initID $jobHalt -N feat2_pre -l logs ] } if { $fmri(stats_yn) } { set howlong [ expr int( 1 + ( ( $fmri(totalVoxels) / 1000000 ) * ( $fmri(totalVoxels) / 1000000 ) / 60 ) * int ( 1 + $fmri(evs_real) / 10 ) ) ] set filmID [ fsl:exec "${FSLDIR}/bin/feat ${fsfroot}.fsf -D $FD -I $session -film" -b $howlong -h $prestatsID -N feat3_film -l logs ] } if { $fmri(poststats_yn) } { set howlong [ expr int( $fmri(ncon_real) * $fmri(evs_real) / 4 ) ] set poststatsID [ fsl:exec "${FSLDIR}/bin/feat ${fsfroot}.fsf -D $FD -poststats 0 0" -b $howlong -h $filmID -N feat4_post -l logs ] } if { $fmri(poststats_yn) && ( [ file exists ${FD}/reg/example_func2standard.mat ] || $fmri(regstandard_yn) ) } { set poststatsID [ fsl:exec "${FSLDIR}/bin/feat ${fsfroot}.fsf -D $FD -poststats 1 0" -b 119 -h $poststatsID -h $regID -N feat4_post -l logs ] } fsl:exec "${FSLDIR}/bin/feat ${fsfroot}.fsf -D $FD -stop" -b 1 -h $prestatsID -h $filmID -h $poststatsID -h $regID -N feat5_stop -l logs } #}}} } else { #{{{ FEAT second-level analysis #{{{ setup .gfeat directory if { $fmri(outputdir) != "" } { set FD [ feat5:strip $fmri(outputdir) ].gfeat } else { set FD [ feat5:strip [ remove_ext $feat_files(1) ] ].gfeat } if { ! [ info exists fmri(overwrite_yn) ] || $fmri(overwrite_yn) == 0 } { set FD [ new_filename $FD ] } fsl:exec "mkdir -p ${FD}/logs" -n cd $FD set FD [ pwd ] set GFD $FD set logout ${FD}/logs/feat1 fsl:exec "/bin/cp ${fsfroot}.fsf design.fsf" fsl:exec "${FSLDIR}/bin/feat_model design" set fsfroot ${FD}/design #}}} #{{{ setup toplevel .gfeat web pages if { ! [ file exists .files ] } { fsl:exec "mkdir .files;cp ${FSLDIR}/doc/fsl.css .files;ln -s ${FSLDIR}/doc/images .files/images" } fsl:echo report.html "
Higher-Level FEAT Report
$FD
Started at [ exec date ]        STILL RUNNING.
Inputs  - " -o if { ! [ file exists $feat_files(1)/design.lev ] } { fsl:echo report.html "Registration summary  - " } fsl:echo report.html "Results  -  Log

" fsl:echo report_firstlevel.html " FSL

Inputs to higher-level analysis

(lower-level FEAT reports)

" -o for { set i 1 } { $i <= $fmri(multiple) } { incr i 1 } { set thelink $feat_files($i)/report.html if { $fmri(inputtype) == 2 } { set thelink [ file dirname [ file dirname $feat_files($i) ] ]/report.html } fsl:echo report_firstlevel.html "${i} ${thelink}
" } fsl:echo report_firstlevel.html "" fsl:echo report_reg.html " FSL

Summary of first-level registrations and masks

" -o fsl:echo report_stats.html " FSL" -o fsl:echo logs/feat0 " FSL

Progress Report / Log

Started at [ exec date ]

Feat main script

" -o

fsl:echo logs/feat9 "

























" if { $fmri(featwatcher_yn) } { FmribWebHelp file: ${FD}/report_log.html } else { fsl:echo "" "To view the FEAT progress and final report, point your web browser at ${FD}/report_log.html" } #}}} #{{{ setup some variables?? if { $fmri(inputtype) == 1 } { # "FEAT directories" option set STANDARD [ feat5:find_std $feat_files(1) standard ] fsl:echo report_stats.html "

Higher-level FEAT results

(one for each lower-level contrast)

" set ff_one $feat_files(1) for { set nci 1 } { $nci <= $fmri(ncopeinputs) } { incr nci 1 } { if { $fmri(copeinput.$nci) } { set contrastname($nci) "[ feat5:getconname $ff_one $nci ]" set feat_files($nci) ${FD}/cope$nci set conname "" if { $contrastname($nci) != "" } { set conname "($contrastname($nci))" } fsl:echo report_stats.html "Lower-level contrast $nci $conname
" } else { set feat_files($nci) -1 } } set fmri(multiple) $fmri(ncopeinputs) } elseif { $fmri(inputtype) == 2 } { # "3D cope input" option set STANDARD [ feat5:find_std [ file dirname [ file dirname $feat_files(1) ] ] standard ] set contrastname(1) "" set fmri(multiple) 1 set feat_files(1) ${FD}/cope1 fsl:echo report_stats.html "


Higher-level FEAT results
" } #}}} #{{{ finish toplevel stats report page if { [ file exists design.mat ] } { fsl:echo report_stats.html "

Design matrix
" } fsl:echo report_stats.html "" #}}} set preID [ fsl:exec "${FSLDIR}/bin/feat ${fsfroot}.fsf -D $FD -gfeatprep" -b 60 -N feat2_pre -l logs ] set allID "" for { set session 1 } { $session <= $fmri(multiple) } { incr session 1 } { if { $feat_files($session) != -1 } { #{{{ setup FEAT directory set FD $feat_files($session) set FD ${FD}.feat fsl:exec "/bin/mkdir -p ${FD}/logs" -n cd $FD set logout ${FD}/logs/feat1 fsl:exec "/bin/cp ../design.* ." -n set fsfroot ${FD}/design fsl:echo design.lev "$contrastname($session)" #setup dummy .flame file to keep the batch submission happy if { [ exec sh -c "grep NumPoints design.mat | awk '{ print \$2 }'" ] < 30 && $fmri(mixed_yn) != 1 && $fmri(robust_yn) == 0 } { fsl:echo .flame "dummy" } else { set DIMZ [ exec sh -c "$FSLDIR/bin/fslval $STANDARD dim3" ] for { set slice 0 } { $slice < $DIMZ } { incr slice 1 } { fsl:echo .flame "dummy" } } #}}} #{{{ setup web pages set conname "" if { $contrastname($session) != "" } { set conname "($contrastname($session))" } fsl:exec "ln -s ../.files .files" fsl:echo report.html "
Results for lower-level contrast $session $conname
$FD
Started at [ exec date ]        STILL RUNNING.
Up to main page  -  Stats  -  Post-stats  -  Log


" -o if { ! [ file exists report_stats.html ] } { fsl:echo report_stats.html " FSL

Stats

...not yet run..." -o } if { ! [ file exists report_poststats.html ] } { fsl:echo report_poststats.html " FSL

Poststats

...not yet run..." -o } fsl:echo logs/feat0 " FSL

Progress Report / Log

Started at [ exec date ]

" -o

fsl:echo logs/feat9 "

























" set logout ${GFD}/logs/feat1 #}}} set howlong 60 if { $fmri(robust_yn) } { set howlong [ expr int( $fmri(npts) * $fmri(evs_real) / 10 ) ] } set ID [ fsl:exec "${FSLDIR}/bin/feat ${fsfroot}.fsf -D $FD -I $session -flame1" -b 60 -N feat3a_flame -h $preID -l logs ] set ID [ fsl:exec "./.flame" -b $howlong -N feat3b_flame -h $ID -l logs -f ] set ID [ fsl:exec "${FSLDIR}/bin/feat ${fsfroot}.fsf -D $FD -flame3" -b 60 -N feat3c_flame -h $ID -l logs ] set ID [ fsl:exec "${FSLDIR}/bin/feat ${fsfroot}.fsf -D $FD -poststats 0 1" -b 60 -N feat4_post -h $ID -l logs ] set allID "$allID -h [ fsl:exec "${FSLDIR}/bin/feat ${fsfroot}.fsf -D $FD -stop" -b 1 -h $ID -N feat5_stop -l logs ]" cd .. } } fsl:exec "${FSLDIR}/bin/feat ${fsfroot}.fsf -D $GFD -stop" -b 1 $allID -N feat5_stop -l logs #}}} } } else { #{{{ MELODIC if { $fmri(icaopt) > 1 } { #{{{ setup group ICA output dir if { $fmri(outputdir) != "" } { set GFD [ feat5:strip $fmri(outputdir) ].gica } else { set GFD [ feat5:strip [ remove_ext $feat_files(1) ] ].gica } set GFD [ new_filename $GFD ] fsl:exec "mkdir -p ${GFD}/logs" -n cd $GFD set GFD [ pwd ] set logout ${GFD}/logs/feat1 fsl:exec "/bin/cp ${fsfroot}.fsf design.fsf" #}}} #{{{ setup toplevel .gfeat web pages if { ! [ file exists .files ] } { fsl:exec "mkdir .files;cp ${FSLDIR}/doc/fsl.css .files;ln -s ${FSLDIR}/doc/images .files/images" } fsl:echo report.html "
Higher-Level MELODIC Report
$GFD
Started at [ exec date ]        STILL RUNNING.
Inputs  -  Registration summary  -  MELODIC output  -  Log

" fsl:echo report_firstlevel.html " FSL

Inputs to higher-level analysis

(lower-level processing)

" -o fsl:echo report_reg.html " FSL

Summary of first-level registrations and masks

" -o fsl:exec "mkdir -p groupmelodic.ica/report" -n fsl:echo groupmelodic.ica/report/00index.html " FSL ...not yet run..." -o fsl:echo logs/feat0 " FSL

Progress Report / Log

Started at [ exec date ]

Feat main script

" -o

fsl:echo logs/feat9 "

























" if { $fmri(featwatcher_yn) } { FmribWebHelp file: ${GFD}/report_log.html } else { fsl:echo "" "To view the FEAT progres and final report, point your web browser at ${GFD}/report_log.html" } #}}} } set ALLID "" for { set session 1 } { $session <= $fmri(multiple) } { incr session 1 } { #{{{ setup output directory if { $fmri(outputdir) != "" } { if { $fmri(multiple) == 1 } { set FD [ feat5:strip $fmri(outputdir) ].ica } else { set FD [ file rootname $feat_files($session) ]_[ file rootname [ file tail $fmri(outputdir) ] ].ica } } else { set FD [ feat5:strip [ remove_ext $feat_files($session) ] ].ica } set FD [ new_filename $FD ] fsl:exec "/bin/mkdir -p ${FD}/logs" -n cd $FD set FD [ pwd ] set logout ${FD}/logs/feat1 fsl:exec "/bin/cp ${fsfroot}.fsf design.fsf" set fsfroot ${FD}/design if { $fmri(icaopt) > 1 } { fsl:echo ${GFD}/.filelist ${FD}/reg_standard/filtered_func_data fsl:echo ${GFD}/design.fsf "set feat_files($session) \"$FD\"" } #}}} #{{{ setup web pages if { ! [ file exists .files ] } { fsl:exec "mkdir .files;cp ${FSLDIR}/doc/fsl.css .files;ln -s ${FSLDIR}/doc/images .files/images" } fsl:echo report.html "
MELODIC Report
$FD
Started at [ exec date ]        STILL RUNNING.
Pre-stats  -  Registration  - " -o if { $fmri(icaopt) == 1 } { fsl:echo report.html "ICA  - " } fsl:echo report.html "Log

" if { ! [ file exists report_prestats.html ] } { fsl:echo report_prestats.html " FSL

Prestats

...not yet run..." -o } if { ! [ file exists report_reg.html ] } { fsl:echo report_reg.html " FSL

Registration

...not yet run..." -o } if { $fmri(icaopt) == 1 } { fsl:exec "mkdir -p filtered_func_data.ica/report" -n fsl:echo filtered_func_data.ica/report/00index.html " FSL ...not yet run..." -o } fsl:echo logs/feat0 " FSL

Progress Report / Log

Started at [ exec date ]

Main script

" -o

fsl:echo logs/feat9 "

























" if { $fmri(icaopt) == 1 } { if { $fmri(featwatcher_yn) } { FmribWebHelp file: ${FD}/report_log.html } else { fsl:echo "" "To view the MELODIC progress and final report, point your web browser at ${FD}/report_log.html" } } if { $fmri(icaopt) > 1 } { set logout ${GFD}/logs/feat1 } #}}} set ID [ fsl:exec "${FSLDIR}/bin/feat ${fsfroot}.fsf -D $FD -I $session -init" -b 10 -N feat1a_init -l logs ] if { $fmri(reginitial_highres_yn) || $fmri(reghighres_yn) || $fmri(regstandard_yn) } { if { $fmri(regstandard_nonlinear_yn) || $fmri(regunwarp_yn) } { set ID [ fsl:exec "${FSLDIR}/bin/feat ${fsfroot}.fsf -D $FD -I $session -reg" -h $ID -b 250 -N feat3_reg -l logs ] } else { set ID [ fsl:exec "${FSLDIR}/bin/feat ${fsfroot}.fsf -D $FD -I $session -reg" -h $ID -b 30 -N feat3_reg -l logs ] } } set howlong [ expr int( $fmri(npts) / 10 ) ] set ID [ fsl:exec "${FSLDIR}/bin/feat ${fsfroot}.fsf -D $FD -I $session -prestats" -b $howlong -h $ID -N feat2_pre -l logs ] set ALLID "$ALLID -h $ID" if { $fmri(icaopt) == 1 } { #{{{ setup melodic command set logout ${FD}/logs/feat4 fsl:echo $logout "
Stats
"

set thecommand "${FSLDIR}/bin/melodic -i filtered_func_data -o filtered_func_data.ica -v --nobet --bgthreshold=$fmri(thresh) --tr=$fmri(tr) --report --guireport=../../report.html"

set howlong 30
if { $fmri(dim_yn) == 1 } {
    set thecommand "$thecommand -d 0"
    if { $fmri(npts) > 300 } {
	set howlong 180
    }
} else {
    set thecommand "$thecommand -d $fmri(dim)"
    if { $fmri(dim) > 100 } {
	set howlong 180
    }
}

if { $fmri(varnorm) == 0 } {
    set thecommand "$thecommand --vn"
}

if { $fmri(thresh_yn) == 0 } {
    set thecommand "$thecommand --no_mm"
} else {
    set thecommand "$thecommand --mmthresh=\"$fmri(mmthresh)\""
}

if { $fmri(ostats) == 1 } {
    set thecommand "$thecommand --Ostats"
}

if { [ file exists $fmri(ts_model_mat) ] && [ file exists $fmri(ts_model_con) ] } {
    set thecommand "$thecommand --Tdes=$fmri(ts_model_mat) --Tcon=$fmri(ts_model_con)"
}

#}}}
	set ID [ fsl:exec "$thecommand" -b $howlong -h $ID -N feat4_ica -l logs ]
    }
    fsl:exec "${FSLDIR}/bin/feat ${fsfroot}.fsf -D $FD -stop" -b 1 -h $ID -N feat5_stop -l logs
}

if { $fmri(icaopt) > 1 } {
    cd $GFD
    set ID [ fsl:exec "${FSLDIR}/bin/feat ${GFD}/design.fsf -D $GFD -gica" -b 180 $ALLID -N feat4_gica -l logs ]
    fsl:exec "${FSLDIR}/bin/feat ${fsfroot}.fsf -D $GFD -stop" -b 1 -h $ID -N feat5_stop -l logs
}

#}}}
    }
}