organoid_tracker.core.beacon_collection module

class organoid_tracker.core.beacon_collection.BeaconCollection

Bases: object

Ordered list of beacons per time point.

add(position: Position)

Adds a new beacon. Duplicate beacons are allowed.

add_beacons(beacons: BeaconCollection)

Adds all beacons from the given collection to this collection. Like for add(..), duplicate beacons are allowed.

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.

get_beacon_by_index(time_point: TimePoint, index: int) Optional[Position]

Gets the beacon with the given index at the given time point. Index 1 is the first beacon.

get_next_index(time_point: TimePoint) int

Beacons have indices: 1, 2, 3, etc. for every time point. This method returns the index that the next beacon placed at the given time point will get.

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.

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.

time_points() Iterable[TimePoint]

Gets all used time points.

class organoid_tracker.core.beacon_collection.ClosestBeacon(search_position: Position, beacon_position: Position, beacon_index: int, distance_um: float, resolution: ImageResolution)

Bases: object

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

beacon_index: int
beacon_position: Position
difference_um() Vector3

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

distance_um: float
resolution: ImageResolution
search_position: Position