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 (str | Path | bytes | BinaryIO | BufferedIOBase | BufferedReader | 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 (ndarray[Any, dtype[str_]] | list[str] | tuple[str, ...] | Series | Series) – ArrayLike[str, R]

  • values (ndarray[Any, dtype[T]] | list[T] | tuple[T, ...] | Series | Series | None) – ArrayLike[float, R]

  • coord (int)

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

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

  • hemisphere (Literal['left', 'right', 'both']) – HEMISPHERE_TYPE. {‘left’, ‘right’, ‘both’}

  • background (Literal['image', 'boundary']) – IBL_BG_TYPE. {‘image’, ‘boundary’}

  • cmap (str)

  • clevels (ndarray[Any, dtype[T]] | list[T] | tuple[T, ...] | Series | Series | None)

  • show_cbar (bool)

  • empty_color (str)

  • ax (Axes | None)

  • vector (bool)

  • slice_files (ndarray | None)

  • auto_merge (bool) – merge for the certain mapping

  • verbose (bool)

  • kwargs

Returns:

Return type:

tuple[Figure, Axes] | tuple[Figure, Axes, 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 (ndarray)

  • values (ndarray[Any, dtype[T]] | list[T] | tuple[T, ...] | Series | Series | None)

  • coord (int)

  • plane (Literal['coronal', 'sagittal', 'horizontal', 'top'])

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

  • background (Literal['image', 'boundary'])

  • cmap (str)

  • clevels (ndarray[Any, dtype[T]] | list[T] | tuple[T, ...] | Series | Series | None)

  • show_cbar (bool)

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

  • fwhm (int)

  • ax (Axes | None)

Returns:

Return type:

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