0001 function dmri_freesurfer_surf_view(freesurfer_dir)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 if nargin ~= 1
0021 error('Please check input argument.');
0022 end
0023 if exist(freesurfer_dir, 'dir') ~= 7
0024 error('Specified freesurfer_dir is invalid.');
0025 end
0026
0027
0028
0029
0030
0031
0032 temp_shell_file = [tempname, '.sh'];
0033
0034 dmri_script_file_create(temp_shell_file);
0035 fid = fopen(temp_shell_file, 'a');
0036 if fid == -1
0037 error('Failed to open script file.');
0038 end
0039
0040 [SUBJECTS_DIR, SUBJ] = fileparts(freesurfer_dir);
0041
0042
0043 fprintf(fid, '%s\n', ['SUBJECTS_DIR=' SUBJECTS_DIR]);
0044
0045 cmd = ['tkmedit', ...
0046 ' ', SUBJ, ...
0047 ' brainmask.mgz -aux wm.mgz -surfs'];
0048 fprintf(fid, '%s\n', cmd);
0049 fclose(fid);
0050
0051
0052 dmri_system(temp_shell_file);
0053 delete(temp_shell_file);