Table of Contents

Plotting module

FIXME this page should follow the documentation guidelines

Background

At the moment plotting of channel-level data is done in ft_multiplotXX, ft_singleplotXX, ft_topoplotXX, ft_plot_topo and in rejectvisual. They all have a different manner of dealing with the layout (rejectvisual does not even use it). Furthermore, ft_selectXX also interacts with it.

Goal

To reuse the functionality in different functions and be able to improve the functionality everywhere.

To develop low-level functions for plotting and graphical user interfaces, so that the higher-level functions in fieldtrip (such as ft_multiplotXX, ft_singleplotXX) can all use these same low-level functions.

This will facilitate new plotting functions that then also use the low-level functions, e.g. a databrowser:

cfg = []
cfg.dataset = 'Subject01.ds'
cfg.trl = something, can be empty
data = ft_preprocessing(cfg)

cfg = []
ft_databrowser(cfg, data)

and e.g. an independent component plotter:

cfg = []
cfg = ...
comp = ft_componentanalysis(cfg, data);

cfg = []
ft_componentbrowser(cfg, data)

DONE

TODO

Definition of the function-calls (API)

These are the low-level functions that will be called by the higher-level functions that the fieldtrip-user uses.

For data objects that represent something in 3D space

ft_plot_sens(grad, ...)        % see read_sens
ft_plot_sens(elec, ...)        % see read_sens
ft_plot_vol(vol, ...)          % see read_vol and prepare_vol_sens
ft_plot_headshape(shape, ...)  % see read_headshape
ft_plot_mesh                   % e.g. for cortical surfaces
ft_plot_topo3d(sens, dat, ...) % for a scalp distribution on the 3D electrodes
ft_plot_slice                  % e.g. for one slice out of an MRI, hovering in 3D
ft_plot_sphere
ft_plot_line
ft_plot_text

For data objects that represent a volume, i.e. an anatomical MRI

ft_plot_ortho(...)       % see sourceplot
ft_plot_slice(...)       % see sourceplot

For data objects with a 2D (paper print) representation

ft_plot_vector   % for a timeseries (ERP) or spectrum
ft_plot_matrix   % for a NxM matrix, e.g. a time-frequency representation
ft_plot_topo     % for 2D topgraphies
ft_plot_text     % for e.g. axis-legend or title
ft_plot_line     % for e.g. axis
ft_plot_box      % for highlighting a specific data-window (e.g. significant or containing artifacts)

For interacting with the plotted data

ft_select_point3d   % in 3d
ft_select_point     % in 2d
ft_select_box       % in 2d
ft_select_circle    % in 2d
ft_select_contour   % in 2d

All functions would take some required fixed input arguments, followed by a variable number of key-value pairs.

Inventory of plotting in Fieldtrip

The following functions are finished (use new low-level functions):

The following Fieldtrip functions also use figure/plot/image:

ft_analysisprotocol.m ft_artifact_zvalue.m ft_clusterplot.m ft_electroderealign.m ft_freqanalysis_mtmconvol.m ft_headmovement.m ft_interactiverealign.m ft_lateralizedpotential.m ft_megrealign.m ft_multiplotCC.m ft_neighbourselection.m ft_prepare_concentricspheres.m ft_prepare_layout.m ft_prepare_localspheres.m ft_rejectartifact.m ft_rejectvisual.m ft_sliceinterp.m ft_sourceplot.m ft_spikedetection.m ft_stratify.m ft_volumerealign.m private/alpha_taper.m private/artifact_viewer private/rejectvisual_channel.m private/rejectvisual_summary.m private/rejectvisual_trial.m private/wizard_base.m. public/uimage public/uimagesc