linumpy.stack_alignment.units#
Unit conversion and centring for inter-slice shift fields.
Functions#
|
Detect whether resolution is in mm or µm and return (res_x_um, res_y_um). |
|
Convert mm cumulative shifts to pixel shifts. |
|
Center shifts around the middle slice. |
Module Contents#
- linumpy.stack_alignment.units.detect_shift_units(resolution)[source]#
Detect whether resolution is in mm or µm and return (res_x_um, res_y_um).
OME-Zarr resolution can be reported in either mm (OME-NGFF standard) or µm depending on the writer. Detects by magnitude: - Values < 1.0 assumed to be mm (e.g. 0.01 mm = 10 µm) - Values >= 1.0 assumed to be µm (e.g. 10 µm)
- Parameters:
resolution (sequence) – Resolution tuple/list (res_z, res_y, res_x) from read_omezarr.
- Returns:
res_x_um, res_y_um – X and Y resolution in microns.
- Return type:
- linumpy.stack_alignment.units.convert_shifts_to_pixels(cumsum_mm, resolution_um)[source]#
Convert mm cumulative shifts to pixel shifts.
- Parameters:
- Returns:
Mapping from slice_id to (dx_px, dy_px).
- Return type: