FT_SELECT_CHANNEL

Note that this reference documentation is identical to the help that is displayed in Matlab when you type “help ft_select_channel”.

  FT_SELECT_CHANNEL is a helper function that can be used as callback function
  in a figure. It allows the user to select a channel. The channel labels
  are returned.
 
  Use as
    label = ft_select_channel(h, eventdata, ...)
  The first two arguments are automatically passed by Matlab to any
  callback function.
 
  Additional options should be specified in key-value pairs and can be
    'callback'  = function handle to be executed after channels have been selected
 
  You can pass additional arguments to the callback function in a cell-array
  like {@function_handle,arg1,arg2}
 
  Example
    % create a figure
    lay = ft_prepare_layout([])
    ft_plot_lay(lay)
 
    % add the required guidata
    info       = guidata(gcf)
    info.x     = lay.pos(:,1);
    info.y     = lay.pos(:,2);
    info.label = lay.label
    guidata(gcf, info)
 
    % add this function as the callback to make a single selection
    set(gcf, 'WindowButtonDownFcn', {@ft_select_channel, 'callback', @disp})
 
    % or to make multiple selections
    set(gcf, 'WindowButtonDownFcn',   {@ft_select_channel, 'multiple', true, 'callback', @disp, 'event', 'WindowButtonDownFcn'})
    set(gcf, 'WindowButtonUpFcn',     {@ft_select_channel, 'multiple', true, 'callback', @disp, 'event', 'WindowButtonDownFcn'})
    set(gcf, 'WindowButtonMotionFcn', {@ft_select_channel, 'multiple', true, 'callback', @disp, 'event', 'WindowButtonDownFcn'})
 
  Subsequently you can click in the figure and you'll see that the disp
  function is executed as callback and that it displays the selected
  channels.

reference/ft_select_channel.txt · Last modified: 2012/05/23 23:02 (external edit)

You are here: startreferenceft_select_channel
This DokuWiki features an Anymorphic Webdesign theme, customised by Eelke Spaak and Stephen Whitmarsh.
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0