Aha! Thanks for that - just realised that the FEEDS scripts hadn't got
updated to correctly test the recent run of ICA that generated the FEEDS
test data. The corrected RUN script is attached and should hopefully work
better.
Thanks, Steve.
On Fri, 15 Oct 2004, Gamal Akabani wrote:
> Dear mac FSL users:
>
> I just tested the beta version 3.2 and ran the feeds data.
> I only had a problem with melodic
>
> "
> Starting MELODIC at Fri Oct 15 12:05:35 EDT 2004
> % error = 2.53
> Warning - test failed!
>
> Warning - not all tests passed
>
> end time = Fri Oct 15 12:17:34 EDT 2004
>
> "
> Any suggestions?
>
> Gamal
>
--
Stephen M. Smith DPhil
Associate Director, FMRIB and Analysis Research Coordinator
Oxford University Centre for Functional MRI of the Brain
John Radcliffe Hospital, Headington, Oxford OX3 9DU, UK
+44 (0) 1865 222726 (fax 222717)
[log in to unmask] http://www.fmrib.ox.ac.uk/~steve
#!/bin/sh
#{{{ FEEDS - FSL Evaluation and Example Data Suite
# Stephen Smith, FMRIB Image Analysis Group
#
# Copyright (C) 2001-2004 University of Oxford
#
# Part of FSL - FMRIB's Software Library
# http://www.fmrib.ox.ac.uk/fsl
# [log in to unmask]
#
# 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 3.2 (c) 2004, 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:
# [log in to unmask] quoting reference DE/1112.
#}}}
# the next line restarts using wish \
exec $FSLDIR/bin/tclsh "$0" "$@"
#{{{ perror
proc perror { testimage scale } {
global FSLDIR FEEDSDIR PTHRESH MAXPERROR
if { ! [ imtest $FEEDSDIR/results/$testimage ] } {
set PERROR 100
puts "No output image created"
} else {
exec sh -c "${FSLDIR}/bin/avwmaths_32R $FEEDSDIR/data/$testimage -sub $FEEDSDIR/results/$testimage -sqr $FEEDSDIR/results/errsq"
exec sh -c "${FSLDIR}/bin/avwmaths_32R $FEEDSDIR/data/$testimage -sqr $FEEDSDIR/results/meansq"
set PERROR [ expr int ( $scale * 10000.0 * sqrt ( \
[ exec ${FSLDIR}/bin/avwstats $FEEDSDIR/results/errsq -m ] / \
[ exec ${FSLDIR}/bin/avwstats $FEEDSDIR/results/meansq -m ] ) ) / 100.00 ]
puts "% error = $PERROR"
}
if { $PERROR > $PTHRESH } {
puts "Warning - test failed!"
}
if { $PERROR > $MAXPERROR } {
set MAXPERROR $PERROR
}
return $PERROR
}
#}}}
#{{{ simpleperror
proc simpleperror { a b denom } {
global PTHRESH MAXPERROR
set PERROR [ expr int ( 10000.0 * ( $a - $b ) / $denom ) / 100.00 ]
if { $PERROR < 0 } {
set PERROR [ expr 0 - $PERROR ]
}
puts "% error = $PERROR"
if { $PERROR > $PTHRESH } {
puts "Warning - test failed!"
}
if { $PERROR > $MAXPERROR } {
set MAXPERROR $PERROR
}
return $PERROR
}
#}}}
#{{{ process command line arguments
set feeds_list "fugue susan sienax bet2 feat melodic fdt"
foreach f $feeds_list {
set feeds($f) 0
}
if { [ lindex $argv 0 ] == "" } {
puts "Usage: ./RUN all"
puts "or: ./RUN \[packages\]"
puts " package options: $feeds_list"
exit
}
if { [ lindex $argv 0 ] == "all" } {
foreach f $feeds_list {
set feeds($f) 1
}
} else {
foreach f $argv {
set feeds($f) 1
}
}
#}}}
#{{{ setup vars and first printouts
# Don't ask!
set S 0.2
catch { [ expr $S ] } errmsg
set FEEDSVERSION 3.2
set PTHRESH 1
set MAXPERROR 0
if { [ info exists env(FSLDIR) ] } {
set FSLDIR $env(FSLDIR)
} else {
puts "\nPlease set FSLDIR to the fsl top level directory before running this test\n"
exit
}
set INMEDX 0
set INGUI 0
source ${FSLDIR}/tcl/fslstart.tcl
set FEEDSDIR [ exec pwd ]
puts "\nFSL Evaluation and Example Data Suite v$FEEDSVERSION\n"
set FSLVERSION [ exec cat ${FSLDIR}/etc/fslversion ]
if { [ string compare $FSLVERSION $FEEDSVERSION ] != 0 } {
puts "Warning - FSL version ($FSLVERSION) not the same as this test
suite version ($FEEDSVERSION)! Therefore this test may
not run...maybe you should download the latest version of
the test suite and/or FSL.\n"
}
puts "start time = [ exec date ]"
puts "hostname = [ exec hostname ]"
puts "os = [ exec uname -a ]\n"
fsl:exec "/bin/rm -rf $FEEDSDIR/results ; mkdir $FEEDSDIR/results"
set logout $FEEDSDIR/results/LOG
#}}}
# to add ASAP:
# filmbabe (make_flobs and filmbabe) / mm / randomise
#{{{ FUGUE
if { $feeds(fugue) } {
puts "\nStarting PRELUDE & FUGUE at [ exec date ]"
fsl:exec "${FSLDIR}/bin/prelude -c $FEEDSDIR/data/fieldmap -o $FEEDSDIR/results/unwrapped_phase"
perror unwrapped_phase 0.5
fsl:exec "${FSLDIR}/bin/fugue -i $FEEDSDIR/data/epi -p $FEEDSDIR/results/unwrapped_phase -d 0.295 -u $FEEDSDIR/results/unwarped_epi"
perror unwarped_epi 0.2
}
#}}}
#{{{ SUSAN
if { $feeds(susan) } {
puts "\nStarting SUSAN at [ exec date ]"
fsl:exec "${FSLDIR}/bin/susan_smooth $FEEDSDIR/data/structural 2000 $FEEDSDIR/results/structural_susan 2 3 1 0"
perror structural_susan 1
}
#}}}
#{{{ SIENAX
if { $feeds(sienax) } {
puts "\nStarting SIENAX (including testing BET and FLIRT and FAST) at [ exec date ]"
fsl:exec "${FSLDIR}/bin/imcp $FEEDSDIR/data/structural $FEEDSDIR/results/structural"
fsl:exec "cd $FEEDSDIR/results ; ${FSLDIR}/bin/sienax structural -d -r"
puts "checking error on BET:"
perror structural_brain 0.2
puts "checking error on FLIRT:"
perror structural_talmask 0.05
puts "checking error on FAST:"
puts "checking error on single-image binary segmentation:"
perror structural_talmaskbrain_seg 0.2
puts "checking error on partial volume images:"
perror structural_talmaskbrain_pve_0 0.03
perror structural_talmaskbrain_pve_1 0.03
perror structural_talmaskbrain_pve_2 0.03
puts "checking error on SIENAX volume outputs:"
foreach sienastats { pgrey vcsf GREY WHITE BRAIN } {
set r [ exec sh -c "grep $sienastats $FEEDSDIR/results/structural.sienax | awk '{ print \$2 }'" ]
set d [ exec sh -c "grep $sienastats $FEEDSDIR/data/structural.sienax | awk '{ print \$2 }'" ]
simpleperror $r $d 1600000
}
}
#}}}
#{{{ BET2
if { $feeds(bet2) } {
puts "\nStarting BET2 at [ exec date ]"
fsl:exec "/bin/cp $FEEDSDIR/data/head_t?.nii.gz $FEEDSDIR/results"
fsl:exec "cd $FEEDSDIR/results ; ${FSLDIR}/bin/betall head_t1 head_t2"
puts "checking error on T1 brain extraction:"
perror head_t1_brain 1
puts "checking error on skull and scalp surfaces:"
perror head_t1_brain_inskull_mesh .01
perror head_t1_brain_outskull_mesh .01
perror head_t1_brain_outskin_mesh .01
}
#}}}
#{{{ FEAT
if { $feeds(feat) } {
puts "\nStarting FEAT at [ exec date ]"
# fix FEAT setup file to use FEEDSDIR and FSLDIR
fsl:exec "cp ${FEEDSDIR}/data/fmri.feat/design.fsf ${FEEDSDIR}/results/design.fsf"
fsl:echo ${FEEDSDIR}/results/design.fsf "
set fmri(regstandard) ${FSLDIR}/etc/standard/avg152T1_brain
set feat_files(1) ${FEEDSDIR}/data/fmri
set highres_files(1) ${FEEDSDIR}/data/structural_brain
set fmri(outputdir) ${FEEDSDIR}/results/fmri.feat"
# run FEAT
fsl:exec "${FSLDIR}/bin/feat ${FEEDSDIR}/results/design.fsf"
puts "checking error on filtered functional data:"
perror fmri.feat/filtered_func_data 0.3
puts "checking error on raw Z stat images:"
perror fmri.feat/stats/zstat1 0.05
perror fmri.feat/stats/zstat2 0.05
perror fmri.feat/stats/zfstat1 0.05
puts "checking error on thresholded Z stat images:"
perror fmri.feat/thresh_zstat1 0.03
perror fmri.feat/thresh_zstat2 0.03
perror fmri.feat/thresh_zfstat1 0.03
#{{{ check error on largest cluster of Talairached zfstat1
puts "checking error on position of largest cluster of Talairached zfstat1:"
set iptr [ open ${FEEDSDIR}/data/fmri.feat/cluster_zfstat1_tal.txt r ]
gets $iptr line
gets $iptr line
scan $line "%f %f %f %f %f %f %f %f %f" D(1) D(2) D(3) D(4) D(5) D(6) D(7) D(8) D(9)
close $iptr
set iptr [ open ${FEEDSDIR}/results/fmri.feat/cluster_zfstat1_tal.txt r ]
gets $iptr line
gets $iptr line
scan $line "%f %f %f %f %f %f %f %f %f" R(1) R(2) R(3) R(4) R(5) R(6) R(7) R(8) R(9)
close $iptr
simpleperror $D(4) $R(4) 500
simpleperror $D(5) $R(5) 500
simpleperror $D(6) $R(6) 500
simpleperror $D(7) $R(7) 500
simpleperror $D(8) $R(8) 500
simpleperror $D(9) $R(9) 500
#}}}
}
#}}}
#{{{ MELODIC
if { $feeds(melodic) } {
puts "\nStarting MELODIC at [ exec date ]"
fsl:exec "${FSLDIR}/bin/melodic -i $FEEDSDIR/data/fmri -o $FEEDSDIR/results/fmri.ica --tr=3"
fsl:exec "${FSLDIR}/bin/avwcc $FEEDSDIR/data/fmri.ica/melodic_IC $FEEDSDIR/results/fmri.ica/melodic_IC > $FEEDSDIR/results/fmri.ica/avwcc.txt"
set MAXV 0
set MAXA 0
set iptr [ open $FEEDSDIR/results/fmri.ica/avwcc.txt r ]
while { ( [ gets $iptr line ] >= 0 ) } {
scan $line "%d %d %f" A B C
if { $A == 52 } {
if { $C > $MAXV } {
set MAXV $C
}
}
if { $A == 39 } {
if { $C > $MAXA } {
set MAXA $C
}
}
}
close $iptr
if { $MAXA < $MAXV } {
set MAXV $MAXA
}
simpleperror $MAXV 1 15
}
#}}}
#{{{ FDT
if { $feeds(fdt) } {
puts "\nStarting FDT (bedpost) at [ exec date ]"
fsl:exec "cp -r $FEEDSDIR/data/fdt_subj1 $FEEDSDIR/results"
fsl:exec "${FSLDIR}/bin/bedpost $FEEDSDIR/results/fdt_subj1"
puts "checking error on bedpost output:"
perror fdt_subj1.bedpost/dyadic_vectors .005
perror fdt_subj1.bedpost/mean_fsamples .005
perror fdt_subj1.bedpost/mean_phsamples .005
perror fdt_subj1.bedpost/mean_thsamples .005
perror fdt_subj1.bedpost/merged_fsamples .005
perror fdt_subj1.bedpost/merged_phsamples .005
perror fdt_subj1.bedpost/merged_thsamples .005
}
#}}}
#{{{ finish up
if { $MAXPERROR < $PTHRESH } {
puts "\nAll tests passed"
} else {
puts "\nWarning - not all tests passed"
}
puts "\nend time = [ exec date ]\n"
#}}}
|