cedalion.vis package
Subpackages
- cedalion.vis.anatomy package
- Submodules
- cedalion.vis.anatomy.brain_and_scalp module
- cedalion.vis.anatomy.image_recon module
- cedalion.vis.anatomy.montage module
- cedalion.vis.anatomy.optode_selector module
OptodeSelectorOptodeSelector.surfaceOptodeSelector.pointsOptodeSelector.normalsOptodeSelector.plotterOptodeSelector.labelsOptodeSelector.actorsOptodeSelector.colorOptodeSelector.plot()OptodeSelector.on_pick()OptodeSelector.update_visualization()OptodeSelector.enable_picking()OptodeSelector.plot()OptodeSelector.on_pick()OptodeSelector.update_visualization()OptodeSelector.enable_picking()OptodeSelector.find_surface_normal()OptodeSelector.update_normals()
- cedalion.vis.anatomy.scalp_plot module
- cedalion.vis.anatomy.sensitivity_matrix module
- Module contents
plot_brain_in_axes()plot_brain_and_scalp()image_recon()image_recon_multi_view()image_recon_view()plot_montage3D()OptodeSelectorOptodeSelector.surfaceOptodeSelector.pointsOptodeSelector.normalsOptodeSelector.plotterOptodeSelector.labelsOptodeSelector.actorsOptodeSelector.colorOptodeSelector.plot()OptodeSelector.on_pick()OptodeSelector.update_visualization()OptodeSelector.enable_picking()OptodeSelector.enable_picking()OptodeSelector.find_surface_normal()OptodeSelector.on_pick()OptodeSelector.plot()OptodeSelector.update_normals()OptodeSelector.update_visualization()
scalp_plot()scalp_plot_gif()
- cedalion.vis.misc package
Submodules
cedalion.vis.blocks module
Blocks of plotting functionality to build visualizations.
- cedalion.vis.blocks.plot_stim_markers(
- ax,
- stim: DataFrame,
- fmt: dict[str, dict] | None = None,
- y: float = 0.03,
Add stimulus indicators to an Axes.
For each trial a Rectangle is plotted in x from onset to onset+duration. The height of the rectangle is specified in axes coordinates. In the default setting a small bar at bottom of the axes is drawn. By setting y to 1. the stimulus marker covers the full height of the axes.
- Parameters:
ax – the matplotlib axes to operate on
stim – a stimulas data frame
fmt – for each trial_type a dictioniary of keyword arguments can be provided. These kwargs are passed to matplotlib.patches.Rectangle to format the stimulus indicator.
y – the height of the Rectangle in axes coordinates.
- Initial Contributors:
Eike Middell | middell@tu-berlin.de | 2024
- cedalion.vis.blocks.plot_segments(
- ax,
- segments: list[tuple[float, float]],
- fmt: dict | None = None,
- y: float = 1.0,
- label: str | None = None,
Highlight time segments in line plots.
- cedalion.vis.blocks.plot_surface(
- plotter: pv.Plotter,
- surface: cdc.Surface,
- color: pv.ColorLike | ArrayLike | None = None,
- opacity: float = 1.0,
- pick_landmarks: bool = False,
- **kwargs,
Plots a surface mesh with optional landmark picking in a PyVista plotter.
- Parameters:
plotter – A PyVista plotter instance used for rendering the surface.
surface – The surface object to be plotted.
color – Color of the mesh.
opacity – Opacity of the mesh, ranging from 0 (transparent) to 1 (opaque). Default is 1.0.
pick_landmarks – If True, enables interactive picking of landmarks on the surface. Default is False.
**kwargs – Additional keyword arguments are passed to pv.add_mesh.
- Returns:
If pick_landmarks is True, returns a function that when called, provides the current picked points and their labels. This function prints warnings if some labels are missing or are repeated.
- Return type:
function
- Initial Contributors:
Eike Middell | middell@tu-berlin.de | 2024
Masha Iudina | mashayudi@gmail.com | 2024
- cedalion.vis.blocks.plot_labeled_points(
- plotter: pv.Plotter,
- points: cdt.LabeledPoints,
- color: pv.ColorLike | None = None,
- show_labels: bool = False,
- ppoints: bool = None,
- labels: list[str] | None = None,
Plots LabeledPoints with optional interaction for picking points.
This function visualizes a point cloud where each point can have a label. Points can be interactively picked if enabled. Picked point is indicated by increased radius.
- Parameters:
plotter – A PyVista plotter instance used for rendering the points.
points – A labeled point cloud data structure containing points and optional labels.
color – Override color for all points. If None, colors are assigned based on point types.
show_labels – If True, labels are displayed next to the points.
ppoints – A list to store indices of picked points, enables picking if not None.
labels – List of labels to show if show_labels is True. If None and show_labels is True, the labels from points are used.
- Initial Contributors:
Eike Middell | middell@tu-berlin.de | 2024
- cedalion.vis.blocks.plot_vector_field(
- plotter: Plotter,
- points: cdt.LabeledPoints,
- vectors: DataArray,
- ppoints=None,
Plots a vector field on a PyVista plotter.
- Parameters:
plotter (pv.Plotter) – A PyVista plotter instance used for rendering the vector field.
points (cdt.LabeledPoints) – A labeled point cloud data structure containing point coordinates.
vectors (xr.DataArray) – A data array containing the vector field.
ppoints (list, optional) – A list to store indices of picked points, enables picking if not None. Default is None.
- cedalion.vis.blocks.camera_at_cog(
- plt: Plotter,
- surface: Surface,
- rpos: tuple[float, float, float],
- fp_offset: tuple[float, float, float] = (0, 0, 0),
- up: tuple[float, float, float] = (0, 0, 1),
- fit_scene: bool = False,
Point the camera at the center of gravity of the surface vertices.
- Parameters:
plt – the pyvista plotter
surface – the surface from which the COG should be calculated
rpos – positin of the camera relative to the COG
fp_offset – offset from the COG to calculate the focal point
up – direction of upwards.
fit_scene – if True the camera is moved along the position-to-focal-point line to fit all objects in the scene into the view.
cedalion.vis.colors module
Color and colormap definitions.
- cedalion.vis.colors.segmented_cmap(
- name: str,
- vmin: float,
- vmax: float,
- segments: list[tuple[float, tuple[float, float, float] | str | tuple[float, float, float, float] | tuple[tuple[float, float, float] | str, float] | tuple[tuple[float, float, float, float], float]]],
- over: None | tuple[float, float, float] | str | tuple[float, float, float, float] | tuple[tuple[float, float, float] | str, float] | tuple[tuple[float, float, float, float], float] = None,
- under: None | tuple[float, float, float] | str | tuple[float, float, float, float] | tuple[tuple[float, float, float] | str, float] | tuple[tuple[float, float, float, float], float] = None,
- bad: None | tuple[float, float, float] | str | tuple[float, float, float, float] | tuple[tuple[float, float, float] | str, float] | tuple[tuple[float, float, float, float], float] = None,
Create a linear segmented colormap.
- cedalion.vis.colors.p_values_cmap() tuple[Normalize, LinearSegmentedColormap][source]
A colormap for log10(p-values).
Gray for p>0.05 and with different colors for common thresholds.
cedalion.vis.quality module
Tools for visualizing signal quality metrics and masks.
cedalion.vis.timeseries module
Tools for plotting temporal data.