neuralib.atlas.ibl.plot

class neuralib.atlas.ibl.plot.IBLAtlasPlotWrapper[source]

Wrapper for iblatlas plotting usage

regions: BrainRegions
__init__(res_um=10, scaling=(1, 1, 1), mock=False, source_path=None, alpha=1.0)[source]
Parameters:
  • res_um (int) – The Atlas resolution in micrometres; one of 10, 25 or 50um

  • scaling (tuple[int, int, int]) – Scale factor along ml, ap, dv for squeeze and stretch (default: [1, 1, 1])

  • mock (bool) – For testing purposes, return atlas object with image comprising zeros

  • source_path (PathLike | None) – The location of the image volume. By default, use IBL_CACHE_DIRECTORY

  • alpha (float)

get_acronym_list(mapping)[source]

get acronym list from different mapping type

Parameters:

mapping (Literal['Allen', 'Beryl', 'Cosmos', 'Swanson']) – IBL_MAPPING_TYPE

Return type:

list[str]

plot_scalar_on_slice(regions, *, values=None, coord=-570, plane='coronal', mapping='Allen', hemisphere='left', background='image', cmap='viridis', clevels=None, show_cbar=False, empty_color='silver', ax=None, vector=False, slice_files=None, auto_merge=True, verbose=True, **kwargs)[source]

Plot the slice view.

See detail in iblatlas.plots.plot_scalar_on_slice

Parameters:
  • regions (ArrayLikeStr) – ArrayLike[str, R]

  • values (ArrayLike | None) – ArrayLike[float, R]

  • coord (int)

  • plane (IBL_PLANE_TYPE) – IBL_PLANE_TYPE. {‘coronal’, ‘sagittal’, ‘horizontal’, ‘top’}

  • mapping (IBL_MAPPING_TYPE) – IBL_MAPPING_TYPE. {‘Allen’, ‘Beryl’, ‘Cosmos’, ‘Swanson’}

  • hemisphere (HEMISPHERE_TYPE) – HEMISPHERE_TYPE. {‘left’, ‘right’, ‘both’}

  • background (IBL_BG_TYPE) – IBL_BG_TYPE. {‘image’, ‘boundary’}

  • cmap (str)

  • clevels (ArrayLike | None)

  • show_cbar (bool)

  • empty_color (str)

  • ax (Axes | None)

  • vector (bool)

  • slice_files (np.ndarray | None)

  • auto_merge (bool) – merge for the certain mapping

  • verbose (bool)

  • kwargs

Returns:

Return type:

tuple[plt.Figure, Axes] | tuple[plt.Figure, Axes, plt.colorbar]

plot_points_on_slice(xyz, values=None, coord=-570, plane='coronal', mapping='Allen', background='boundary', cmap='Reds', clevels=None, show_cbar=True, aggr='count', fwhm=0, ax=None)[source]
Parameters:
  • xyz (np.ndarray)

  • values (ArrayLike | None)

  • coord (int)

  • plane (IBL_PLANE_TYPE)

  • mapping (IBL_MAPPING_TYPE)

  • background (IBL_BG_TYPE)

  • cmap (str)

  • clevels (ArrayLike | None)

  • show_cbar (bool)

  • aggr (Literal['sum', 'count', 'mean', 'std', 'median', 'min', 'max'])

  • fwhm (int)

  • ax (Axes | None)

Returns:

Return type:

tuple[plt.Figure, Axes] | tuple[plt.Figure, Axes, plt.colorbar]