Hi Bruce, After exhausting all of our options, Tali Swisher informed me that I should contact you. I have been trying to run freesurfer on a brain and have been running into a lot of problems. After first running: recon-all -i nifti-files/002-t1w-realign-masked.nii.gz -autorecon1 -noskullstrip -subjid 002 && cp subjects/002/mri/T1.mgz subjects/002/mri/brainmask.mgz && recon-all -autorecon2 -subjid 002 && recon-all -autorecon3 -subjid 002 the process stopped within 10 minutes with a talairach_afd error.
I followed our instructions ( https://intweb.spl.harvard.edu/Freesurfer_Notes#Stopping_after_talairach_afd) to create the xformed-t1w.xfm file, and compared it with the talairach.xfm file in the subjects/002/mri/transforms folder. Since they were different, I replaced the values in the talairach.xfm file with the ones from the xformed-t1w.xfm file (side note: the xformed-t1w is 4x4 and talairach.xfm is 3x4-- i attempted both including the last line and excluding it; to no avail).
Afterwards, I ran the script: recon-all -autorecon1 -notal-check -noskullstrip -subjid 002 && cp subjects/002/mri/T1.mgz subjects/002/mri/brainmask.mgz && recon-all -autorecon2 -subjid 002 && recon-all -autorecon3 -subjid 002
and while I got past the initial 20 minutes, I ended up exiting with errors. I have included the entire process below, but highlighted areas I believe to be problems:
<121> pnl-d6-4 /projects/schiz/ra/eli/ freesurfer5.1 % source SetUpFreeSurfer.csh -------- freesurfer-Linux-centos4_x86_64-stable-pub-v5.1.0 -------- Setting up environment for FreeSurfer/FS-FAST (and FSL) FREESURFER_HOME /projects/schiz/ra/eli/freesurfer5.1 FSFAST_HOME /projects/schiz/ra/eli/freesurfer5.1/fsfast FSF_OUTPUT_FORMAT nii.gz SUBJECTS_DIR /projects/schiz/ra/eli/freesurfer5.1/subjects MNI_DIR /projects/schiz/ra/eli/freesurfer5.1/mni FSL_DIR /projects/schiz/software/fsl-4.1-64bit <122> pnl-d6-4 /projects/schiz/ra/eli/freesurfer5.1 % recon-all -autorecon1 -notal-check -noskullstrip -subjid 002 && cp subjects/002/mri/T1.mgz subjects/002/mri/brainmask.mgz && recon-all -autorecon2 -subjid 002 && recon-all -autorecon3 -subjid 002 Subject Stamp: freesurfer-Linux-centos4_x86_64-stable-pub-v5.1.0 Current Stamp: freesurfer-Linux-centos4_x86_64-stable-pub-v5.1.0 INFO: SUBJECTS_DIR is /projects/schiz/ra/eli/freesurfer5.1/subjects Actual FREESURFER_HOME /projects/schiz/ra/eli/freesurfer5.1 -rw-rw-r-- 1 eli schiz 22143 Feb 19 19:37 /projects/schiz/ra/eli/freesurfer5.1/subjects/002/scripts/recon-all.log Linux pnl-d6-4.bwh.harvard.edu 2.6.34.9-69.fc13.x86_64 #1 SMP Tue May 3 09:23:03 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux #-------------------------------------------- #@# MotionCor Wed Feb 20 13:31:51 EST 2013 Found 1 runs /projects/schiz/ra/eli/freesurfer5.1/subjects/002/mri/orig/001.mgz Checking for (invalid) multi-frame inputs... WARNING: only one run found. This is OK, but motion correction cannot be performed on one run, so I'll copy the run to rawavg and continue.
cp /projects/schiz/ra/eli/freesurfer5.1/subjects/002/mri/orig/001.mgz /projects/schiz/ra/eli/freesurfer5.1/subjects/002/mri/rawavg.mgz
/projects/schiz/ra/eli/freesurfer5.1/subjects/002
mri_convert /projects/schiz/ra/eli/freesurfer5.1/subjects/002/mri/rawavg.mgz /projects/schiz/ra/eli/freesurfer5.1/subjects/002/mri/orig.mgz --conform
mri_convert /projects/schiz/ra/eli/freesurfer5.1/subjects/002/mri/rawavg.mgz /projects/schiz/ra/eli/freesurfer5.1/subjects/002/mri/orig.mgz --conform $Id: mri_convert.c,v 1.179.2.2 2011/05/16 20:53:47 greve Exp $ reading from /projects/schiz/ra/eli/freesurfer5.1/subjects/002/mri/rawavg.mgz... TR=0.00, TE=0.00, TI=0.00, flip angle=0.00 i_ras = (0, -0.989776, -0.142629) j_ras = (0, 0.142629, -0.989776) k_ras = (1, 0, 0) Original Data has (1, 1, 1) mm size and (216, 220, 176) voxels. Data is conformed to 1 mm size and 256 voxels for all directions changing data type from float to uchar (noscale = 0)... MRIchangeType: Building histogram Reslicing using trilinear interpolation writing to /projects/schiz/ra/eli/freesurfer5.1/subjects/002/mri/orig.mgz...
mri_add_xform_to_header -c /projects/schiz/ra/eli/freesurfer5.1/subjects/002/mri/transforms/talairach.xfm /projects/schiz/ra/eli/freesurfer5.1/subjects/002/mri/orig.mgz /projects/schiz/ra/eli/freesurfer5.1/subjects/002/mri/orig.mgz
INFO: extension is mgz #-------------------------------------------- #@# Talairach Wed Feb 20 13:32:06 EST 2013 /projects/schiz/ra/eli/freesurfer5.1/subjects/002/mri
talairach_avi --i orig.mgz --xfm transforms/talairach.auto.xfm
INFO: transforms/talairach.xfm already exists! The new transforms/talairach.auto.xfm will not be copied to transforms/talairach.xfm This is done to retain any edits made to transforms/talairach.xfm Add the -clean-tal flag to recon-all to overwrite transforms/talairach.xfm
#-------------------------------------------- #@# Nu Intensity Correction Wed Feb 20 13:33:08 EST 2013
mri_nu_correct.mni --i orig.mgz --o nu.mgz --uchar transforms/talairach.xfm --n 2
/projects/schiz/ra/eli/freesurfer5.1/subjects/002/mri /projects/schiz/ra/eli/freesurfer5.1/bin/mri_nu_correct.mni --i orig.mgz --o nu.mgz --uchar transforms/talairach.xfm --n 2 nIters 2 $Id: mri_nu_correct.mni,v 1.18 2011/03/02 20:16:39 nicks Exp $ Linux pnl-d6-4.bwh.harvard.edu 2.6.34.9-69.fc13.x86_64 #1 SMP Tue May 3 09:23:03 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux Wed Feb 20 13:33:08 EST 2013 Program nu_correct, built from: Package MNI N3, version 1.10, compiled by nicks@minerva(x86_64-unknown-linux-gnu) on 2010-02-20 at 17:32:37 tmpdir is ./tmp.mri_nu_correct.mni.24409 /projects/schiz/ra/eli/freesurfer5.1/subjects/002/mri mri_convert orig.mgz ./tmp.mri_nu_correct.mni.24409/nu0.mnc -odt float mri_convert orig.mgz ./tmp.mri_nu_correct.mni.24409/nu0.mnc -odt float $Id: mri_convert.c,v 1.179.2.2 2011/05/16 20:53:47 greve Exp $ reading from orig.mgz... TR=0.00, TE=0.00, TI=0.00, flip angle=0.00 i_ras = (-1, 0, 0) j_ras = (2.38419e-07, 0, -1) k_ras = (-1.93715e-07, 1, 0) changing data type from uchar to float (noscale = 0)... writing to ./tmp.mri_nu_correct.mni.24409/nu0.mnc...
-------------------------------------------------------- Iteration 1 Wed Feb 20 13:33:15 EST 2013 nu_correct -clobber ./tmp.mri_nu_correct.mni.24409/nu0.mnc ./tmp.mri_nu_correct.mni.24409/nu1.mnc -tmpdir ./tmp.mri_nu_correct.mni.24409/0/ [eli@pnl-d6-4.bwh.harvard.edu:/projects/schiz/ra/eli/freesurfer5.1/subjects/002/mri/] [2013-02-20 13:33:15] running: /projects/schiz/ra/eli/freesurfer5.1/mni/bin/nu_estimate_np_and_em -parzen -log -sharpen 0.15 0.01 -iterations 50 -stop 0.001 -shrink 4 -auto_mask -nonotify -b_spline 1 -distance 200 -quiet -execute -clobber -nokeeptmp -tmpdir ./tmp.mri_nu_correct.mni.24409/0/ ./tmp.mri_nu_correct.mni.24409/nu0.mnc ./tmp.mri_nu_correct.mni.24409/nu1.imp
Processing:.................................................................Done Processing:.................................................................Done Processing:.................................................................Done Number of iterations: 3 CV of field change: 0.000383553 [eli@pnl-d6-4.bwh.harvard.edu:/projects/schiz/ra/eli/freesurfer5.1/subjects/002/mri/] [2013-02-20 13:33:21] running: /projects/schiz/ra/eli/freesurfer5.1/mni/bin/make_template -quiet -shrink 3 ./tmp.mri_nu_correct.mni.24409/nu0.mnc ./tmp.mri_nu_correct.mni.24409/0//template.mnc
Transforming slices:......................................................................................Done Transforming slices:................................................................................................................................................................................................................................................................Done
-------------------------------------------------------- Iteration 2 Wed Feb 20 13:33:31 EST 2013 nu_correct -clobber ./tmp.mri_nu_correct.mni.24409/nu1.mnc ./tmp.mri_nu_correct.mni.24409/nu2.mnc -tmpdir ./tmp.mri_nu_correct.mni.24409/1/ [eli@pnl-d6-4.bwh.harvard.edu:/projects/schiz/ra/eli/freesurfer5.1/subjects/002/mri/] [2013-02-20 13:33:31] running: /projects/schiz/ra/eli/freesurfer5.1/mni/bin/nu_estimate_np_and_em -parzen -log -sharpen 0.15 0.01 -iterations 50 -stop 0.001 -shrink 4 -auto_mask -nonotify -b_spline 1 -distance 200 -quiet -execute -clobber -nokeeptmp -tmpdir ./tmp.mri_nu_correct.mni.24409/1/ ./tmp.mri_nu_correct.mni.24409/nu1.mnc ./tmp.mri_nu_correct.mni.24409/nu2.imp
Processing:.................................................................Done Processing:.................................................................Done Number of iterations: 2 CV of field change: 0.000575678 [eli@pnl-d6-4.bwh.harvard.edu:/projects/schiz/ra/eli/freesurfer5.1/subjects/002/mri/] [2013-02-20 13:33:36] running: /projects/schiz/ra/eli/freesurfer5.1/mni/bin/make_template -quiet -shrink 3 ./tmp.mri_nu_correct.mni.24409/nu1.mnc ./tmp.mri_nu_correct.mni.24409/1//template.mnc
Transforming slices:......................................................................................Done Transforming slices:................................................................................................................................................................................................................................................................Done
mri_binarize --i ./tmp.mri_nu_correct.mni.24409/nu2.mnc --min -1 --o ./tmp.mri_nu_correct.mni.24409/ones.mgz
$Id: mri_binarize.c,v 1.26.2.1 2011/04/08 15:40:50 greve Exp $ cwd /projects/schiz/ra/eli/freesurfer5.1/subjects/002/mri cmdline mri_binarize --i ./tmp.mri_nu_correct.mni.24409/nu2.mnc --min -1 --o ./tmp.mri_nu_correct.mni.24409/ones.mgz sysname Linux hostname pnl-d6-4.bwh.harvard.edu machine x86_64 user eli
input ./tmp.mri_nu_correct.mni.24409/nu2.mnc frame 0 nErode3d 0 nErode2d 0 output ./tmp.mri_nu_correct.mni.24409/ones.mgz Binarizing based on threshold min -1 max +infinity binval 1 binvalnot 0 Found 16777216 values in range Counting number of voxels Found 16777216 voxels in final mask mri_binarize done mri_segstats --id 1 --seg ./tmp.mri_nu_correct.mni.24409/ones.mgz --i orig.mgz --sum ./tmp.mri_nu_correct.mni.24409/sum.junk --avgwf ./tmp.mri_nu_correct.mni.24409/input.mean.dat
$Id: mri_segstats.c,v 1.75.2.2 2011/04/27 22:18:58 nicks Exp $ cwd cmdline mri_segstats --id 1 --seg ./tmp.mri_nu_correct.mni.24409/ones.mgz --i orig.mgz --sum ./tmp.mri_nu_correct.mni.24409/sum.junk --avgwf ./tmp.mri_nu_correct.mni.24409/input.mean.dat sysname Linux hostname pnl-d6-4.bwh.harvard.edu machine x86_64 user eli Loading ./tmp.mri_nu_correct.mni.24409/ones.mgz Loading orig.mgz Voxel Volume is 1 mm^3 Generating list of segmentation ids Found 1 segmentations Computing statistics for each segmentation 0 1 16777216 1.67772e+07
Reporting on 1 segmentations Computing spatial average of each frame 0 Writing to ./tmp.mri_nu_correct.mni.24409/input.mean.dat mri_segstats --id 1 --seg ./tmp.mri_nu_correct.mni.24409/ones.mgz --i ./tmp.mri_nu_correct.mni.24409/nu2.mnc --sum ./tmp.mri_nu_correct.mni.24409/sum.junk --avgwf ./tmp.mri_nu_correct.mni.24409/output.mean.dat
$Id: mri_segstats.c,v 1.75.2.2 2011/04/27 22:18:58 nicks Exp $ cwd cmdline mri_segstats --id 1 --seg ./tmp.mri_nu_correct.mni.24409/ones.mgz --i ./tmp.mri_nu_correct.mni.24409/nu2.mnc --sum ./tmp.mri_nu_correct.mni.24409/sum.junk --avgwf ./tmp.mri_nu_correct.mni.24409/output.mean.dat sysname Linux hostname pnl-d6-4.bwh.harvard.edu machine x86_64 user eli Loading ./tmp.mri_nu_correct.mni.24409/ones.mgz Loading ./tmp.mri_nu_correct.mni.24409/nu2.mnc Voxel Volume is 1 mm^3 Generating list of segmentation ids Found 1 segmentations Computing statistics for each segmentation 0 1 16777216 1.67772e+07
Reporting on 1 segmentations Computing spatial average of each frame 0 Writing to ./tmp.mri_nu_correct.mni.24409/output.mean.dat mris_calc -o ./tmp.mri_nu_correct.mni.24409/nu2.mnc ./tmp.mri_nu_correct.mni.24409/nu2.mnc mul .98003231285471643398 Saving result to './tmp.mri_nu_correct.mni.24409/nu2.mnc' (type = MINC ) [ ok ] mri_convert ./tmp.mri_nu_correct.mni.24409/nu2.mnc nu.mgz --like orig.mgz mri_convert ./tmp.mri_nu_correct.mni.24409/nu2.mnc nu.mgz --like orig.mgz $Id: mri_convert.c,v 1.179.2.2 2011/05/16 20:53:47 greve Exp $ reading from ./tmp.mri_nu_correct.mni.24409/nu2.mnc... TR=0.00, TE=0.00, TI=0.00, flip angle=0.00 i_ras = (-1, 0, 0) j_ras = (2.38419e-07, 0, -1) k_ras = (-1.93715e-07, 1, 0) INFO: transform src into the like-volume: orig.mgz Reslicing using trilinear interpolation writing to nu.mgz... mri_make_uchar nu.mgz transforms/talairach.xfm nu.mgz type change took 0 minutes and 11 seconds. mapping ( 0, 0) to ( 3, 110)
Wed Feb 20 13:35:04 EST 2013 mri_nu_correct.mni done #-------------------------------------------- #@# Intensity Normalization Wed Feb 20 13:35:04 EST 2013 /projects/schiz/ra/eli/freesurfer5.1/subjects/002/mri
mri_normalize -g 1 nu.mgz T1.mgz
using max gradient = 1.000 reading from nu.mgz... normalizing image... MRInormalize: could not find any valid peaks.
Make sure the Talairach alignment is correct!
building Voronoi diagram... performing soap bubble smoothing... 3d normalization pass 1 of 2 building Voronoi diagram... performing soap bubble smoothing... 3d normalization pass 2 of 2 building Voronoi diagram... performing soap bubble smoothing... writing output to T1.mgz 3D bias adjustment took 6 minutes and 5 seconds. 1d normalization failed - trying no1d... white matter peak found at -nan white matter peak found at 0 gm peak at 0 (0), valley at 0 (-10) csf peak at 0, setting threshold to 0 white matter peak found at -nan white matter peak found at 0 gm peak at 0 (0), valley at 0 (-10) csf peak at 0, setting threshold to 0
#------------------------------------------
recon-all -s 002 finished without error at Wed Feb 20 13:41:11 EST 2013 done Subject Stamp: freesurfer-Linux-centos4_x86_64-stable-pub-v5.1.0 Current Stamp: freesurfer-Linux-centos4_x86_64-stable-pub-v5.1.0 INFO: SUBJECTS_DIR is /projects/schiz/ra/eli/freesurfer5.1/subjects Actual FREESURFER_HOME /projects/schiz/ra/eli/freesurfer5.1 -rw-rw-r-- 1 eli schiz 50049 Feb 20 13:41 /projects/schiz/ra/eli/freesurfer5.1/subjects/002/scripts/recon-all.log Linux pnl-d6-4.bwh.harvard.edu 2.6.34.9-69.fc13.x86_64 #1 SMP Tue May 3 09:23:03 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux #------------------------------------- #@# EM Registration Wed Feb 20 13:41:16 EST 2013 /projects/schiz/ra/eli/freesurfer5.1/subjects/002/mri
mri_em_register -uns 3 -mask brainmask.mgz nu.mgz /projects/schiz/ra/eli/freesurfer5.1/average/RB_all_2008-03-26.gca transforms/talairach.lta
aligning to atlas containing skull, setting unknown_nbr_spacing = 3 using MR volume brainmask.mgz to mask input volume... reading 1 input volumes... logging results to talairach.log reading '/projects/schiz/ra/eli/freesurfer5.1/average/RB_all_2008-03-26.gca'... gcaAllocMax: node dims 64 64 64 gcaAllocMax: prior dims 128 128 128 gcaAllocMax: max_labels 0 average std = 6.9 using min determinant for regularization = 4.7 0 singular and 1812 ill-conditioned covariance matrices regularized reading 'nu.mgz'... freeing gibbs priors...done. bounding unknown intensity as < 14.9 or > 790.2 total sample mean = 84.4 (994 zeros) ************************************************ spacing=8, using 2772 sample points, tol=1.00e-05... ************************************************ register_mri: find_optimal_transform find_optimal_transform: nsamples 2772, passno 0, spacing 8 GCAhistoScaleImageIntensities: could not find wm peak resetting wm mean[0]: 102 --> 107 resetting gm mean[0]: 64 --> 64 input volume #1 is the most T1-like using real data threshold=0.0 skull bounding box = (0, 0, 0) --> (255, 255, 255) using (85, 85, 128) as brain centroid... mean wm in atlas = 107, using box (53,53,96) --> (116, 116,159) to find MRI wm WARNING: gca.c::GCAhistoScaleImageIntensities: h_mri->nbins=1, mri_peak=-1 before smoothing, mri peak at 0 WARNING2: gca.c::GCAhistoScaleImageIntensities: h_mri->nbins=1, mri_peak=-1 after smoothing, mri peak at 0, scaling input intensities by inf Linux pnl-d6-4.bwh.harvard.edu 2.6.34.9-69.fc13.x86_64 #1 SMP Tue May 3 09:23:03 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
recon-all -s 002 exited with ERRORS at Wed Feb 20 13:41:52 EST 2013
For more details, see the log file /projects/schiz/ra/eli/freesurfer5.1/subjects/002/scripts/recon-all.log To report a problem, see http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
*The only thing I am not sure about, is maybe I needed to edit the talairach.auto.xfm file as well? I haven't tried that because I am not sure if there would be unintended consequences.
Thanks, Eli *
freesurfer@nmr.mgh.harvard.edu