organoid_tracker.core package
Submodules
- organoid_tracker.core.beacon_collection module
- organoid_tracker.core.bounding_box module
- organoid_tracker.core.concurrent module
- organoid_tracker.core.connections module
- organoid_tracker.core.experiment module
- organoid_tracker.core.full_position_snapshot module
- organoid_tracker.core.global_data module
- organoid_tracker.core.image_coloring module
- organoid_tracker.core.image_filters module
- organoid_tracker.core.image_loader module
- organoid_tracker.core.images module
- organoid_tracker.core.link_data module
- organoid_tracker.core.links module
- organoid_tracker.core.marker module
- organoid_tracker.core.mask module
- organoid_tracker.core.position module
- organoid_tracker.core.position_collection module
- organoid_tracker.core.position_data module
- organoid_tracker.core.resolution module
- organoid_tracker.core.spline module
- organoid_tracker.core.typing module
- organoid_tracker.core.vector module
- organoid_tracker.core.warning_limits module
Module contents
The core classes of OrganoidTracker. The most important one is Experiment
,
which holds all data of a single time-lapse movie.
Some example code to construct positions and links:
>>> from organoid_tracker.core.experiment import Experiment
>>> from organoid_tracker.core.images import ImageResolution
>>> from organoid_tracker.core.position import Position
>>> experiment = Experiment()
>>> experiment.images.set_resolution(ImageResolution(0.32, 0.32, 2, 12))
>>> experiment.name.set_name("Some name")
>>>
>>> # Add two positions and link them
>>> experiment.positions.add(Position(0, 0, 0, time_point_number=0))
>>> experiment.positions.add(Position(1, 3, 0, time_point_number=1))
>>> experiment.links.add_link(Position(0, 0, 0, time_point_number=0), Position(1, 3, 0, time_point_number=1))
>>>
>>> print(experiment.positions.of_time_point(TimePoint(1))) # "{Position(1, 3, 0, time_point_number=1)}"
- class organoid_tracker.core.Color(red: int, green: int, blue: int)
Bases:
object
Represents an RGB color.
- static black()
Returns a fully black color.
- static from_matplotlib(mpl_color: Union[Tuple[float, float, float], Tuple[float, float, float, float], str, float]) Color
Creates a color using the Matplotlib library, so you can for example do Color.from_matplotlib(“red”).
- static from_rgb_floats(red: float, green: float, blue: float) Color
Creates a color using a RGB float color, for example (1.0, 1.0, 1.0) for white.
- to_html_hex()
Returns the color as a hexadecimal value. Same as str(…).
- to_rgb_floats() Tuple[float, float, float]
Gets the color as a RGB tuple, for use with matplotlib.
- to_rgba_floats() Tuple[float, float, float, float]
Gets the color as a RGBA tuple, for use with matplotlib.
- static white()
Returns a fully white color.
- class organoid_tracker.core.Name(name: Optional[str] = None, *, is_automatic: bool = False)
Bases:
object
The name of the experiment. Includes a flag, is_automatic, that specifies whether the name was manually set or generated by the computer (for example from the image file name).
- get_name() Optional[str]
Returns the name, or None if not set. Note: use str(self) if you want “Unnamed” instead of None if there is no name.
- get_save_name() str
Gets a name that is safe for file saving. It does not contain characters like / or , and no whitespace at the start or end.
- class organoid_tracker.core.TimePoint(time_point_number: int)
Bases:
object
A single point in time.
- exception organoid_tracker.core.UserError(title: str, message: str)
Bases:
Exception
Used for errors that are not the fault of the programmer, but of the user.
- organoid_tracker.core.clamp(minimum: int, value: int, maximum: int)
Clamps the given value to the specified min and max. For example, clamp(2, value, 4) will return value if it’s between 2 and 4, 2 if the value is lower than 2 and 4 if the value is higher than four.
- organoid_tracker.core.max_none(numbers: Union[float, None, Iterable[Optional[float]]], *args: Optional[float])
Calculates the minimal number. None values are ignored. Usage:
>>> max_none(2, 3, 5, None, 5) == 5 >>> max_none([4, None, 2, None, -1]) == 4 >>> max_none([]) is None >>> max_none(None, None, None) is None
- organoid_tracker.core.min_none(numbers: Union[float, None, Iterable[Optional[float]]], *args: Optional[float])
Calculates the minimal number. None values are ignored. Usage:
>>> min_none(2, 3, 5, None, 5) == 2 >>> min_none([4, None, 2, None, -1]) == -1 >>> min_none([]) is None >>> min_none(None, None, None) is None