Open yichechang opened 6 months ago
This is due to how bim-xarray
is currently designed to remove coord vars if their real-world units (microns and seconds, for spatial and temporal, respectively) are not found in the ome-metadata. This is actually different from AICSImage's behavior...
See issue tracked in bim-xarray
's repo: https://github.com/SoftLivingMatter/bim-xarray/issues/3#issuecomment-1873614475
Masking is not robust and relies on some workarounds and/or assumptions now. This is due to the possibilities of:
.sel()
method will fall back to using index if coord var not found.https://github.com/yichechang/chromotion/blob/d7e091e74514170d11e6ba971a938782c75553e7/src/chromotion/pivop.py#L126-L131
https://github.com/yichechang/chromotion/blob/d7e091e74514170d11e6ba971a938782c75553e7/src/chromotion/imageop.py#L108-L122
Moving forward to
bim-xarray
's implementation is even more problematic as it requires coordinate vars to exist in both data and mask. But perhaps that's safer when it works.