czbiohub-sf / shrimPy

shrimPy: Smart High-throughput Robust Imaging & Measurement in Python
BSD 3-Clause "New" or "Revised" License
8 stars 1 forks source link

Save HCS position label in NDTiff dataset axes #70

Closed ieivanov closed 1 year ago

ieivanov commented 1 year ago

This PR enables using HCS position labels as indices of the NDTiff dataset "position" axis. This will allow us to parse them using iohub (https://github.com/czbiohub-sf/iohub/pull/166) and propagate them to downstream processed results using infrastructure developed in https://github.com/czbiohub-sf/iohub/pull/159.

Example datasets available in https://github.com/micro-manager/NDTiffStorage/pull/124/files and cm.automaton/mantis_HCS_acq_1

Closes #32.

Requires https://github.com/micro-manager/AcqEngJ/pull/95 and #39

This PR should be used with caution until https://github.com/micro-manager/NDTiffStorage/pull/124 is resolved. Using iohub to read the data is robust to sorting issues discussed in that PR.

EDIT: https://github.com/micro-manager/NDTiffStorage/pull/124 has merged. iohub is also robust to reading data with unordered position labels.

Other related PRs: https://github.com/micro-manager/AcqEngJ/pull/95, https://github.com/micro-manager/pycro-manager/pull/640

ziw-liu commented 1 year ago

I'm a bit confused, https://github.com/czbiohub-sf/iohub/pull/166 requires ndtiff>2.2.1, but https://github.com/czbiohub-sf/mantis/pull/70/commits/c07ad1563723136d365f3109c96a0d1ac1acaab1 requires ndtiff<2.0?

ieivanov commented 1 year ago

I'm a bit confused, https://github.com/czbiohub-sf/iohub/pull/166 requires ndtiff>2.2.1, but https://github.com/czbiohub-sf/mantis/commit/c07ad1563723136d365f3109c96a0d1ac1acaab1 requires ndtiff<2.0?

Right, this is a temporary restriction until #39 merges, hopefully very soon

ieivanov commented 1 year ago

@talonchandler @edyoshikun can I get a review on this PR? In summary it switches the position axis of mantis datasets from integers, e.g. [0, 1, 2], to strings, e.g. ['Pos0', 'Pos1', 'Pos2'] or more likely ['A1_Site0', 'A1_Site1', 'A1_Site2']. This is a simple change to the acquisition engine, but downstream processing of this data has been a bit more involved. After https://github.com/czbiohub-sf/iohub/pull/171 merges we'll be in good shape to take these datasets and convert them to zarr, preserving the HCS site labels in the zarr store.

talonchandler commented 1 year ago

LGTM! Nice inter-library metadata wrangling 🤠 .

ziw-liu commented 1 year ago

Does this require iohub==0.1.0dev5?