POP_CHANEDIT Edit channel locations structure of an EEGLAB dataset, EEG.chanlocs. For EEG channel location structure and file formats, see >> help readlocs


Usage: >> newchans = pop_chanedit( EEG, 'key1', value1, 'key2', value2, ... ); % edit dataset containing chanlocs
>> [ newchans options ] = 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] optimally re-center 3-D channel coordinates. Uses chancenter(). Command line equivalent is 'convert', { 'chancenter' [xc yc zc] }, [xc yc zc] being the center of the sphere. Use [] to find the center such that electrode locations 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.
"Set head radius"   
[button] change head size radius. This is usefull to make channel location compatible with a specified spherical model. Command line option: 'headrad'.
"Set channel types"   
[button] set channel type names for a range of data channels.
"Shift data channels"   
[button] shift data channel indices. Command line equivalent: 'shiftdatachans'.
"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'.
"Nose along +X"   
[list] Indicate along which direction the nose should be. This information is used in functions like topoplot(), headplot() or dipplot(). Command line option: 'nosedir'.
"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.

Inputs:
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).
'headrad'   
[float] change head radius.
'lookup'   
[string] lookup channel indices standard location from channel location file given as input.
'shiftdatachans'   
[pos shift] shift data channel indices at position 'pos' by 'shift'. This option is useful if some data channel do not have location.

Outputs:
newchans   
new EEGLAB channel locations structure or EEG dataset with updated channel location structures (EEG.chanlocs EEG.urchanlocs and EEG.chaninfo }.
options   
structure containing plotting options (equivalent to EEG.chaninfo) 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()

See the matlab file pop_chanedit.m (may require other functions)

Back to functions