pymif.microscope_manager.utils.axes
Attributes
Functions
|
Infer a legacy-friendly axes tuple from an array dimensionality. |
|
Return validated, lowercase axis labels. |
|
Normalize axes and return the compact string representation. |
|
Return the spatial axis labels present in |
|
Return the integer positions of spatial axes in |
|
Normalize PyMIF's image-vs-label flag to |
|
Normalize a scalar/spatial sequence to the spatial axes present. |
|
Return explicit indices represented by an int, slice or index sequence. |
|
Return selected length and uniform spacing for metadata updates. |
Module Contents
- pymif.microscope_manager.utils.axes.ALLOWED_AXES: tuple[str, Ellipsis] = ('t', 'c', 'z', 'y', 'x')[source]
- pymif.microscope_manager.utils.axes.DATA_TYPES: tuple[str, Ellipsis] = ('intensity', 'label')[source]
- pymif.microscope_manager.utils.axes.infer_axes_from_ndim(ndim: int) tuple[str, Ellipsis][source]
Infer a legacy-friendly axes tuple from an array dimensionality.
- pymif.microscope_manager.utils.axes.normalize_axes(axes: str | collections.abc.Sequence[str] | None, ndim: int | None = None) tuple[str, Ellipsis][source]
Return validated, lowercase axis labels.
PyMIF Zarr datasets intentionally support only image-style axes made from the labels
t,c,z,yandx. Any subset and any order of those labels is accepted, but labels must be unique and must match the array dimensionality whenndimis supplied.
- pymif.microscope_manager.utils.axes.axes_to_string(axes: str | collections.abc.Sequence[str] | None, ndim: int | None = None) str[source]
Normalize axes and return the compact string representation.
- pymif.microscope_manager.utils.axes.spatial_axes_in_order(axes: str | collections.abc.Sequence[str]) tuple[str, Ellipsis][source]
Return the spatial axis labels present in
axes, preserving order.
- pymif.microscope_manager.utils.axes.spatial_axis_indices(axes: str | collections.abc.Sequence[str]) tuple[int, Ellipsis][source]
Return the integer positions of spatial axes in
axes.
- pymif.microscope_manager.utils.axes.normalize_data_type(data_type: str | None = None, *, is_label: bool | None = None) str[source]
Normalize PyMIF’s image-vs-label flag to
intensityorlabel.
- pymif.microscope_manager.utils.axes.spatial_values_for_axes(value: numbers.Real | collections.abc.Sequence[numbers.Real] | None, axes: str | collections.abc.Sequence[str], *, name: str, default: numbers.Real = 1, allow_float: bool = True) tuple[float, Ellipsis] | tuple[int, Ellipsis][source]
Normalize a scalar/spatial sequence to the spatial axes present.
Sequences may be either length
n_spatialin the order used byaxesor length 3 in legacy ZYX order. The latter keeps old calls likedownscale_factor=(1, 2, 2)working for datasets that contain only YX.