External Email - Use Caution
Dear all,
I have a matlab script that includes the following call to freesurfer:
[status, result] = system(‘mri_info fsaverage/mri/brain.mgz —vox2ras-tkr');
The matlab script errors out at this step with the following output:
status = 1 result = ‘mghRead(fsaverage/mri/brain.mgz, -1): could not open file’
If I run the mri_info command on the exact same file outside of matlab, I get the correct 4x4 matrix as output.
I am running freesurfer 5.3.0 and matlab 2018b on a HPC system. I think I have all of the necessary paths for freesurfer set correctly in my matlab startup.m file: freesurfer/bin freesurfer/fsfast/bin freesurfer/mni/bin
I am not sure why mri_info is giving correct input when run from the bash terminal prompt but throws this mghRead error when attempting to run the same command through matlab. The matlab script itself works on the mac desktop computer of the author (not sure what version of freesurfer or matlab the author is running), so the problem does not appear to be with the matlab system call to mri_info per se.
Any suggestions of what else to troubleshoot (or if I am missing any path specifications in my startup.m file) would be much appreciated.
For completeness, below is the output from ‘source $FREESURFER_HOME/SetUpFreeSurfer.sh’:
Setting up environment for FreeSurfer/FS-FAST (and FSL) FREESURFER_HOME /cvmfs/soft.computecanada.ca/easybuild/software/2017/Core/freesurfer/5.3.0http://soft.computecanada.ca/easybuild/software/2017/Core/freesurfer/5.3.0 FSFAST_HOME /cvmfs/soft.computecanada.ca/easybuild/software/2017/Core/freesurfer/5.3.0/fsfasthttp://soft.computecanada.ca/easybuild/software/2017/Core/freesurfer/5.3.0/fsfast FSF_OUTPUT_FORMAT nii.gz SUBJECTS_DIR /cvmfs/soft.computecanada.ca/easybuild/software/2017/Core/freesurfer/5.3.0/subjectshttp://soft.computecanada.ca/easybuild/software/2017/Core/freesurfer/5.3.0/subjects MNI_DIR /cvmfs/soft.computecanada.ca/easybuild/software/2017/Core/freesurfer/5.3.0/mnihttp://soft.computecanada.ca/easybuild/software/2017/Core/freesurfer/5.3.0/mni
Thanks,
suzanne
[cid:67412C66-BB70-409C-BE50-7BADCECDE5F9@uwo-x-11.wireless.uwo.pri]
freesurfer@nmr.mgh.harvard.edu