NonOverlapping#

class deeptrack.features.NonOverlapping(feature: Feature, min_distance: float = 1, max_attempts: int = 100, **kwargs: Dict[str, Any])#

Bases: Feature

Ensure volumes are placed non-overlapping in a 3D space.

This feature ensures that a list of 3D volumes are positioned such that their non-zero voxels do not overlap. If volumes overlap, their positions are resampled until they are non-overlapping. If the maximum number of attempts is exceeded, the feature regenerates the list of volumes.

This feature is incompatible with non-volumetric scatterers such as MieScatterers.

Parameters#

featureFeature

The feature that generates the list of volumes to place non-overlapping.

min_distancefloat, optional

The minimum distance between volumes in pixels. Defaults to 1.

max_attemptsint, optional

The maximum number of attempts to place volumes without overlap. If exceeded, a new list of volumes is generated. Defaults to 100.

Methods Summary

get(_, min_distance, max_attempts, **kwargs)

Parameters _ Any Placeholder for unused input image. min_distance float The minimum distance between volumes in pixels. max_attempts int The maximum number of attempts to place the volumes non-overlapping. If this number is exceeded, a new list of volumes is generated.

Methods Documentation

get(_: Any, min_distance: float, max_attempts: int, **kwargs: Dict[str, Any]) List[ndarray]#

Parameters#

_Any

Placeholder for unused input image.

min_distancefloat

The minimum distance between volumes in pixels.

max_attemptsint

The maximum number of attempts to place the volumes non-overlapping. If this number is exceeded, a new list of volumes is generated.

Returns#

List[np.ndarray]

A list of non-overlapping 3D volumes.