itasc.contact_analysis.pixel_size¶
Resolve a position’s physical pixel size (µm per pixel).
Backend-only (no Qt / napari) so the standalone wheel and headless batch runs can
use it. The cell-shape build needs µm/px to turn pixel-unit regionprops
measurements into physical µm / µm². Two sources are consulted, in order:
The position’s
itasc_config.json—metadata.pixel_size_um— the key the main pipeline widget already writes (main_widget.py).The segmented label TIFF’s resolution tags — ImageJ
unit+resolutionor the baselineXResolution/ResolutionUnittags.
Returns None when neither yields a positive value; callers treat that as
“pixel size unknown” (the cell-shape build is then blocked until one is set).
Functions
|
|
|
µm/px from a TIFF's resolution tags (ImageJ unit, else ResolutionUnit). |
|
µm/px for a position, from its config first, then the label TIFF tags. |
- itasc.contact_analysis.pixel_size.resolve_pixel_size_um(position_dir, cell_labels_path)[source]¶
µm/px for a position, from its config first, then the label TIFF tags.
Returns
Nonewhen no positive pixel size can be found.