142 lines
5.2 KiB
Python
142 lines
5.2 KiB
Python
# This file is automatically generated by pyo3_stub_gen
|
|
# ruff: noqa: E501, F401, F403, F405
|
|
|
|
import builtins
|
|
import numpy
|
|
import numpy.typing
|
|
import typing
|
|
|
|
__all__ = [
|
|
"BackgroundSubtraction",
|
|
"ModelAnalysis",
|
|
"ModelAnalysisResult",
|
|
"gaussian",
|
|
"gaussian_pixel_int",
|
|
]
|
|
|
|
class BackgroundSubtraction:
|
|
def __new__(cls, t: builtins.str) -> BackgroundSubtraction: ...
|
|
def __getnewargs__(self) -> builtins.str: ...
|
|
def __repr__(self) -> builtins.str: ...
|
|
@staticmethod
|
|
def none() -> BackgroundSubtraction: ...
|
|
@staticmethod
|
|
def constant() -> BackgroundSubtraction: ...
|
|
@staticmethod
|
|
def tilted() -> BackgroundSubtraction: ...
|
|
|
|
class ModelAnalysis:
|
|
r"""
|
|
Applies the algorithm from [Thompson et al. (2002) PNAS, 82:2775].
|
|
"""
|
|
@property
|
|
def sigma(self) -> list[float]: ...
|
|
@sigma.setter
|
|
def sigma(self, value: numpy.typing.ArrayLike) -> None: ...
|
|
@property
|
|
def window_shape(self) -> list[int]: ...
|
|
@window_shape.setter
|
|
def window_shape(self, value: numpy.typing.ArrayLike) -> None: ...
|
|
@property
|
|
def max_iterations(self) -> builtins.int: ...
|
|
@max_iterations.setter
|
|
def max_iterations(self, value: builtins.int) -> None: ...
|
|
@property
|
|
def tolerance(self) -> builtins.float: ...
|
|
@tolerance.setter
|
|
def tolerance(self, value: builtins.float) -> None: ...
|
|
@property
|
|
def background_subtraction(self) -> BackgroundSubtraction: ...
|
|
@background_subtraction.setter
|
|
def background_subtraction(self, value: typing.Any) -> None: ...
|
|
@property
|
|
def fix_location(self) -> builtins.bool: ...
|
|
@fix_location.setter
|
|
def fix_location(self, value: builtins.bool) -> None: ...
|
|
def __new__(
|
|
cls,
|
|
sigma: typing.Sequence[builtins.float],
|
|
window_shape: typing.Sequence[builtins.int],
|
|
max_iterations: builtins.int = 20,
|
|
tolerance: builtins.float = 0.01,
|
|
background_subtraction: typing.Optional[typing.Any] = None,
|
|
fix_location: builtins.bool = False,
|
|
) -> ModelAnalysis: ...
|
|
def __repr__(self) -> builtins.str: ...
|
|
def __getnewargs__(
|
|
self,
|
|
) -> tuple[
|
|
builtins.list[builtins.float],
|
|
builtins.list[builtins.int],
|
|
builtins.int,
|
|
builtins.float,
|
|
builtins.str,
|
|
builtins.bool,
|
|
]: ...
|
|
def fit(self, g: numpy.typing.ArrayLike, x: numpy.typing.ArrayLike) -> ModelAnalysisResult: ...
|
|
def with_sigma(self, sigma: numpy.typing.ArrayLike) -> ModelAnalysis: ...
|
|
def with_window_shape(self, window_shape: numpy.typing.ArrayLike) -> ModelAnalysis: ...
|
|
def with_max_iterations(self, max_iterations: builtins.int) -> ModelAnalysis: ...
|
|
def with_tolerance(self, tolerance: builtins.float) -> ModelAnalysis: ...
|
|
def with_background_subtraction(self, background_subtraction: typing.Any) -> ModelAnalysis: ...
|
|
def with_fix_location(self, fix_location: builtins.bool) -> ModelAnalysis: ...
|
|
|
|
class ModelAnalysisResult:
|
|
@property
|
|
def iterations(self) -> builtins.int: ...
|
|
@property
|
|
def integrated_intensity(self) -> builtins.float: ...
|
|
@property
|
|
def position(self) -> list[float]: ...
|
|
@property
|
|
def sigma(self) -> list[float]: ...
|
|
@property
|
|
def background(self) -> list[float]: ...
|
|
def __new__(
|
|
cls,
|
|
iterations: builtins.int,
|
|
integrated_intensity: builtins.float,
|
|
position: typing.Sequence[builtins.float],
|
|
sigma: typing.Sequence[builtins.float],
|
|
background: typing.Sequence[builtins.float],
|
|
) -> ModelAnalysisResult: ...
|
|
def __repr__(self) -> builtins.str: ...
|
|
def __getnewargs__(
|
|
self,
|
|
) -> tuple[
|
|
builtins.int,
|
|
builtins.float,
|
|
builtins.list[builtins.float],
|
|
builtins.list[builtins.float],
|
|
builtins.list[builtins.float],
|
|
]: ...
|
|
|
|
def gaussian(x: numpy.typing.ArrayLike, p: numpy.typing.ArrayLike) -> numpy.typing.NDArray[numpy.float64]:
|
|
r"""
|
|
p: I, x0, x1, ... xn-1, s0, s1, ..., sn-1, r0, r1, ..., rm-1, o, o0, o1, ..., on-1
|
|
r: upper triangle without diagonal of (I-R)*(I+R)^{-1} (Cayley transform),
|
|
for 2D: theta(theta/2)
|
|
x: n 1d arrays, defining coordinates in each dimension
|
|
"""
|
|
|
|
def gaussian_pixel_int(x: numpy.typing.ArrayLike, p: numpy.typing.ArrayLike) -> numpy.typing.NDArray[numpy.float64]:
|
|
r"""
|
|
p: I, x0, x1, ... xn-1, s0, s1, ..., sn-1, r0, r1, ..., rm-1, o, o0, o1, ..., on-1
|
|
r: upper triangle without diagonal of (I-R)*(I+R)^{-1} (Cayley transform),
|
|
for 2D: theta(theta/2)
|
|
x: n 1d arrays, defining coordinates in each dimension
|
|
|
|
gaussian, but the signal is integrated over each pixel
|
|
|
|
Pixels are assumed to be unit hypercubes, i.e. pixel `i` in each dimension
|
|
covers `[x_i - 1/2, x_i + 1/2]`.
|
|
|
|
The pixel integral is evaluated as a product of 1D analytic integrals in
|
|
the eigenspace of the covariance (exact when the covariance is diagonal,
|
|
and the standard product-form approximation otherwise). Eigenvalues below
|
|
`n * eps * lambda_max` are treated as zero, in which case that dimension
|
|
contributes the point-emitter limit: 1 inside the pixel containing the
|
|
center, 1/2 on its boundary, and 0 elsewhere. Unlike `gaussian`, this works
|
|
for rank-deficient covariances.
|
|
"""
|