📄 pop_chanedit.m
字号:
% pop_chanedit() - Edit channel locations (chanlocs) structure of an EEGLAB dataset.
% For EEG channel location structure and file formats,
% see >> help readlocs % help message of readlocs()
%
% Usage: >> newchans = pop_chanedit( EEG, 'key1', value1, ...
% 'key2', value2, ... ); % edit dataset containing chanlocs
% >> newchans = pop_chanedit( chanlocs, 'key1', value1, ...
% 'key2', value2, ... ); % edit separate chanlocs struct
% Graphic interface:
% "Channel information ('field name')" - [edit boxes] display channel field
% contents for the current channel. Use 'transform' on the command
% line to modify these fields.
% "Opt. 3D center" - [button] recenter 3-D channel coordinates. Uses the chancenter()
% function. Command line equivalent is 'convert', { 'chancenter' [xc
% yc zc] }, [xc yc zc] being the center of the sphere (use empty to
% find the center so that electrodes best match a sphere).
% "rotate axis" - [button] force one electrode to one position and rotate other
% electrodes accordingly. Command line equivalent is 'forcelocs'.
% "Transform axis" - [button] perform any operation on channel fields. Command
% line equivalent is 'transform'.
% "xyz->polar & sph." - [button] convert 3-D cartesian coordinates to polar and
% 3-D spherical coordinates. This is useful when you edit the
% coordinates manually. Command line equivalent is 'convert',
% 'cart2all'.
% "sph.->polar & xyz" - [button] convert 3-D spherical coordinates to polar and
% 3-D cartesian coordinates. Command line equivalent is 'convert',
% 'sph2all'.
% "polar->sph & xyz" - [button] convert 2-D polar coordinates to 3-D spherical and
% 3-D cartesian coordinates. Command line equivalent is 'convert',
% 'topo2all'. Note that if spherical radii are absent, they are forced
% to 1.
% "Delete chan" - [button] delete channel. Command line equivalent: 'delete'.
% "Insert chan" - [button] insert channel before current channel. Command line
% equivalent: 'insert'.
% "<<" - [button] scroll channel backward by 10.
% "<" - [button] scroll channel backward by 1.
% ">" - [button] scroll channel forward by 1.
% ">>" - [button] scroll channel forward by 10.
% "Append chan" - [button] append channel after the current channel.
% Command line equivalent: 'append'.
% "Plot 2D" - [button] plot channel positions in 2-D using the topoplot() function.
% "Plot radius [value (0.2-1.0), []=auto)" - [edit box] default plotting radius
% in 2-D polar views. This doe NOT affect channel locations and
% is only used for visualization. This parameter is attached to the
% chanlocs structure and is then used in all 2-D scalp topoplots.
% Default -> to data limits. Command line equivalent: 'plotrad'.
% "Shrink to center" - [button] (deprecated, 'plotrad' above now recommended) shrink
% channel locations towards the vertex to show all on 2-D topoplots.
% "Plot 3D" - [button] plot channel positions in 3-D using the plotchans3d() function.
% "Read locations" - [button] read location file using the readlocs() function.
% Command line equivalent: 'load'.
% "Read help" - [button] readlocs() function help.
% "Save .ced" - [button] save channel locations in ".ced" format which is the native
% EEGLAB format. Command line equivalent: 'save'.
% "Save others" - [button] save channel locations in other formats using the
% pop_writelocs() function (see also readlocs() for channel formats).
% "Cancel" - [button] cancel all editing.
% "Help" - [button] this help message.
% "OK" - [button] save editing and propagate to parent.
%
% Input:
% EEG - EEG dataset
% chanlocs - EEG.chanlocs structure
%
% Optional inputs:
% 'convert' - {conversion_type [args]} Conversion type may be: 'cart2topo'
% 'sph2topo', 'topo2sph', 'sph2cart', 'cart2sph', or 'chancenter'.
% See help messages for these functions. Args are only relevant
% for 'chancenter'. See also graphical interface button for more
% info.
% 'transform' - String command for manipulating arrays. 'chan' is full channel
% info. Fields that can be manipulated are 'labels', 'theta'
% 'radius' (polar angle and radius), 'X', 'Y', 'Z' (cartesian
% 3-D) or 'sph_theta', 'sph_phi', 'sph_radius' for spherical
% horizontal angle, azimuth and radius.
% Ex: 'chans(3) = chans(14)', 'X = -X' or a multi-step transform
% with steps separated by ';': Ex. 'TMP = X; X = Y; Y = TMP'
% 'changechan' - {num value1 value2 value3 ...} Change the values of all fields
% for the given channel num: mimimally {num label theta radius}.
% Ex: 'changechan' {12 'PXz' -90 0.30}
% 'changefield' - {num field value} Change field value for channel number num.
% Ex: {34 'theta' 320.4}.
% 'insert' - {num label theta radius X Y Z sph_theta sph_phi sph_radius }
% Insert new channel before channel number num with the specified
% values. If the number of values if less than 10, remaining
% fields are 0. (previously this parameter was termed 'add').
% 'append' - {num label theta radius X Y Z sph_theta sph_phi sph_radius }
% same as 'insert' but add the the new channel after the current
% channel.
% 'delete' - [int_vector] Vector of channel numbers to delete.
% 'forcelocs' - [cell] call forcelocs() function to force a particular channel
% to be at a particular location on the sphere (and rotate other
% channels accordingly).
% 'shrink' - Topographical polar shrink factor (see >> help topoplot)
% 'skirt' - Topographical polar skirt factor (see >> help topoplot)
% 'load' - [filename|{filename, 'key', 'val'}] Load channel location file
% optional arguments (such as file format) to the function
% readlocs() can be specified if the input is a cell array.
% 'save' - 'filename' Save text file with channel info.
% 'eval' - [string] evaluate string ('chantmp' is the name of the channel
% location structure.
% 'lookup' - [integer array] lookup channel indices standard location. []
% looks up all channels.
%
% Outputs:
% newchans - new EEGLAB channel locations structure
%
% Ex: EEG = pop_chanedit(EEG,'load', { 'dummy.elp' 'elp' }, 'delete', [3 4], ...
% 'convert', { 'xyz->polar' [] -1 1 }, 'save', 'mychans.loc' )
% % Load polhemus file, delete two channels, convert to polar (see
% % cart2topo() for arguments) and save into 'mychans.loc'.
%
% Author: Arnaud Delorme, CNL / Salk Institute, 20 April 2002
%
% See also: readlocs()
%123456789012345678901234567890123456789012345678901234567890123456789012
% Copyright (C) Arnaud Delorme, CNL / Salk Institute, 15 March 2002, arno@salk.edu
%
% This program is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 2 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program; if not, write to the Free Software
% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
% $Log: pop_chanedit.m,v $% Revision 1.102 2004/07/07 22:37:14 arno% debug shrink conversion to plotrad%
% Revision 1.101 2004/07/07 22:31:22 arno
% shrink message
%
% Revision 1.100 2004/07/07 22:21:13 arno
% debug shrinkorskirt
%
% Revision 1.99 2004/06/09 17:44:55 arno
% lookup coordinate
%
% Revision 1.98 2004/05/22 00:00:00 arno
% nothing
%
% Revision 1.97 2004/05/21 17:54:46 arno
% allowing to use EEG as input
%
% Revision 1.96 2004/03/19 19:45:49 arno
% plotrad as number
%
% Revision 1.95 2004/03/19 19:45:16 arno
% conversion
%
% Revision 1.94 2004/03/19 19:04:53 scott
% help message and plotrad gui text
%
% Revision 1.93 2004/03/18 01:41:01 arno
% msgs
%
% Revision 1.92 2004/03/18 01:37:55 arno
% implemetning plotrad
%
% Revision 1.91 2004/03/18 00:28:41 arno
% debug shrink/skirt
%
% Revision 1.90 2004/03/08 19:24:49 arno
% shink -> shrink
%
% Revision 1.89 2004/02/13 19:13:56 arno
% nothing
%
% Revision 1.88 2004/02/13 02:36:21 arno
% updating location after chancenter
%
% Revision 1.87 2004/02/13 00:10:31 arno
% implementing new history for channel recentering
%
% Revision 1.86 2004/02/12 23:57:47 arno
% *** empty log message ***
%
% Revision 1.85 2004/01/29 00:26:14 arno
% text in message
%
% Revision 1.84 2004/01/01 19:18:50 scott
% same
%
% Revision 1.83 2004/01/01 19:16:09 scott
% 3d center -> Opt. 3D center
%
% Revision 1.82 2003/12/20 01:47:09 arno
% debug call with empty array
%
% Revision 1.81 2003/12/18 01:21:24 arno
% same
%
% Revision 1.80 2003/12/18 01:17:23 arno
% warning message
%
% Revision 1.79 2003/12/18 01:10:37 arno
% debug text
%
% Revision 1.78 2003/12/18 01:08:20 arno
% channel location lookup
%
% Revision 1.77 2003/12/17 01:35:58 arno
% debug plot3d for empty chans
%
% Revision 1.76 2003/12/12 01:17:22 arno
% nothing
%
% Revision 1.75 2003/12/10 03:19:56 arno
% graphical interface help
%
% Revision 1.74 2003/12/05 23:41:34 arno
% debug convert2all
%
% Revision 1.73 2003/12/05 23:39:09 arno
% coordinate conversion debug
%
% Revision 1.72 2003/12/05 22:58:23 arno
% same thing
%
% Revision 1.71 2003/12/05 22:54:08 arno
% debug transform
%
% Revision 1.70 2003/12/05 18:25:45 arno
% ?
%
% Revision 1.69 2003/12/05 18:20:21 arno
% same thing
%
% Revision 1.68 2003/12/05 18:18:52 arno
% checkchans problem
%
% Revision 1.67 2003/12/02 22:43:38 arno
% forcing compatibility with urchan
%
% Revision 1.66 2003/12/02 19:25:38 arno
% debug readlocs and chanedit
%
% Revision 1.65 2003/12/02 18:02:06 arno
% chancenter history
%
% Revision 1.64 2003/12/02 17:55:37 arno
% verbose on for convertlocs
%
% Revision 1.63 2003/12/02 17:54:34 arno
% conversion of coordinates
%
% Revision 1.62 2003/12/02 17:15:08 arno
% adding insert & append button
%
% Revision 1.61 2003/12/02 03:31:40 arno
% current figure problem
%
% Revision 1.60 2003/12/02 03:21:26 arno
% better gui for readlocs
%
% Revision 1.59 2003/10/16 23:39:45 arno
% eeglabsources
% OA
% eeglabsources
%
% Revision 1.58 2003/08/08 17:00:37 arno
% fix header
%
% Revision 1.57 2003/08/05 18:30:46 arno
% nothing
%
% Revision 1.56 2003/08/04 18:49:56 arno
% automatic conversion for 'transform' parameter
%
% Revision 1.55 2003/07/19 01:24:47 arno
% remving double &
%
% Revision 1.54 2003/07/16 18:45:50 arno
% debug string
% []
%
% Revision 1.53 2003/07/16 16:45:00 arno
% debug readlocs pop up window
%
% Revision 1.52 2003/07/16 01:38:07 scott
% help topoplot
% Revision 1.51 2003/07/10 18:30:03 arno
% debuging rotate axis cancelation
%
% Revision 1.50 2003/05/13 23:49:13 arno
% [Aallowing to write channel location file
%
% Revision 1.49 2003/05/13 16:55:35 arno
% debug shrink factor
%
% Revision 1.48 2003/04/17 01:55:35 arno
% automatically convert coordinates for 3-d center
%
% Revision 1.47 2003/04/16 02:06:08 arno
% adding forcelocs option
%
% Revision 1.46 2003/04/10 17:29:47 arno
% header edit
%
% Revision 1.45 2003/03/06 00:36:34 arno
% further checking
%
% Revision 1.44 2003/03/06 00:35:30 arno
% same
%
% Revision 1.43 2003/03/06 00:34:28 arno
% handling numeric shrink factors
%
% Revision 1.42 2003/02/23 08:23:08 scott
% header edit -sm
%
% Revision 1.41 2003/01/03 22:43:35 arno
% removing error message
% ,
%
% Revision 1.40 2003/01/02 17:31:49 arno
% text in pop-up window for reading channel location
%
% Revision 1.39 2002/12/27 22:58:07 arno
% removing debugging message
%
% Revision 1.38 2002/11/15 02:32:27 arno
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -