All 4 entries tagged Fsl

No other Warwick Blogs use the tag Fsl on entries | View entries tagged Fsl at Technorati | There are no images tagged Fsl on this blog

October 28, 2012

Standardizing DVARS

Writing about web page http://go.warwick.ac.uk/tenichols/scripts/fsl#DVARS

Multiple authors have found the spatial standard deviation of the temporal difference data useful for detecting anomalous or artifactual scans in fMRI. Called DVARS by Power et al. (NeuroImage, 59(3), 2142-54), this measure is useful but lacks interpretable units. In particular, the nominal value of DVARS reflects both the temporal standard deviation and the degree of temporal autocorrelation.

I’ve created a simple approach to standardize DVARS, attempting to remove the dependence on temporal standard deviation and autocorrelation. See my notes on Standardizing DVARS and a FSL script DVARS.sh to implement this new version of DVARS.


February 28, 2012

FSL Scripts

Writing about web page http://go.warwick.ac.uk/tenichols/scripts/fsl

I have recently uploaded a number of FSL scripts which folks might find useful. See my FSL scripts page for details, but the new ones include
  • fslstats.sh Allows you to use fslstats with multiple files
  • fsl_fdr.sh Gives a much nicer interface to FDR results in FSL
  • Dummy.sh Creates dummy variables, handy for manual/scripted creation of design matrices.

November 12, 2011

Flame without 1st level directories – copes only.

Follow-up to Flame without 1st level directories from Neuroimaging Statistics Tips & Tools

My earlier post described how to get the basic FEAT second-level results when you just have a stack of COPE and VARCOPE images. In fact, you don’t even need the VARCOPE images.

If you just have the COPE images, in the flameo call omit --vc=4dvarcope (which you don’t have) and replace the --runmode=flame1 with --runmode=ols and you should be all set.


October 27, 2010

Flame without 1st level directories

FSL’s fMRI modelling tool, FEAT, is a great tool and is easy to use if you use FSL from start to finish, in the recommended fashion. However, sometimes you might want to get FEAT group results when you don’t have all of the individual 1st level FEAT directories. This tip is for the case when you have just the 4D COPE image and the 4D VARCOPE images (all subjects, of course, already in MNI space), and you just want to do a one-sample t-test.

In the code below, I’m assuming that the following files are around:
  • 4dcope 4D COPE image
  • 4dvarcope 4D VARCOPE image
  • design.mat, design.con and design.con for a 1-sample t-test; use Glm_gui if you need help creating these.
  • mask mask image
  • example_func an example image for ‘underlay’ in the figures
$FSLDIR/bin/flameo --cope=4dcope --vc=4dvarcope --mask=mask --ld=stats --dm=design.mat --cs=design.grp --tc=design.con --runmode=flame1
echo $($FSLDIR/bin/fslnvols 4dcope) - 1 | bc -l  > stats/dof
/bin/rm -f stats/zem* stats/zols* stats/mask*
$FSLDIR/bin/smoothest -d $(cat stats/dof) -m mask -r stats/res4d > stats/smoothness
rm -f stats/res4d*
awk '/VOLUME/ {print $2}' stats/smoothness > thresh_zstat1.vol
awk '/DLH/ {print $2}' stats/smoothness > thresh_zstat1.dlh
$FSLDIR/bin/fslmaths stats/zstat1 -mas mask thresh_zstat1
$FSLDIR/bin/cluster -i thresh_zstat1 -c stats/cope1 -t 2.3 -p 0.05 -d $(cat thresh_zstat1.dlh) --volume=$(cat thresh_zstat1.vol) --othresh=thresh_zstat1 -o cluster_mask_zstat1 --connectivity=26 --mm --olmax=lmax_zstat1_tal.txt > cluster_zstat1_std.txt
$FSLDIR/bin/cluster2html . cluster_zstat1 -std
MinMax=$($FSLDIR/bin/fslstats thresh_zstat1 -l 0.0001 -R)
$FSLDIR/bin/overlay 1 0 example_func -a thresh_zstat1 $MinMax rendered_thresh_zstat1
$FSLDIR/bin/slicer rendered_thresh_zstat1 -S 2 750 rendered_thresh_zstat1.png
/bin/cp $FSLDIR/etc/luts/ramp.gif .ramp.gif

You don’t get the full, pretty output from FEAT, but you do get a pretty PNG overlay, and the HTML table of significant clusters. Generalizing to more complicated group-level models is simply a matter of changing the design.mat and design.con files, and adjusting the degrees-of-freedom calculation on the second line.

This is really just a quick hack. I hope it is of some use.

Quick addition: The code above gives you corrected cluster-wise inference. To get corrected voxel-wise inference, replace the line with the ”$FSLDIR/bin/cluster” command with these four lines:
RESELcount=$(awk '$1~/VOLUME/{v=$2};$1~/RESELS/{r=$2};END{printf("%g",1.0*v/r)}' stats/smoothness)
FWEthresh=$(ptoz 0.05 -g $RESELcount)
$FSLDIR/bin/fslmaths thresh_zstat1 -thr $FWEthresh thresh_zstat1
$FSLDIR/bin/cluster -i thresh_zstat1 -c stats/cope1 -t $FWEthresh --othresh=thresh_zstat1 -o cluster_mask_zstat1 --connectivity=26 --mm --olmax=lmax_zstat1_tal.txt > cluster_zstat1_std.txt
Or, if you want to use an uncorrected threshold, use this snippet instead (replacing 2.3 with your favorite threshold).
UnCorrThresh=2.3
$FSLDIR/bin/cluster -i thresh_zstat1 -c stats/cope1 -t $UnCorrThresh --othresh=thresh_zstat1 -o cluster_mask_zstat1 --connectivity=26 --mm --olmax=lmax_zstat1_tal.txt > cluster_zstat1_std.txt

Search this blog

Tags

Most recent comments

  • Hi This doesn't really address the issue at hand (powerpoint to html), but an alternative and very e… by Rose on this entry
  • @Michael. You are a SAINT. BLESS. by emma riley on this entry
  • I look this up every couple of years, and always struggle with it, so here are some notes for improv… by johann beda on this entry
  • I love this quote: "Complete reporting of results, i.e. filing of statistical maps in public reposit… by Kevin Black on this entry
  • Taylor: I've just quickly scanned the BrainVoyager documentation, and it appears that the Cluster–Le… by Thomas Nichols on this entry

Blog archive

Loading…
RSS2.0 Atom
Not signed in
Sign in

Powered by BlogBuilder
© MMXVII