📄 mesh_write.m
字号:
function [p] = mesh_write(p)
% MESH_WRITE - a switch yard for several mesh writing functions
%
% Useage: [p] = mesh_write(p)
%
% p is a parameter structure (see eeg_toolbox_defaults for
% more details). In this function, it should contain mesh data
% in p.mesh.data and the following string fields:
%
% p.mesh.path - the directory location of the file to load
% p.mesh.file - the name of the file to load
% p.mesh.type - the file formats (case insensitive) are:
%
% 'emse'
% 'brainstorm'
% 'ascii' or 'freesurfer' for *.asc file
% 'fs_surf' for freesurfer binary surface
% 'fs_curv' for freesurfer binary curvature
% 'fs_overlay' for freesurfer binary overlay (.w)
%
% If you have a file format you would like supported, please email
% the author with an example and description of the format. The
% file formats supported here are described in more detail at
% their respective websites:
%
% EMSE: http://www.sourcesignal.com
% BrainStorm: http://neuroimage.usc.edu/brainstorm/
% FreeSurfer: http://surfer.nmr.mgh.harvard.edu/
%
% See also, MESH_OPEN, MESH_WRITE_EMSE,
% MESH_WRITE_BRAINSTORM, MESH_WRITE_FREESURFER
% MESH_WRITE_FS_SURF, MESH_WRITE_FS_CURV,
% MESH_WRITE_FS_OVERLAY
%
% $Revision: 1.3 $ $Date: 2003/04/07 06:12:02 $
% Licence: GNU GPL, no express or implied warranties
% History: 02/2002 Darren.Weber@flinders.edu.au
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if ~exist('p','var'),
msg = sprintf('\nMESH_WRITE...no input p struct.\n');
error(msg);
elseif isempty(p),
msg = sprintf('\nMESH_WRITE...input p struct is empty.\n');
error(msg);
elseif isempty(p.mesh.data),
msg = sprintf('\nMESH_WRITE...input p struct has no mesh data.\n');
error(msg);
end
type = lower(p.mesh.type);
switch type,
case 'emse',
mesh_write_emse(p);
case 'brainstorm',
mesh_write_brainstorm(p);
case {'ascii','freesurfer'}, % for *.asc file
mesh_write_freesurfer(p);
case 'fs_surf', % for freesurfer binary surface
mesh_write_fs_surf(p);
case 'fs_curv', % for freesurfer binary curvature
mesh_write_fs_curv(p);
case 'fs_overlay', % for freesurfer binary overlay (.w)
mesh_write_fs_overlay(p);
otherwise,
fprintf('...mesh format: %s\n', p.mesh.type);
fprintf('...sorry, cannot write this data format at present.\n');
return;
end
return
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -