External Email - Use Caution
Hi,
I’ve encountered a few issues when performing GLM using an average subject that I have created (named avgsubject.Controls2),
Essentially, the glm_preproc command fails because it is now unable to find the ‘source surface reg’, which it lists as avgsubject.Controls2.sphere.reg in the linux outputs (see below). This already seems odd to me, as I would have thought this would be the target surface reg, as avgsubject.Controls2 is the target.
The error occurs because it is trying to find the file within the VIPD_014/surf directory (whereby VIPD_014 is the first subject in our fsgd file). Oddly enough, the file does exist, but within the avgsubject.Controls2/surf directory instead! I was going to copy this file into all the participant’s subject/surf directories that are listed within the fsgd file, but it seems like this is not really the right way of doing it, and there must be a reason why it hasn’t ended up in the expected directories.
Is there a way to edit the glm_preproc script so that it directs it to find the avgsubject.sphere.reg file within the avgsubject folder instead, or perhaps to correct the 'source surface reg' to be lh.sphere.reg (which is found within the subject/surf directory)?
I’m not sure if this is related, but when looking at the fsaverage folder (where fsaverage is the average subject created by freesurfer) vs the avgsubject.Controls2 folder, I noticed the latter contains ‘reg.template.tif’ files for both hemispheres - which the fsaverage folder lacks. The other fsaverage folders created by freesurfer found within the freesurfer directory (fsaverage3, 4, 5, 6 and freesurfer_sym) do contain these tif files.
It’s probably also worth noting that when I created avgsubject, it said “completed with errors” - but when I looked in the error log it didn’t tell us any information on what the errors were. This happens for all the different avgsubjects we have created.
Below I describe the commands used for each step:
#make_average_subject
ebunting@img-140:.../MRI_data/freesurfer$ make_average_subject --out avgsubject.Controls2 --subjects VIPD_007 VIPD_015 VIPD_017 VIPD_028 VIPD_038 VIPD_068 VIPD_069 VIPD_078 VIPD_104 VIPD_105 VIPD_108 VIPD_111 VIPD_115 VIPD_117 VIPD_118 VIPD_119 VIPD_120 VIPD_126 VIPD_142 VIPD_145 VIPD_146 VIPD_160 VIPD_167 VIPD_177 VIPD_180 VIPD_193 VIPD_234 VIPD_257 VIPD_272 VIPD_274 VIPD_275 VIPD_276 VIPD_277 VIPD_280 VIPD_404 VIPD_406 VIPD_601
#n.b. this exited 'with errors'. Details of the recon-all log is attached as “avgsubject.Controls2/scripts/recon-all.log”
#The linux outputs when using this command are also attached in a file named “linux outputs for making avgsubject.Controls2”
#Preprocessing for GLM analysis
ebunting@img-140:.../MRI_data/freesurfer$ mris_preproc --fsgd VIPD_014_SingleSubject.New.fsgd \
--target avgsubject.Controls2 \
--hemi lh \
--meas thickness \
--out lh.VIPD_014_SingleSubject.New.Controls2.thickness.00.mgh \
nsubjects = 38
tmpdir is ./tmp.mris_preproc.984
/var/drc/research/visioninpd/home_study_2017_data/MRI_data/freesurfer
Log file is lh.VIPD_014_SingleSubject.New.Controls2.thickness.00.mris_preproc.log
Fri Jan 11 10:47:34 GMT 2019
setenv SUBJECTS_DIR /var/drc/research/visioninpd/home_study_2017_data/MRI_data/freesurfer
cd /var/drc/research/visioninpd/home_study_2017_data/MRI_data/freesurfer
/var/drc/software/64bit/freesurfer/bin/mris_preproc --fsgd VIPD_014_SingleSubject.New.fsgd --target avgsubject.Controls2 --hemi lh --meas thickness --out lh.VIPD_014_SingleSubject.New.Controls2.thickness.00.mgh
Linux img-140.drc.ion.ucl.ac.ukhttp://drc.ion.ucl.ac.uk 2.6.32-279.el6.x86_64 #1 SMP Wed Jun 13 18:24:36 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux
$Id: mris_preproc,v 1.76.2.1 2016/08/12 17:55:45 zkaufman Exp $
freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.0-2beb96c
tmpdir is ./tmp.mris_preproc.984
Src lh avgsubject.Controls2.sphere.reg
Trg lh sphere.reg
---------------------------------------------------
#@# 1/38 VIPD_014 Fri Jan 11 10:47:34 GMT 2019 --------------
-----------------------
mri_surf2surf --srcsubject VIPD_014 --srchemi lh --srcsurfreg avgsubject.Controls2.sphere.reg --trgsubject avgsubject.Controls2 --trghemi lh --trgsurfreg sphere.reg --tval ./tmp.mris_preproc.984/VIPD_014.1.mgh --sval /var/drc/research/visioninpd/home_study_2017_data/MRI_data/freesurfer/VIPD_014/surf/lh.thickness --sfmt curv --noreshape --cortex
MRISread(/var/drc/research/visioninpd/home_study_2017_data/MRI_data/freesurfer/VIPD_014/surf/lh.avgsubject.Controls2.sphere.reg): could not open file
Source registration surface changed to avgsubject.Controls2.sphere.reg
Target registration surface changed to sphere.reg
$Id: mri_surf2surf.c,v 1.103 2015/11/05 22:07:33 greve Exp $
setenv SUBJECTS_DIR /var/drc/research/visioninpd/home_study_2017_data/MRI_data/freesurfer
cd /var/drc/research/visioninpd/home_study_2017_data/MRI_data/freesurfer
mri_surf2surf --srcsubject VIPD_014 --srchemi lh --srcsurfreg avgsubject.Controls2.sphere.reg --trgsubject avgsubject.Controls2 --trghemi lh --trgsurfreg sphere.reg --tval ./tmp.mris_preproc.984/VIPD_014.1.mgh --sval /var/drc/research/visioninpd/home_study_2017_data/MRI_data/freesurfer/VIPD_014/surf/lh.thickness --sfmt curv --noreshape --cortex
sysname Linux
hostname img-140.drc.ion.ucl.ac.ukhttp://drc.ion.ucl.ac.uk
machine x86_64
user ebunting
srcsubject = VIPD_014
srcval = /var/drc/research/visioninpd/home_study_2017_data/MRI_data/freesurfer/VIPD_014/surf/lh.thickness
srctype = curv
trgsubject = avgsubject.Controls2
trgval = ./tmp.mris_preproc.984/VIPD_014.1.mgh
trgtype =
srcsurfreg = avgsubject.Controls2.sphere.reg
trgsurfreg = sphere.reg
srchemi = lh
trghemi = lh
frame = 0
fwhm-in = 0
fwhm-out = 0
label-src = lh.cortex.label
label-trg = lh.cortex.label
OKToRevFaceOrder = 1
UseDualHemi = 0
Reading source surface reg /var/drc/research/visioninpd/home_study_2017_data/MRI_data/freesurfer/VIPD_014/surf/lh.avgsubject.Controls2.sphere.reg
No such file or directory
mri_surf2surf: could not read surface /var/drc/research/visioninpd/home_study_2017_data/MRI_data/freesurfer/VIPD_014/surf/lh.avgsubject.Controls2.sphere.reg
No such file or directory
#N.b. Outputs when compared to using fsaverage as the target:
ebunting@img-140:.../MRI_data/freesurfer$ mris_preproc --fsgd VIPD_014_SingleSubject.New.fsgd \
--target fsaverage \
--hemi lh \
--meas thickness \
--out lh.VIPD_014_SingleSubject.New.thickness.00.mgh \
nsubjects = 38
tmpdir is ./tmp.mris_preproc.27392
/var/drc/research/visioninpd/home_study_2017_data/MRI_data/freesurfer
Log file is lh.VIPD_014_SingleSubject.New.thickness.00.mris_preproc.log
Thu Jan 10 16:24:36 GMT 2019
setenv SUBJECTS_DIR /var/drc/research/visioninpd/home_study_2017_data/MRI_data/freesurfer
cd /var/drc/research/visioninpd/home_study_2017_data/MRI_data/freesurfer
/var/drc/software/64bit/freesurfer/bin/mris_preproc --fsgd VIPD_014_SingleSubject.New.fsgd --target fsaverage --hemi lh --meas thickness --out lh.VIPD_014_SingleSubject.New.thickness.00.mgh
Linux img-140.drc.ion.ucl.ac.ukhttp://drc.ion.ucl.ac.uk 2.6.32-279.el6.x86_64 #1 SMP Wed Jun 13 18:24:36 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux
$Id: mris_preproc,v 1.76.2.1 2016/08/12 17:55:45 zkaufman Exp $
freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.0-2beb96c
tmpdir is ./tmp.mris_preproc.27392
Src lh sphere.reg
Trg lh sphere.reg
---------------------------------------------------
#@# 1/38 VIPD_014 Thu Jan 10 16:24:36 GMT 2019 --------------
-----------------------
mri_surf2surf --srcsubject VIPD_014 --srchemi lh --srcsurfreg sphere.reg --trgsubject fsaverage --trghemi lh --trgsurfreg sphere.reg --tval ./tmp.mris_preproc.27392/VIPD_014.1.mgh --sval /var/drc/research/visioninpd/home_study_2017_data/MRI_data/freesurfer/VIPD_014/surf/lh.thickness --sfmt curv --noreshape --cortex
Source registration surface changed to sphere.reg
Target registration surface changed to sphere.reg
$Id: mri_surf2surf.c,v 1.103 2015/11/05 22:07:33 greve Exp $
setenv SUBJECTS_DIR /var/drc/research/visioninpd/home_study_2017_data/MRI_data/freesurfer
cd /var/drc/research/visioninpd/home_study_2017_data/MRI_data/freesurfer
mri_surf2surf --srcsubject VIPD_014 --srchemi lh --srcsurfreg sphere.reg --trgsubject fsaverage --trghemi lh --trgsurfreg sphere.reg --tval ./tmp.mris_preproc.27392/VIPD_014.1.mgh --sval /var/drc/research/visioninpd/home_study_2017_data/MRI_data/freesurfer/VIPD_014/surf/lh.thickness --sfmt curv --noreshape --cortex
sysname Linux
hostname img-140.drc.ion.ucl.ac.ukhttp://drc.ion.ucl.ac.uk
machine x86_64
user ebunting
srcsubject = VIPD_014
srcval = /var/drc/research/visioninpd/home_study_2017_data/MRI_data/freesurfer/VIPD_014/surf/lh.thickness
srctype = curv
trgsubject = fsaverage
trgval = ./tmp.mris_preproc.27392/VIPD_014.1.mgh
trgtype =
srcsurfreg = sphere.reg
trgsurfreg = sphere.reg
srchemi = lh
trghemi = lh
frame = 0
fwhm-in = 0
fwhm-out = 0
label-src = lh.cortex.label
label-trg = lh.cortex.label
OKToRevFaceOrder = 1
UseDualHemi = 0
Reading source surface reg /var/drc/research/visioninpd/home_study_2017_data/MRI_data/freesurfer/VIPD_014/surf/lh.sphere.reg
Loading source data
Reading curvature file /var/drc/research/visioninpd/home_study_2017_data/MRI_data/freesurfer/VIPD_014/surf/lh.thickness
Reading source subject label mask lh.cortex.label
masking the input
Reading target surface reg /var/drc/research/visioninpd/home_study_2017_data/MRI_data/freesurfer/fsaverage/surf/lh.sphere.reg
Done
Using surf2surf_nnfr()
Mapping Source Volume onto Source Subject Surface
surf2surf_nnfr: building source hash (res=16).
Surf2Surf: Forward Loop (163842)
surf2surf_nnfr: building target hash (res=16).
Surf2Surf: Reverse Loop (156736)
Reverse Loop had 34296 hits
Surf2Surf: Dividing by number of hits (163842)
INFO: nSrcLost = 0
nTrg121 = 138772, nTrgMulti = 25070, MnTrgMultiHits = 2.36801
nSrc121 = 123084, nSrcLost = 0, nSrcMulti = 33652, MnSrcMultiHits = 2.2303
Reading target space mask label lh.cortex.label
masking the input
Saving target data
Saving to ./tmp.mris_preproc.27392/VIPD_014.1.mgh
#… and this continues for each subject within the fsgd file.
#the mris_surf2surf command then works as normal using:
mri_surf2surf --hemi lh --s avgsubject.Controls2 --sval lh.VIPD_014_SingleSubject.New.thickness.00.mgh --fwhm 10 --cortex --tval lh.VIPD_014_SingleSubject.New.avgsubject.Controls2.thickness.10B.mgh
–> THIS WORKS, BUT IT IS USING lh.VIPD_014_SingleSubject.New.thickness.00.mgh as the input file, which was created using fsaverage – so I am unsure how valid this is to use.
#glm_fit command works as normal using:
ebunting@img-140:.../MRI_data/freesurfer$ mri_glmfit \
--y lh.VIPD_014_SingleSubject.New.avgsubject.Controls2.thickness.10B.mgh \
--fsgd VIPD_014_SingleSubject.New.fsgd \
--C SingleSubject.1,-1.mtx --C SingleSubject.1,0.mtx --C SingleSubject.0,1.mtx --C SingleSubject.0.5,0.5.mtx \
--surf avgsubject.Controls2 lh \
--cortex \
--glmdir lh.VIPD_014_SingleSubject.avgsubject.Controls2.0 \
gdfRead(): reading VIPD_014_SingleSubject.New.fsgd
#n.b. output logs for both these commands are attached in case you want to examine them too
….So essentially the GLM analysis works fine, as long as the mri_preproc step is skipped. I feel unsure about the surf2surf analysis using an input file that was created using fsaverage as the target in the mri_preproc step – hence I'm trying to figure out why the mri_preproc step won't work.
Any help would be greatly appreciated!
Many thanks,
Emma Bunting
freesurfer@nmr.mgh.harvard.edu