Print

Print


Dear Conny,

The raw parameter estimates are really in arbitrary units with a scaling
depending on both your design matrix and the values of the data you were
modeling.  So to get % BOLD signal change you need to take both factors
into account.  If you multiply the PE value by the difference between the
max and min height of the EV (after convolution, if present) and then
divide the result by the mean value of the time series in that
voxel/region, you end up with what you want.

I've written a simple script which does this (and I think I've posted it
before).  But I've attached a copy to the end of this email in case you
find it useful.  One of these days I'll make it slightly more general and
put a nice front end on it, but until that time, using it requires a little
shell scripting knowledge and a well structured dataset.

Hope this is helpful.

Joe

--------------------
Joseph T. Devlin, Ph. D.
FMRIB Centre, Dept. of Clinical Neurology
University of Oxford
John Radcliffe Hospital
Headley Way, Headington
Oxford OX3 9DU
Phone: 01865 222 738
Email:  [log in to unmask]




EFFECT.SH


#!/bin/ksh

#
# This script retrives the mean parameter estimates from an antomical
# ROI and the baseline signal in the whole brain for computing mean
# effect sizes in a region.
#

#
# Specify the path for the subject directories
#
ORIG_PATH=~/scratch

#
# Specify the subject directories
#
DIRS="6235 6236 6247 6248 6301 6302 6314 6334 6335 6346 6347 6348"

#
# Specify the sessions
#
SESS="session_A+ session_B+"

#
# Specify the pes you want to retrieve.
#
FILES="pe1 pe3 pe5"

#
# Adjust the header to reflect your individual conditions
#
print "SESSION    EV1    EV2   EV3    Baseline"

#
# Specify the anatomical mask of the ROI.  The mask should be in standard
# space for the following code to work without modification.
#
MASK=~/masks/left_pars_triangularis

#------------------------------------------------------------------------------------------\
---------------------------
# Shouldn't need to change anything below this point
#------------------------------------------------------------------------------------------\
---------------------------

TMP=/tmp/$$


for D in $DIRS; do
   for S in $SESS; do
     print -n "${D}/${S}  "

     for F in $FILES; do
         # Put the EPI image into standard space

       flirt -in $ORIG_PATH/$D/$S.feat/stats/$F \
             -ref /usr/local/fsl/etc/standard/avg152T1_brain -applyxfm \
             -init $ORIG_PATH/$D/$S.feat/reg/example_func2standard.mat \
             -out $TMP

         # Mask it and compute the mean PE in the mask
       avwmaths $TMP -mas $MASK $TMP
       MEAN=$(avwstats $TMP -M)

         # Adjust the signal to reflect percent signal change
       COLUMN=${F#pe}
       DESIGN=$(awk 'BEGIN { column = '"$COLUMN"' ; mn = 0; mx = 0 } \
            matrix == 1 { if ($column < mn) mn=$column; \
                          if ($column > mx) mx=$column }\
            /Matrix/ { matrix = 1 }\
            END { printf("%0.3f\n", mx-mn ) }'
$ORIG_PATH/$D/$S.feat/design.mat)
       awk 'BEGIN {printf("%0.3f     ", '"$MEAN"' * '"$DESIGN"') }'
$ORIG_PATH/$D/$S.feat/de\
sign.mat
     done

     # Finally, compute the baseline signal over the whole brain for this mask.
     print $(avwstats $ORIG_PATH/$D/$S.feat/filtered_func_data -M)
   done
done
rm $TMP.img $TMP.hdr