Keith
On Wed, May 1, 2013 at 12:43 PM, Bruce Fischl fischl@nmr.mgh.harvard.edu wrote: Hi Keith
can you cc the list so that others can answer? Like Martin! thanks Bruce On Wed, 1 May 2013, Qi Wu wrote: Hi Bruce, Thank you so much for your quick reply. I used the following script to do the first step cross-sectional preprossessing #!/bin/tcsh -ef # add 'x' to '-ef' to trace code as it is executed ##### GO_FS1 - The "Easy" button ##### ##### Usage: GO_FS-123 <subjects directory name> ##### Feeds multiple subjects into autorecon1, autorecon2, and autorecon3 ##### Requires that original scan data be placed in $SUBJECTS_DIR/_orig_ ##### (Place each subject's anat series in separate folders) echo "\n <><><><><><><><><><><>< GO FreeSurfer! ><><><><><><><><><><><> \n" ### Check if subjects directory specified ### if ( "$1" != "" ) then set subjdir = $1 else echo "\n ERROR: No subjects directory specified \n" exit 1 endif ### Set FREESURFER_HOME and SUBJECTS_DIR ### setenv FREESURFER_HOME /usr/local/freesurfer5.1 if ( -e /data/keith/freesurferdata/subjects_longitudinal/$subjdir) then setenv SUBJECTS_DIR /data/keith/freesurferdata/subjects_longitudinal/$subjdir else echo "\n ERROR: Specified subjects directory does not exist \n" exit 1 endif ### Check if original scan data exists ### if ( ! -e /$SUBJECTS_DIR/_orig_ ) then echo "\n ERROR: Original scan data not found. \n" exit 1 endif ### disable functional tools ### setenv NO_FSFAST ##### (To enable functional tools, disable the above line, enable the following:) ##### (HAVE NOT TESTED THIS YET) (MAYBE BETTER IF NO_FSFAST ANYWAYS) #setenv FUNCTIONALS_DIR $FREESURFER_HOME/sessions # echo "FUNCTIONALS_DIR = $FUNCTIONALS_DIR" ##### (and add the following to ~/matlab/startup.m) #fsfasthome = getenv('FSFAST_HOME'); #fsfasttoolbox = sprintf('%s/toolbox',fsfasthome'); #path(path,fsfasttoolbox); ### Set up FreeSurfer ### setenv prompt source $FREESURFER_HOME/FreeSurferEnv.csh echo "" ### List out directories in _orig_ , set subj array, prompt to continue ### echo "Found the following subjects: \n" set i = 0 set subjID foreach d ($SUBJECTS_DIR/_orig_/*) @ i++ set subjID = ($subjID $d:t) echo " Subject "$i": " $subjID[$i] end set subjCount = $i set response while ($response != "n" && $response != "y") echo -n "\n Process these $subjCount subjects? [y/n] > " set response = $< end if ($response == "n") then echo "\n Program ended by user \n" exit 1 endif ### Prompt user for First Anat Filename's ### set firstAnatSame while ($firstAnatSame != "y" && $firstAnatSame != "n") echo -n "\n Are all the anat series named identically? [y/n]: > " set firstAnatSame = $< end switch ($firstAnatSame) case [y]: echo -n "\n Please enter the first filename (e.g. p1_000.dcm) for all anat series: > " set firstAnat = $< breaksw case [n]: echo "\n Please enter the first filename (e.g. p1_000.dcm) in the anat series for:" set i = 0 set firstAnat while ($i < $subjCount) @ i++ echo -n " "$subjID[$i]": > " set firstAnat = ($firstAnat $<) end breaksw endsw ### Run autorecon1 for each subject ### cd $SUBJECTS_DIR switch ($firstAnatSame) case [y]: set i = 0 while ($i < $subjCount) @ i++ echo "\n<><><><><><><><><><><><| NOW PROCESSING <"$subjID[$i]"> |><><><><><><><><><><><>\n" recon-all -i $SUBJECTS_DIR/_orig_/$subjID[$i]/$firstAnat -all -s $subjID[$i] end breaksw case [n]: set i = 0 while ($i < $subjCount) @ i++ echo "\n<><><><><><><><><><><><| NOW PROCESSING <"$subjID[$i]"> |><><><><><><><><><><><>\n" recon-all -i $SUBJECTS_DIR/_orig_/$subjID[$i]/$firstAnat[$i] -all -s $subjID[$i] end breaksw endsw echo "" date +"Finished $0 without error at %T on %a %b %d %Y" echo "" exit 0 ################### ### Simple working loop #set i = 0 #while ($i < 10) # echo $i # @ i++ #end ####################### ############# ### TO DO ### ############# # why don't env's remain 'set' after running this? (they do after running SetUpFreeSurfer.csh or FreeSurferEnv.csh) # why can't FS_FAST be set up? Then I did the "base" step and the "long" step with the following recon-all -base kp5_base -tp kp5 -tp k5b -all recon-all -long kp5 kp5_base -all recon-all -long kp5b kp5_base -all Keith On Wed, May 1, 2013 at 12:15 PM, Bruce Fischl <fischl@nmr.mgh.harvard.edu> wrote: Hi Keith what were the recon-all command lines you ran? Bruce On Wed, 1 May 2013, Qi Wu wrote: Dear Freesurfer experts, I have a dataset of 2 time points. I ran into problems when I tried to use the two-stage approach to pull out statistics such as the rate of change in Freesurfer 5.1. I could not even get the first stage working. The error messages I got were “ERROR: MRISar1: Surf/Src dimension mismatch” “ERROR -11 : mri_glmfit did not work?” I did further trouble-shooting for this particular message "nv1 = 140942, nv1 = 143525", and I found out that "143525" was in the "base" folder (kp5_base), and "140942" was for the two longitudinally registered images (kp5.long.kp5_base, and kp5b.long.kp5_base). The command line I used was : “long_mris_slopes --qdec ./qdec/AS_long_qdec.dat --meas thickness --hemi lh --do-avg --do-rate --do-pc1 --do-spc --do-stack --do-label --time weeks –nosmooth”. The first three lines in the qdec file: “fsid fsid-base weeks age sex FSS avgPain kp5 kp5_base 0 48 0 4.1 7 kp5b kp5_base 20 48 0 8.6 6” This error was similar to what was in apreviouspost(https://mail.nmr.mgh.harvard.edu/pipermail/freesurfer/2012-Jun e/024576 .htm l by joost janssen Jun 29, 2012). I tried to fix any similar problems, but still wasn’t able to get it working. What else could I have been doing wrong? The on screen error output is provided as follows Many thanks Keith Postdoctoral fellow Toronto Western Hospital Toronto, Ontario Canada *********************************** Parsing the qdec table: ./qdec/AS_long_qdec.dat Working in SUBJECTS_DIR: /data/keith/freesurferdata/subjects_longitudinal_5.1_old Subject-Template: kp5_base INFO: 2 TPs in kp5_base , mean age: 10.0===========================================================================
==== SUBJECT kp5_base Intersecting Within-Subject Cortex Labelcp/data/keith/freesurferdata/subjects_longitudinal_5.1_old/kp5.long.kp5_bas
e/label/lh.cortex.label/data/keith/freesurferdata/subjects_longitudinal_5.1_o
ld/kp5_base/label/lh. long.cortex.label mris_label_calcintersect/data/keith/freesurferdata/subjects_longitudinal_5. 1_old/kp5b.long .kp5_base/label/lh.cortex.label/data/keith/freesurferdata/subjects_longitudinal_5.1_
old/kp5_base/label/lh.long.cortex.label/data/keith/freesurferdata/subjects_longitudinal_5.1_old/k
p5_base/label/lh. long.cortex.label LabelWrite:savingto/data/keith/freesurferdata/subjects_longitudinal_5.1_old/kp5_base/l abel/l h. long.cortex.label===========================================================================
==== SUBJECT kp5_base Stackinbg Within-Subject Mapsmri_concat/data/keith/freesurferdata/subjects_longitudinal_5.1_old/kp5.long
.kp5_base/surf/lh.thickness/data/keith/freesurferdata/subjects_longitudinal_5.1_old/k
p5b.long.kp5_base /surf/lh.thickness--o/data/keith/freesurferdata/subjects_longitudinal_5.1_o ld/kp5_base/surf/l h.l ong.thickness-stack.mgh ninputs = 2 Checking inputs nframestot = 2 Allocing output Done allocing nframes = 2Writingto/data/keith/freesurferdata/subjects_longitudinal_5.1_old/kp5_base/ surf/lh .l ong.thickness-stack.mgh
===========================================================================
==== SUBJECT kp5_base Running Within-Subject GLM Writing ./tmp-kp5_base_lh_thickness_6PR2rH/X-long.mat ...mri_glmfit--y/data/keith/freesurferdata/subjects_longitudinal_5.1_old/kp5_b ase/surf/l h.l ong.thickness-stack.mgh --X ./tmp-kp5_base_lh_thickness_6PR2rH/X-long.mat --allow-zero-dof --no-contrasts-ok --surf kp5_baselh--label/data/keith/freesurferdata/subjects_longitudinal_5.1_old/kp5_base/ la bel/lh. long.cortex.label --glmdir ./tmp-kp5_base_lh_thickness_6PR2rH/glm
Readingsourcesurface/data/keith/freesurferdata/subjects_longitudinal_5.1_old/kp5_b ase/su rf/lh.w hite Number of vertices 143525 Number of faces 287046 Total area 91438.851562 AvgVtxArea 0.637094 AvgVtxDist 0.873064 StdVtxDist 0.245806 $Id: mri_glmfit.c,v 1.196.2.6 2011/05/05 20:54:25 greve Exp $ cwd /data/keith/freesurferdata/subjects_longitudinal_5.1_oldcmdlinemri_glmfit--y/data/keith/freesurferdata/subjects_longitudinal_5.1_old/kp5_b ase/surf/l h.l ong.thickness-stack.mgh --X ./tmp-kp5_base_lh_thickness_6PR2rH/X-long.mat --allow-zero-dof --no-contrasts-ok --surf kp5_baselh--label/data/keith/freesurferdata/subjects_longitudinal_5.1_old/kp5_base/ la bel/lh. long.cortex.label --glmdir ./tmp-kp5_base_lh_thickness_6PR2rH/glm
sysname Linux
hostname davissvr1.uhnres.utoronto.ca
machine x86_64
user qwu
FixVertexAreaFlag = 1
UseMaskWithSmoothing 1
OneSampleGroupMean 0
y/data/keith/freesurferdata/subjects_longitudinal_5.1_old/kp5_base/surf/lh.
l ong.thickness-stack.mgh
logyflag 0
X ./tmp-kp5_base_lh_thickness_6PR2rH/X-long.mat
usedti 0
labelmask/data/keith/freesurferdata/subjects_longitudinal_5.1_old/kp5_base/
label/lh. long.cortex.label
maskinv 0
glmdir ./tmp-kp5_base_lh_thickness_6PR2rH/glm
IllCondOK 0
ReScaleX 1
DoFFx 0
Creating output directory ./tmp-kp5_base_lh_thickness_6PR2rH/glm
Loadingyfrom/data/keith/freesurferdata/subjects_longitudinal_5.1_old/kp5_base/surf / lh.l ong.thickness-stack.mgh
Saving design matrix to ./tmp-kp5_base_lh_thickness_6PR2rH/glm/Xg.dat
Normalized matrix condition is 1
Matrix condition is 10
Found 131455 points in label.
ERROR: mri_reshape: number of elements cannot change
nv1 = 143525, nv1 = 140942
Pruning voxels by thr: 0.000000
Found 134956 voxels in mask
Saving mask to ./tmp-kp5_base_lh_thickness_6PR2rH/glm/mask.mgh
Reshaping mriglm->mask...
ERROR: mri_reshape: number of elements cannot change
nv1 = 140942, nv1 = 143525
search space = 91439.090793
DOF = 0
Starting fit and test
Fit completed in 0.0042 minutes
Computing spatial AR1 on surface
ERROR: MRISar1: Surf/Src dimension mismatch.
ERROR -11 : mri_glmfit did not work?
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
freesurfer@nmr.mgh.harvard.edu