eelbrain.plot.brain.SequencePlotter

class eelbrain.plot.brain.SequencePlotter

Grid of anatomical images in one figure

Examples

Plot an evoked response or TRF (time by source ndvar) in 50 ms bins:

ndvar_binned = ndvar.bin(0.05, 0, 0.3, 'extrema')
sp = plot.brain.SequencePlotter()
sp.set_brain_args(surf='smoothwm')
sp.add_ndvar(ndvar_binned)
p = sp.plot_table(view='lateral')
p.save('Figure.pdf')

Plot specific time points in an evoked response or TRF (ndvar):

cmap = plot.soft_threshold_colormap('xpolar-a', 0.0001, 0.010)
sp = plot.brain.SequencePlotter()
sp.set_brain_args(surf='smoothwm')
for t in [0.050, 0.100, 0.200]:
    sp.add_ndvar(ndvar.sub(time=t), cmap=cmap, label=f'{int(t*1000)} ms')
p = sp.plot_table(view='lateral', orientation='vertical')

Plot a test result:

res = testnd.TTestRelated('srcm', 'condition')
vmax = 3  # explicitly set vmax to make sure that the color-maps agree
sp = plot.brain.SequancePlotter()
sp.set_brain_args(surf='inflated')
sp.add_ndvar(res.c1_mean, vmax=vmax, label='a')
sp.add_ndvar(res.c0_mean, vmax=vmax, label = 'b')
sp.add_ndvar(res.masked_difference(), vmax=vmax, label='a - b')
p = sp.plot_table(view='lateral', orientation='vertical')

Methods

add_function(func[, label, overlay])

Custom modification of the brain object (calls func(brain))

add_ndvar(ndvar, *args[, static, index, label])

Add a data layer to the brain plot

add_ndvar_label(ndvar[, color, borders, …])

Add a boolean label to the brain plot

add_pmap(res[, label])

See add_ndvar_p_map()

plot_table([hemi, view, orientation, …])

Create a figure with the images

set_brain(source)

Set the brain model on which to plot

set_brain_args([surf, foreground, …])

Set parameters for anatomical plot (see brain())

set_frame_order(order)

Set the order in which frames are plotted

set_parallel_view([forward, up, scale])

Set view for all plots (see set_parallel_view()