napari_track_edit.data_views.views.layers.out_of_slice_points

Attributes

_HAS_SIZE_BASED_OUT_OF_SLICE

ZOnlyPoints

Classes

_ZOnlyPointSliceRequest

A callable that stores all the input data needed to slice a Points layer.

_ZOnlyPointsSlicingState

Slicing state that builds a z-only out-of-slice request.

_ZOnlyPoints

Points subclass that overrides the slice request to apply the out-of-slice display logic only along the last non displayed axis.

Module Contents

class napari_track_edit.data_views.views.layers.out_of_slice_points._ZOnlyPointSliceRequest

Bases: napari.layers.points._slice._PointSliceRequest

A callable that stores all the input data needed to slice a Points layer.

This should be treated a deeply immutable structure, even though some fields can be modified in place. It is like a function that has captured all its inputs already.

In general, the calling an instance of this may take a long time, so you may want to run it off the main thread.

dims

Describes the slicing plane or bounding box in the layer’s dimensions.

Type:

_SliceInput

data

The layer’s data field, which is the main input to slicing.

Type:

Any

data_slice

The slicing coordinates and margins in data space.

Type:

_ThickNDSlice

size

Size of each point. This is used in calculating visibility.

Type:

array like

shown

Boolean array indicating if each point should be shown.

Type:

array like

others

See the corresponding attributes in Layer and Points.

_get_slice_data(not_disp: list[int]) → tuple[numpy.typing.NDArray, int]

Modified _get_slice_data function from napari’s _PointSliceRequest to apply the out-of-slice display logic only along the last non displayed axis, assumed to be z.

Args: not_disp (list[int]): List of non-displayed dimensions (e.g. [0, 1] for t, z)

Returns: tuple[npt.NDArray, int]: A tuple containing the indices of the points that are inside the slice and the scale factor for out-of-slice points.

class napari_track_edit.data_views.views.layers.out_of_slice_points._ZOnlyPointsSlicingState(layer: napari.layers.base.Layer, data: napari.types.LayerDataType, cache: bool)

Bases: napari.layers.points.points._PointsSlicingState

Slicing state that builds a z-only out-of-slice request.

make_slice_request_internal(slice_input, data_slice)
class napari_track_edit.data_views.views.layers.out_of_slice_points._ZOnlyPoints(data=None, ndim=None, *, affine=None, antialiasing=1, axis_labels=None, blending='translucent', border_color='dimgray', border_color_cycle=None, border_colormap='viridis', border_contrast_limits=None, border_width=0.05, border_width_is_relative=True, cache=True, canvas_size_limits=(2, 10000), experimental_clipping_planes=None, face_color='white', face_color_cycle=None, face_colormap='viridis', face_contrast_limits=None, feature_defaults=None, features=None, metadata=None, name=None, opacity=1.0, projection_mode='all', properties=None, property_choices=None, rotate=None, scale=None, shading='none', shear=None, shown=True, size=10, symbol='o', text=None, translate=None, units=None, visible=True)

Bases: napari.layers.Points

Points subclass that overrides the slice request to apply the out-of-slice display logic only along the last non displayed axis.

Since napari 0.7 the slice request is built by a separate _PointsSlicingState object, reached via _get_layer_slicing_state, so hook in there.

_get_layer_slicing_state(data, cache)

Return a LayerSlicer instance appropriate for this layer.

napari_track_edit.data_views.views.layers.out_of_slice_points._HAS_SIZE_BASED_OUT_OF_SLICE
napari_track_edit.data_views.views.layers.out_of_slice_points.ZOnlyPoints