Bind#

class deeptrack.features.Bind(feature: Feature, **kwargs: dict[str, Any])#

Bases: StructuralFeature

Bind a feature with property arguments.

When the feature is resolved, the kwarg arguments are passed to the child feature. Thus, this feature allows passing additional keyword arguments (kwargs) to a child feature when it is resolved. These properties can dynamically control the behavior of the child feature.

Parameters#

feature: Feature

The child feature

**kwargs: dict of str to Any

Properties to send to child

Methods#

get(image: Any, **kwargs: dict[str, Any]) -> Any

Resolves the child feature with the provided arguments.

Examples#

>>> import deeptrack as dt
>>> import numpy as np

Start by creating a Gaussian feature: >>> gaussian_noise = dt.Gaussian()

Dynamically modify the behavior of the feature using Bind: >>> bound_feature = dt.Bind(gaussian_noise, mu = -5, sigma=2)

>>> input_image = np.zeros((512, 512))
>>> output_image = bound_feature.resolve(input_image)
>>> print(np.mean(output_image), np.std(output_image))
-4.9954959040123152 1.9975296489398942

Methods Summary

get(image, **kwargs)

Resolve the child feature with the dynamically provided arguments.

Methods Documentation

get(image: Any, **kwargs: dict[str, Any]) Any#

Resolve the child feature with the dynamically provided arguments.

Parameters#

image: Any

The input data or image to process.

**kwargs: dict of str to Any

Properties or arguments to pass to the child feature during resolution.

Returns#

Any

The result of resolving the child feature with the provided arguments.