impy.utils package¶
Submodules¶
impy.utils.axesop module¶
- impy.utils.axesop.add_axes(axes: Axes, shape: tuple[int, ...], key: ndarray, key_axes='yx')[source]¶
Stack key to make its shape key_axes-> axes.
impy.utils.deco module¶
- impy.utils.deco.check_input_and_output(func: Literal[None], *, inherit_label_info: bool = False, only_binary: bool = False, need_labels: bool = False) Callable[[Callable[_P, _R]], Callable[_P, _R]] [source]¶
- impy.utils.deco.check_input_and_output(func: Callable[_P, _R], *, inherit_label_info: bool = False, only_binary: bool = False, need_labels: bool = False) Callable[_P, _R]
- impy.utils.deco.check_input_and_output_lazy(func: Callable[_P, _R], *, only_binary: bool = False) Callable[_P, _R] [source]¶
- impy.utils.deco.check_input_and_output_lazy(func: Literal[None], *, only_binary: bool = False) Callable[[Callable[_P, _R], Callable[_P, _R]]]
- impy.utils.deco.dims_to_spatial_axes(func: Callable[_P, _R]) Callable[_P, _R] [source]¶
Decorator to convert input dims to correct spatial axes. Compatible with ImgArray and LazyImgArray e.g.) dims=None (default) -> “yx” or “zyx” depend on the input image dims=2 -> “yx” dims=3 -> “zyx” dims=”ty” -> “ty”
- impy.utils.deco.same_dtype(func: Callable[_P, _R], asfloat: bool = False) Callable[_P, _R] [source]¶
- impy.utils.deco.same_dtype(func: Literal[None], asfloat: bool = False) Callable[[Callable[_P, _R]], Callable[_P, _R]]
Decorator to assure output image has the same dtype as the input image. This decorator is compatible with both ImgArray and LazyImgArray.
- Parameters:
asfloat (bool, optional) – If input image should be converted to float first, by default False
impy.utils.gauss module¶
- class impy.utils.gauss.DiagonalGaussian(params=None)[source]¶
Bases:
Gaussian
- property mu¶
- property ndim¶
- property params¶
Get flattened parameters.
- property sg¶
- class impy.utils.gauss.GaussianBackground(params=None)[source]¶
Bases:
DiagonalGaussian
- class impy.utils.gauss.GaussianParticle(params=None, initial_sg=1)[source]¶
Bases:
DiagonalGaussian
impy.utils.misc module¶
impy.utils.slicer module¶
- impy.utils.slicer.axis_targeted_slicing(axes: tuple[str, ...], string: str) Tuple[slice | int, ...] [source]¶
Make a conventional slices from an axis-targeted slicing string.
- Parameters:
ndim (int) – Number of dimension of the array which will be sliced.
axes (str) – Axes of input ndarray.
string (str) – Axis-targeted slicing string. If an axis that does not exist in axes is contained, this function will raise ValueError.
- Return type:
slices