class neuroglancer.viewer_state.StarredSegments(
    
MutableMapping[int, bool]
)

Public members

StarredSegments(json_data=None_readonly=False)

Initialize self. See help(type(self)) for accurate signature.

copy()

Returns a copy of the starred segment list.

__len__(-> int

Returns the number of starred segments.

__contains__(segment_id: Any-> bool

Checks if a segment is starred.

keys(-> KeysView[int]

Returns a view of the starred segments.

values(-> ValuesView[bool]

Returns a view of the visibility state of each starred segment.

items(-> ItemsView[int, bool]

Returns a view of the (segment, visible) pairs.

__eq__(other-> bool

Return self==value.

add(segment_id: int-> None

Adds a starred segment, marking it visible if not already starred.

get(segment_id: int-> bool | None
get[T](segment_id: intdefault: T-> bool | T

Checks if a segment is visible.

__getitem__(segment_id: int-> bool

Checks if a starred segment is visible.

remove(segment_id: int-> None

Removes a segment from the starred list.

discard(segment_id: int-> None

Removes a segment from the starred list if present.

__setitem__(segment_id: intvisible: bool)

Stars and sets the visibility of a segment.

__delitem__(segment_id: int-> None

Removes a segment from the starred list.

clear()

Unstars all segments.

__repr__()

Return repr(self).

update(other)

Merges in additional starred segments.

to_json(-> list[str]

Returns the representation as a list of strings.

visibleVisibleSegments