offspect.cache.plot

get_glass_bg(tmpdir)[source]
plot_glass(coords, values, display_mode='z', smooth=12.5, colorbar=True, vmax=None, title='')[source]

takes a list of coordinates and values and plots them as glass-brain

Parameters
  • coords (List[List[float]]) – a list of [x,y,z] coordinates in MNI space

  • values (List[float]) – a list of values for each coordinate

  • display_mode – which views to plot, defaults to ‘z’, i.e. top-down view

  • smooth (float) – how much the points should be smoothened during projection

  • colorbar (bool) – whether to plot a colorbar or not, defaults to plotting one

  • vmax – the maximum value for scaling the colorbar. Defaults to adapting it to the data at hand

  • title (str) – a textual annotation to print into the upper left corner

Returns

display – the glass-plot object

plot_glass_on(axes, coords, tmpdir, width=10)[source]
plot_glass_on_old(axes, coords, values)[source]
plot_map(cachefiles, foo=<function <lambda>>, ignore_rejected=True, **kwargs)[source]

plot the whole map for a complete cachefile

Parameters
  • cachefiles (List[CacheFile]) – a list of the cachefiles to be plotted

  • foo (Callable) – will be applied to each value, and defaults to passing the original. But could be, e.g. lambda x : log10(x + 1) to plot logarithmized values

  • ignore_rejected (bool) – defaults to True, and ignores any traces which have been flagged for rejection. Alternatively, ignore the rejection and plot their values anyways.

  • **kwargs – additional keyword arguments are passed to plot_glass()

Returns

display (the figure handle for the mapping plot)

plot_trace(ax, data, attrs)[source]
project_into_nifti(coords, values, smooth=12.5)[source]

takes a list of coordinates and values and projects them as a NiftiImage :type coords: List[List[float]] :param coords: a list of [x,y,z] coordinates in MNI space :type values: List[float] :param values: a list of values for each coordinate :type smooth: float :param smooth: how much the points should be smoothened during projection :type smooth: float :param returns: the coords/values projected into a Nifti1Image :type returns: Nifti1Image :param Because after smoothening, values are decreased, the resulting image is rescaled to the original maximum value as given in the raw data.: