organoid_tracker.core.beacon_collection module

class organoid_tracker.core.beacon_collection.Beacon(position: Position, beacon_type: Optional[str])

Bases: NamedTuple

A beacon is a named point in space.

beacon_type: Optional[str]

Alias for field number 1

position: Position

Alias for field number 0

class organoid_tracker.core.beacon_collection.BeaconCollection

Bases: object

Ordered list of beacons per time point.

add(position: Position, beacon_type: Optional[str] = None)

Adds a new beacon. If there is already a beacon at the given position, it is overwritten.

add_beacons(beacons: BeaconCollection)

Adds all beacons from the given collection to this collection.

contains_position(beacon: Position) bool

Gets whether the given beacon exists in this collection.

count_beacons_at_time_point(time_point: TimePoint) int

Gets the number of beacons at the given time point.

find_closest_beacon(position: Position, resolution: ImageResolution) Optional[ClosestBeacon]

Finds the closest beacon at the same time point as the position. Returns None if there are no beacons at that time point.

find_single_beacon() Optional[Position]

If there is only one beacon in the entire experiment, return it. Otherwise, it returns None.

find_single_beacon_of_time_point(time_point: TimePoint) Optional[Position]

If there is only one beacon in the given time point, return it. Otherwise, it returns None.

get_beacon_type(beacon_position: Position) Optional[str]

Gets the name of the beacon at the given position.

has_beacons() bool

Checks whether there are any beacons stored.

move(old_position: Position, new_position: Position) bool

Moves a beacon from its old to its new position. The old and new positions must have the same time point. Does nothing and returns False if there was no beacon at old_position. Returns True if successful.

move_in_time(time_point_delta: int)

Moves all data with the given time point delta.

of_time_point(time_point: TimePoint) Iterable[Position]

Gets all beacons at the given time point.

of_time_point_with_type(time_point: TimePoint) Iterable[Beacon]

Gets all beacons at the given time point, including their beacon types.

remove(position: Position) bool

Removes the beacon at the given position. Returns True if succesful, returns False if there was no beacon at that position.

set_beacon_type(beacon_position: Position, name: Optional[str])

Sets the name of the beacon at the given position. Does nothing if there is no beacon at that position.

time_points() Iterable[TimePoint]

Gets all used time points.

class organoid_tracker.core.beacon_collection.ClosestBeacon(search_position: Position, beacon_position: Position, beacon_type: Optional[str], distance_um: float, resolution: ImageResolution)

Bases: object

Used to represent the distance towards, the identity and the position of the closest beacon.

property beacon: Beacon

Gets the beacon as a Beacon object.

beacon_index: int
beacon_position: Position
beacon_type: str
difference_um() Vector3

Gets the difference between the search position and the beacon position in micrometers.

distance_um: float
resolution: ImageResolution
search_position: Position