organoid_tracker.core.link_data module
- class organoid_tracker.core.link_data.LinkData
Bases:
object
Used to supply additional metadata to links.
- copy() LinkData
Creates a copy of this linking dataset. Changes to the copy will not affect this object, and vice versa.
- find_all_data_of_link(position1: Position, position2: Position) Iterable[Tuple[str, Union[float, int, str, bool, List[float], List[int], List[str], List[bool]]]]
Finds all data associated with the given link. Raises ValueError if the two positions are not in consecutive time points.
- find_all_links_with_data(data_name: str) ItemsView[Tuple[Position, Position], Union[float, int, str, bool, List[float], List[int], List[str], List[bool]]]
Gets a dictionary of all positions with the given data marker. Do not modify the returned dictionary.
- get_link_data(position1: Position, position2: Position, data_name: str) Optional[Union[float, int, str, bool, List[float], List[int], List[str], List[bool]]]
Gets the attribute of the link with the given name. Returns None if not found. Raises ValueError if the two positions are not in consecutive time points.
- merge_data(other: LinkData)
Merges all data from the given dataset into this one. Changes to the other dataset made afterwards may “write-through” into this dataset.
- remove_link(position1: Position, position2: Position)
Removes all data of the given link. Raises ValueError if the two positions are not in consecutive time points.
- replace_link(position_old1: Position, position_old2: Position, position_new1: Position, position_new2: Position)
Replaces a link, for example if the position moved. Raises ValueError if any of the two links are not between consecutive time points. Raises ValueError if the time points of the links are changed.
- set_link_data(position1: Position, position2: Position, data_name: str, value: Optional[Union[float, int, str, bool, List[float], List[int], List[str], List[bool]]])
Adds or overwrites the given attribute for the given position. Set value to None to delete the attribute. Raises ValueError if the two positions are not in consecutive time points.
Note: this is a low-level API. See the linking_markers module for more high-level methods, for example for how to read end markers, error markers, etc.