I ran across the same issue reported in:

http://www.mail-archive.com/freesurfer@nmr.mgh.harvard.edu/msg17687.html

The initial question was why mri_segstats did not work and complained:

"Error: could not open stats/aseg/stats  for writing"



If you try to, literally, copy and paste the same command listed in the 
aseg.stats file:

mri_segstats --seg mri/aseg.mgz --sum stats/aseg.stats --pv mri/norm.mgz 
--ctab-default --excludeid 0 --brain-vol-from-seg --brainmask 
mri/brainmask.mgz --in mri/norm.mgz --inintensity-name 
norm--in-intensity-units MR --etiv --subject 004


you'll get the error message, even if you source the freesurfer setup 
file (/usr/freesurfer/SetUpFreeSurfer.csh).  In order to run the 
command, one needs to type out the complete path to each referenced file:


mri_segstats --seg ${SUBJECTS_DIR}/'subject"/mri/aseg.mgz --sum 
${SUBJECTS_DIR}/'subject"/stats/aseg.stats --pv 
${SUBJECTS_DIR}/'subject"/mri/norm.mgz --ctab-default --excludeid 0 
--brain-vol-from-seg --brainmask 
${SUBJECTS_DIR}/'subject"/mri/brainmask.mgz --in 
${SUBJECTS_DIR}/'subject"/mri/norm.mgz --inintensity-name 
norm--in-intensity-units MR --etiv --subject 004

(obviously replace ${SUBJECTS_DIR}/'subject" with the correct path and 
subject ID).




I apologize for the lengthy response but I felt the referenced thread 
ended without truly addressing the problem.  Also, when running into the 
exact same error I was left scratching my head trying to figure it out.  
Hopefully someone else finds this useful.
_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


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.

Reply via email to