organoid_tracker.core.image_filters module

class organoid_tracker.core.image_filters.ImageFilter

Bases: ABC

Filter for images, for example to enhance the contrast.

abstract copy()

Copies the filter, such that changes to this filter have no effect on the copy, and vice versa.

abstract filter(time_point: TimePoint, image_z: Optional[int], image: ndarray)

Filters the given input array, which is a grayscale array of 2 or 3 dimensions. If it is three dimensions, then image_z is None. Note that the image_z does not include any image offsets, so z=0 will always be the lowest image plane. The input array will be modified.

abstract get_name() str

Returns a user-friendly name, like “Enhance contrast” or “Suppress noise”.

class organoid_tracker.core.image_filters.ImageFilters

Bases: object

add_filter(channel: ImageChannel, filter: ImageFilter)

Adds a new filter for the given channel.

clear_channel(channel: ImageChannel)

Removes all filters for the given channel.

copy() ImageFilters

Makes a copy of this object.

filter(time_point: TimePoint, image_channel: ImageChannel, image_z: Optional[int], array: Optional[ndarray])

Applies the filters to the given array. For 2D arrays, supply an image_z. For 3D arrays, you use None instead.

has_filters() bool

Returns True if there are any filters stored here, False otherwise.

items() Iterable[Tuple[ImageChannel, List[ImageFilter]]]

Gets all channels and filters.

of_channel(channel: ImageChannel) Iterable[ImageFilter]

Gets all filters for the given channel.