mvpa2.misc.plot.lightbox.plot_lightbox

mvpa2.misc.plot.lightbox.plot_lightbox(background=None, background_mask=None, cmap_bg='gray', overlay=None, overlay_mask=None, cmap_overlay='autumn', vlim=(0.0, None), vlim_type=None, do_stretch_colors=False, add_info=True, add_hist=True, add_colorbar=True, fig=None, interactive=None, nrows=None, ncolumns=None, slices=None, slice_title='k=%(islice)s')

Very basic plotting of 3D data with interactive thresholding.

background/overlay and corresponding masks could be nifti files names or SpatialImage objects, or 3D ndarrays. If no mask is provided, only non-0 elements are plotted.

Parameters:

do_stretch_colors : bool, optional

Stratch color range to the data (not just to visible data)

vlim : tuple, optional

2 element tuple of low/upper bounds of values to plot

vlim_type : None or ‘symneg_z’

If not None, then vlim would be treated accordingly:
symneg_z

z-score values of symmetric normal around 0, estimated by symmetrizing negative part of the distribution, which often could be assumed when total distribution is a mixture of by-chance performance normal around 0, and some other in the positive tail

ncolumns : int or None

Explicit starting number of columns into which position the slice renderings. If None, square arrangement would be used

nrows : int or None

Explicit starting number of rows into which position the slice renderings. If None, square arrangement would be used

add_hist : bool or tuple (int, int)

If True, add histogram and position automagically. If a tuple – use as (row, column)

add_info : bool or tuple (int, int)

If True, add information and position automagically. If a tuple – use as (row, column).

slices : None or list of int

If not to plot whole volume, what slices to plot.

slice_title : None or str

Desired title of slices. Use string comprehension and assume islice variable present with current slice index.

Available colormaps are presented nicely on

TODO:

  • Make interface more attractive/usable
  • allow multiple overlays... or just unify for them all to be just a list of entries
  • handle cases properly when there is only one - background/overlay

Notes

No care is taken to deduce the orientation (e.g. Left-to-Right, Posterior-to-Anterior) of fMRI volumes. Therefore all input volumes should be in the same orientation.