organoid_tracker.image_loading.builtin_image_filters module

Some builtin image filters, so that they can be saved and loaded.

class organoid_tracker.image_loading.builtin_image_filters.GaussianBlurFilter(blur_radius: float = 5)

Bases: ImageFilter

Applies a Gaussian blur in 2D.

blur_radius: float
copy() ImageFilter

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

filter(time_point, image_z, 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.

get_name() str

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

class organoid_tracker.image_loading.builtin_image_filters.IntensityPoint(time_point, z)

Bases: NamedTuple

distance_squared(other: IntensityPoint) int
time_point: TimePoint

Alias for field number 0

z: int

Alias for field number 1

class organoid_tracker.image_loading.builtin_image_filters.InterpolatedMinMaxFilter(points_to_min_max: Optional[Dict[IntensityPoint, Tuple[float, float]]] = None)

Bases: ImageFilter

Allows you to set the min/max pixel values at different points during the time-lapse. For all other points, the min and max values are interpolated.

copy() InterpolatedMinMaxFilter

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

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.

get_name() str

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

get_point_exact(point: IntensityPoint) Optional[Tuple[float, float]]

Gets the min/max value that was stored for the given point. If there is no value stored for that point, then this method returns None. (So it won’t interpolate between points, unlike self.interpolate_point().

interpolate_point(search_point: IntensityPoint) Optional[Tuple[float, float]]
points: Dict[IntensityPoint, Tuple[float, float]]
set_point(point: IntensityPoint, value: Optional[Tuple[float, float]])

Sets a point, or deletes it if the value is None.

class organoid_tracker.image_loading.builtin_image_filters.MultiplyPixelsFilter(factor: float)

Bases: ImageFilter

Increases the brightness of all pixels.

copy()

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

factor: float
filter(time_point, image_z, 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.

get_name() str

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

class organoid_tracker.image_loading.builtin_image_filters.ThresholdFilter(noise_limit: float = 0.08)

Bases: ImageFilter

Sets all pixels below a relative threshold to zero.

copy() ImageFilter

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

filter(time_point, image_z, 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.

get_name() str

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

noise_limit: float
organoid_tracker.image_loading.builtin_image_filters.create_min_max_filter(min_value: float, max_value: float) ImageFilter

Creates a filter that sets the min and max pixel values.

We implement this using the InterpolatedMinMaxFilter. When we supply only one point, it will not interpolate, and works perfectly fine as a simple min-max filter.