Thank you Doug,

Hi Yuko, I think you must have an older version of glmfit-sim some  how. 
I've put a newer version here:

I replaced the /bin/mri_glmfit-sim, but got the same error.

[ERROR 1]
In line 292:
set csdCache = $CacheDir/$subject/$hemi/$CacheLabel/fwhm$fwhmStr/$simsign/th$threshStr/mc-z.csd

In stead of making 
csdCache = /Applications/freesurfer/average/mult-comp-cor/fsaverage/lh/cortex/fwhm15/pos/th30/mc-z.csd
it did
csdCache = /Applications/freesurfer/average/mult-comp-cor///cortex/fwhm15/pos/th30/mc-z.csd

It looks like I failed to tell freesurfer that $subject=fsaverage and $hemi=lh.

I changed this line to:
set csdCache = $CacheDir/fsaverage/lh/$CacheLabel/fwhm$fwhmStr/$simsign/th$threshStr/mc-z.csd

and this worked. But I still don't understand why I got the error with mri_glmfit-sim.

[ERROR 2]
In line 93, anattype is set to volume, but I'm doing surface analysis.
set anattype = volume;
Changing this to set anattype = surface; worked, but does this mean mri_glmfit-sim is specialized for volume analysis only?
Is there a way to change this in the command line not in the original code?

Best,
Yuko


Hi Yuko, I think you must have an older version of glmfit-sim some  how. 
I've put a newer version here:
ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/mri_glmfit-sim-v5.0
copy this to your $FREESURFER_HOME/bin/mri_glmfit-sim (ie, change the 
name; and make a backup copy).
doug

On Nov 23, 2011, at 2:07 PM, yukoyy wrote:

Hello

I'm having a trouble with mri_glmfit-sim with v5.0, which is locally installed on Mac 10.6.8.

Whan I ran:
mri_glmfit-sim --glmdir MPglm.wls --cache 3.0 pos --cwpvalthresh .0166

I got:
ERROR: cannot find /Applications/freesurfer/average/mult-comp-cor///cortex/fwhm15/pos/th30/mc-z.csd

I have
/Applications/freesurfer/average/mult-comp-cor/fsaverage/lh/cortex/fwhm15/pos/th30/mc-z.csd
in my directory.

It looks like I need to somehow tell freesurfer "/fsaverage/lh/", but how?

Before mri_glmfit-sim, I did the followings:
isxconcat-sess -df sessdirfile -sf sessidlist -analysis PreL -hemi lh -c 16vs4 -o MPgroup
mri_glmfit --y ces.008.nii --wls cesvar.008.nii --osgm --surface fsaverage lh --glmdir MPglm.wls --nii.gz


% -------------------------------------------------------------------------
Also, when I did:
mri_glmfit-sim --glmdir MPglm.wls --sim mc-z 100 2 mc-z.abs.2 --sim-sign abs --overwrite

I got several warnings and errors (full error message pasted at the end of this email):
cmdline mri_glmfit --y ces.008.nii --wls cesvar.008.nii --osgm --surface fsaverage lh --glmdir MPglm.wls --nii.gz
WARNING: unrecognized mri_glmfit cmd option --surface
WARNING: unrecognized mri_glmfit cmd option fsaverage
WARNING: unrecognized mri_glmfit cmd option lh
WARNING: unrecognized mri_glmfit cmd option --nii.gz
....
mri_glmfit --y /Users/kawabata/Documents/freesurfer/sessions/MP/MEAN/MPgroup/PreL/16vs4/ces.008.nii --C
MPglm.wls/tmp.mri_glmfit-sim-6456/osgm.mtx --mask MPglm.wls/mask.nii.gz --sim mc-z 100 2 MPglm.wls/csd
/mc-z.abs.2.j001 --sim-sign abs --fwhm 15.248189 --X MPglm.wls/Xg.dat --wls /Users/kawabata/Documents/freesurfer
/sessions/MP/MEAN/MPgroup/PreL/16vs4/cesvar.008.nii
Bus error

I don't understand why mri_glmfit-sim calls mri_glmfit, and gives warnings? When I paste "mri_glmfit --y ces.008.nii --wls cesvar.008.nii --osgm --surface fsaverage lh --glmdir MPglm.wls --nii.gz" in the command line, it works without any error.

Thanks in advance!
Yuko Yotsumoto


% full error message regarding the second question -------------------------------------------
cmdline mri_glmfit --y ces.008.nii --wls cesvar.008.nii --osgm --surface fsaverage lh --glmdir MPglm.wls --nii.gz
WARNING: unrecognized mri_glmfit cmd option --surface
WARNING: unrecognized mri_glmfit cmd option fsaverage
WARNING: unrecognized mri_glmfit cmd option lh
WARNING: unrecognized mri_glmfit cmd option --nii.gz
log file is MPglm.wls/mc-z.abs.2.mri_glmfit-sim.log
cd /Users/kawabata/Documents/freesurfer/sessions/MP/MEAN/MPgroup/PreL/16vs4
/Applications/freesurfer/bin/mri_glmfit-sim
--glmdir MPglm.wls --sim mc-z 100 2 mc-z.abs.2 --sim-sign abs --overwrite

$Id: mri_glmfit-sim,v 1.24.2.5 2010/07/27 22:49:00 greve Exp $
Wed Nov 23 13:55:01 JST 2011
Darwin Hideaki-Kawabata-no-MacBook-Pro.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun  7 16:32:41 PDT 2011; root:xnu-1504.15.3~1/RELEASE_X86_64 x86_64
kawabata
setenv SUBJECTS_DIR /Users/kawabata/Documents/freesurfer/subjects
FREESURFER_HOME /Applications/freesurfer
DoSim = 1
UseCache = 0
DoPoll = 0
DoPBSubmit = 0
DoBackground = 0
DiagCluster = 0
gd2mtx = dods
fwhm = 15.248189
nSimPerJob = 100
1/1 Wed Nov 23 13:55:01 JST 2011
mri_glmfit --y /Users/kawabata/Documents/freesurfer/sessions/MP/MEAN/MPgroup/PreL/16vs4/ces.008.nii --C MPglm.wls/tmp.mri_glmfit-sim-6456/osgm.mtx --mask MPglm.wls/mask.nii.gz --sim mc-z 100 2 MPglm.wls/csd/mc-z.abs.2.j001 --sim-sign abs --fwhm 15.248189 --X MPglm.wls/Xg.dat --wls /Users/kawabata/Documents/freesurfer/sessions/MP/MEAN/MPgroup/PreL/16vs4/cesvar.008.nii
Bus error

-----------------------------------
Yuko Yotsumoto, Ph. D.
Associate Professor (research)
The Global Centers of Excellence Program, Keio University

TEL:011-81-3-5427-1156 x 23851
e-mail: yukoyy@a7.keio.jp
HP  : http://web.keio.jp/~yukoyy/
------------------------------------