plots.figure_encoder_coronal
plots.figure_encoder_coronal(
encoder,
features,
ap_m,
brain_atlas=None,
step=4,
mapping='Cosmos',
percentiles=(2, 98),
scales=None,
units=None,
cmap='magma',
show_boundaries=True,
show_colorbar=True,
show_titles=True,
fig=None,
axs=None,
)Features predicted by the spatial encoder on a coronal plane, one panel per feature.
Predicts every step-th voxel of the plane that lies inside the brain, in one call to encoder.predict_xyz, then draws each feature with the region outlines on top.
Args: encoder (ephysatlas.models.encoder_inpainting.SpatialEncoder): The spatial encoder, from load_pretrained("int-brain-lab/ea-encoder-channel", ...). features (list[str]): Features to draw, from encoder.features. ap_m (float): Antero-posterior coordinate of the plane, in metres from bregma. brain_atlas (iblatlas.atlas.BrainAtlas, optional): Atlas for the brain mask, the voxel coordinates and the outlines. Defaults to AllenAtlas(res_um=25), which downloads the Allen volumes on first use. step (int, optional): Predict every step-th voxel along ML and DV. Defaults to 4 (100 µm with the 25 µm atlas). mapping (str, optional): Region map of the outlines. Defaults to “Cosmos”. percentiles (tuple, optional): Percentiles of each panel’s values that set its colour range. Defaults to (2, 98). scales (dict[str, float], optional): Factor applied to a feature before drawing, e.g. {"spike_amplitude": 1e6} for µV. Defaults to none. units (dict[str, str], optional): Colorbar label of a feature. Defaults to none. cmap (str, optional): Matplotlib colormap name. Defaults to “magma”. show_boundaries (bool, optional): Draw the region outlines. Defaults to True. show_colorbar (bool, optional): Draw a colorbar beside each panel. Defaults to True. show_titles (bool, optional): Title each panel with its feature. Defaults to True. fig (matplotlib.figure.Figure, optional): Figure of axs. axs (Sequence[matplotlib.axes.Axes], optional): One axes per feature.
Returns: tuple: The figure, and a dict of axes keyed by feature.
Raises: ValueError: If a feature is not predicted by the encoder.