neuralib.atlas.view.SlicePlane
- class neuralib.atlas.view.SlicePlane[source]
Bases:
object2D Wrapper for a specific plane
- __init__(slice_index, ax, ay, dw, dh, slice_view, unit='a.u.')
Method generated by attrs for class SlicePlane.
- Parameters:
slice_index (int)
ax (int)
ay (int)
dw (int)
dh (int)
slice_view (AbstractSliceView)
unit (str)
- Return type:
None
Methods
__init__(slice_index, ax, ay, dw, dh, slice_view)Method generated by attrs for class SlicePlane.
plot([ax, to_um, annotation_region, ...])plot_annotation_regions(ax, regions, extent)plot_boundaries(ax, extent[, cmap, alpha])Plot the annotation boundaries
with_angle_offset([deg_x, deg_y])with degree offset
with_offset(dw, dh[, debug])Attributes
anchor index
anchor x
anchor y
dw in um
dh in um
AbstractSliceViewrelative to reference point
- slice_index: int
anchor index
- ax: int
anchor x
- __init__(slice_index, ax, ay, dw, dh, slice_view, unit='a.u.')
Method generated by attrs for class SlicePlane.
- Parameters:
slice_index (int)
ax (int)
ay (int)
dw (int)
dh (int)
slice_view (AbstractSliceView)
unit (str)
- Return type:
None
- ay: int
anchor y
- dw: int
dw in um
- dh: int
dh in um
- slice_view: AbstractSliceView
AbstractSliceView
- unit: str
- property image: ndarray
- property plane_offset: ndarray
- property reference_value: float
relative to reference point
- with_offset(dw, dh, debug=False)[source]
- Parameters:
dw (int)
dh (int)
debug (bool)
- Return type:
Self
- with_angle_offset(deg_x=0, deg_y=0)[source]
with degree offset
- Parameters:
deg_x (float) – degree in x axis (width)
deg_y (float) – degree in y axis (height)
- Returns:
- Return type:
Self
- plot(ax=None, to_um=True, annotation_region=None, boundaries=False, with_title=False, extent=None, reference_bg_value=None, annotation_cmap='berlin', annotation_rescale=True, **kwargs)[source]
- Parameters:
ax (Axes | None) – The Axes object on which to plot. If None, a new figure and axes are created.
to_um (bool) – A boolean flag indicating whether the coordinates should be converted to micrometers. Defaults to True. Only applicable if
extentis None.annotation_region (str | list[str] | None) – The annotation region on which to plot. Defaults to None.
boundaries (bool) – A boolean indicating whether to include annotations in the plot.
with_title (bool) – A boolean indicating whether to include a title in the plot.
extent (tuple[float, float, float, float] | None) – A tuple defining the image boundaries (left, right, bottom, top). If None, boundaries are computed internally.
reference_bg_value (float | None) – If specified, remove background of its value in when view_type is reference (i.e., set as 10).
annotation_cmap (str) – Cmap for the annotation regions if specified
annotation_rescale (bool) – Rescale the image when view_type is annotation.
kwargs – Additional keyword arguments passed to
ax.imshow().
- Return type:
None
- plot_boundaries(ax, extent, cmap='binary', alpha=0.5, **kwargs)[source]
Plot the annotation boundaries
- Parameters:
ax –
Axesextent – A tuple defining the image boundaries (left, right, bottom, top). If None, boundaries are computed internally.
cmap – Colormap to be used for the annotation image. Defaults to ‘binary’.
alpha – The imshow alpha, between 0 (transparent) and 1 (opaque). Defaults to 0.5.