Dear Freesurfers,
Is there a way of calling freesurfer-scripts from within MATLAB?
I know there are some setups needed to make MATLAB understand where it can find the commands (I have done this before with FSL).
I am using bash, and when I type the Freesurfer commands in a terminal by hand, they work. So I am guessing it must have to do with setting up the environment:
freesurf_path ='Applications/freesurfer';
setenv('FREESURFDIR',freesurf_path)
setenv('FREESURFOUTPUTTYPE','NIFTI_GZ')
curpath = getenv('PATH');
setenv('PATH',sprintf('%s:%s',fullfile(freesurf_path,'bin'),curpath));
Thanks a lot for any help,
Barbara