Scatterer#
- class deeptrack.scatterers.Scatterer(position: Tuple[float, ...] | List[float] | ndarray | Callable[[...], Tuple[float, ...] | List[float] | ndarray] = (32, 32), z: float | Callable[[...], float] = 0.0, value: float | Callable[[...], float] = 1.0, position_unit: str | Callable[[...], str] = 'pixel', upsample: int | Callable[[...], int] = 1, voxel_size=None, pixel_size=None, **kwargs)#
Bases:
Feature
Base abstract class for scatterers.
A scatterer is defined by a 3-dimensional volume of voxels. To each voxel corresponds an occupancy factor, i.e., how much of that voxel does the scatterer occupy. However, this number is not necessarily limited to the [0, 1] range. It can be any number, and its interpretation is left to the optical device that images the scatterer.
This abstract class implements the _process_properties method to convert the position to voxel units, as well as the _process_and_get method to upsample the calculation and crop empty slices.
Parameters#
- positionarray_like of length 2 or 3
The position of the particle. Third index is optional, and represents the position in the direction normal to the camera plane.
- zfloat
The position in the direction normal to the camera plane. Used if position is of length 2.
- valuefloat
A default value of the characteristic of the particle. Used by optics unless a more direct property is set (eg. refractive_index for Brightfield and intensity for Fluorescence).
- position_unit“meter” or “pixel”
The unit of the provided position property.
Other Parameters#
- upsample_axestuple of ints
Sets the axes along which the calculation is upsampled (default is None, which implies all axes are upsampled).
- crop_zerosbool
Whether to remove slices in which all elements are zero.