widgets#
- class Scatter3D(coordinates, smarties=False, colors=None, hemispheres=None, z_radius=None, marker_size=5)[source]#
Bases:
objectScatter dataset for display in
DataViewer.Markers whose coordinate along the scroll axis matches the current slice are drawn at full size. When z_radius is set, markers from neighbouring slices are also drawn at reduced size to convey depth.
- Parameters:
coordinates ((N, 3) np.ndarray or pd.DataFrame) – Point positions, or a pre-built DataFrame with columns
x,y,z,colour,symbol(and optionallypen/brush). Passing a DataFrame skips the construction logic entirely.smarties (bool) – Assign a pseudo-random colour to every point (ignored when colors is provided).
colors (array-like or None) – Per-point colours as hex strings or RGB(A) arrays. Converted to hex internally.
hemispheres (array-like or None) – Integer label per point that controls the marker symbol. -1 is reserved for out-of-hemisphere points, drawn with
out_of_bounds_symbol.z_radius (int or None) – Half-width of the depth window in slices. Points within ±*z_radius* of the current slice are drawn at a size proportional to their proximity.
None/ 0 disables depth display.marker_size (int) – Base marker diameter in display pixels at the current slice (minimum 2).
- get_3d_markers(main_slice_idx, z_radius=3, base_size=None)[source]#
Collect markers from slices surrounding main_slice_idx.
Marker size scales linearly with proximity: a point at distance d from the main slice gets size
base_size * (z_radius - d) / z_radius.- Parameters:
main_slice_idx (int) – Index of the currently displayed slice.
z_radius (int) – Half-width of the depth window. Overridden by
self.z_radiuswhen that attribute is set.base_size (int or None) – Reference size for a marker at distance 0. Pass the current UI spin-box value so surrounding markers scale consistently with the main-slice markers. Defaults to
self.marker_size.
Returns
- dict
Keys:
'pos'(N×2),'size'(N,),'symbol'(N,), and'pen'(N,) whenhas_coloursis True. Returns empty arrays when z_radius is falsy or no points fall in range.
- property coordinates#
- property has_colours#
- property has_hemispheres#
- property plane_axes#