Plotting module

Background

At the moment plotting of channel-level data is done in multiplotXX, singleplotXX, topoplotXX, topoplot and in rejectvisual. They all have a different manner of dealing with the layout (rejectvisual does not even use it). Furthermore, plotSelection 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 multiplotXX, 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 = preprocessing(cfg)

cfg = []
databrowser(cfg, data)

and e.g. an independent component plotter:

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

cfg = []
componentbrowser(cfg, data)

DONE

  • skeleton made for the code of low-level functions

TODO

  • update existing higher-level fieldtrip functions (cristiano) so that they use low-level functions, to start with singleplotER (singleplotER_new)
  • add new functionality (giovanni) such as componentbrowser and databrowser
  • refine code low-level functions (robert) based on constraints/requirements higher-level functions

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

plot_sens(grad, ...)        % see read_sens
plot_sens(elec, ...)        % see read_sens
plot_vol(vol, ...)          % see read_vol and prepare_vol_sens
plot_headshape(shape, ...)  % see read_headshape
plot_mesh                   % e.g. for cortical surfaces
plot_topo3d(sens, dat, ...) % for a scalp distribution on the 3D electrodes
plot_slice                  % e.g. for one slice out of an MRI, hovering in 3D
plot_sphere
plot_line
plot_text

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

plot_ortho(...)       % see sourceplot
plot_slice(...)       % see sourceplot

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

plot_vector   % for a timeseries (ERP) or spectrum
plot_matrix   % for a NxM matrix, e.g. a time-frequency representation
plot_topo     % for 2D topgraphies
plot_text     % for e.g. axis-legend or title
plot_line     % for e.g. axis
plot_box      % for highlighting a specific data-window (e.g. significant or containing artifacts)

For interacting with the plotted data

select_point3d   % in 3d
select_point     % in 2d
select_box       % in 2d
select_circle    % in 2d
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):

  • layoutplot.m
  • headmodelplot.m
  • singleplotER.m
  • singleplotTFR.m
  • databrowser.m, is using plot_vector, plot_box, plot_text
  • multiplotTFR.m, is using plot_matrix, plot_box, plot_text
  • multiplotER.m, is using plot_vector, plot_box, plot_text
  • topoplot.m
  • topoplotCC.m
  • topoplotER.m
  • topoplotTFR.m

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

analysisprotocol.m artifact_ecg.m artifact_manual.m artifact_zvalue.m bciinput.m clusterplot.m electroderealign.m freqanalysis_mtmconvol.m headmovement.m interactiverealign.m lateralizedfield.m lateralizedpotential.m megrealign.m multiplotCC.m neighbourselection.m plotSelection.m prepare_concentricspheres.m prepare_layout.m prepare_localspheres.m rejectartifact.m rejectvisual.m sliceinterp.m sourceplot.m sourceplot_old.m spikedetection.m stratify.m surfaceplot.m volumerealign.m private/alpha_taper.m private/artifact_feedback_old.m private/artifact_viewer private/artifact_viewer_old.m private/rejectvisual_channel.m private/rejectvisual_summary.m private/rejectvisual_trial.m private/wizard_base.m. public/benchmark.m public/uimage public/uimagesc

development/plotting.txt · Last modified: 2010/07/14 12:45 by cristiano
Back to top
chimeric.de = chi`s home Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0