Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support multi-pos datasets that are not complete multi-well plate acquisitions #22

Closed
mattersoflight opened this issue Jan 18, 2023 · 6 comments
Labels
enhancement New feature or request NGFF OME-NGFF (OME-Zarr format)
Milestone

Comments

@mattersoflight
Copy link
Collaborator

mattersoflight commented Jan 18, 2023

There is an apparent gap in data formats specified by OME-NGFF and supported by napari-ome-zarr plugin: they specify/support single FOV ND arrays or multi-FOV ND arrays acquired in a multi-well plate, but not simple multi-pos acquisitions.

We can represent this data as as a multi-well dataset to leverage the napari-ome-zarr plugin for visualization.

This topic requires a discussion among @ziw-liu , @Soorya19Pradeep , @jrbyrum13 , @Christianfoley , @ieivanov, @talonchandler who either acquire or analyze multi-pos datasets.

I see two options:

  1. Have a single column, with row names = position names in micro-manager acquisition .
  2. Map the data to a square grid to make it easy to visualize with napari plugin, e.g., if we have 100 FOVs, sort them into 10 rows and 10 columns.

Votes & Ideas?

@ziw-liu ziw-liu added enhancement New feature or request NGFF OME-NGFF (OME-Zarr format) labels Jan 18, 2023
@jrbyrum13
Copy link

On note 2: would this require that the data is acquired in multiples of 10? Will it support incomplete square grids?

@ziw-liu
Copy link
Collaborator

ziw-liu commented Jan 19, 2023

would this require that the data is acquired in multiples of 10? Will it support incomplete square grids?

Not necessarily. Absent nodes on the grid will be rendered as blank (zero-filled). The ome-zarr-napri plugin will print some annoying warnings in the terminal but it 'works'.

@ieivanov
Copy link
Contributor

Note that even well plate acquisitions may not be perfectly square - it's not uncommon that the sample in one well will die or that the experiment will, for example, have more samples in one row than others. The reader, writer, and viewer should not be picky about that.

Conceptually, all acquisitions start off with a list of positions. These can then be arranged in a grid manually by the user, or automatically based on the position name (e.g. A2 or 000-001, giving the row and column position). The Fiji Image Stitcher plugin has good logic on how the list of positions may be ordered: https://imagej.net/plugins/image-stitching#gridcollection-stitching. We should allow for both of these options - manual sorting or automatic grid sorting based on the file name. If these fail, we can just square off the data - for example, a 7 position acquisition will be arranged in ceil(sqrt(7)) = 3x3 grid with datasets in alphabetical order, i.e. FOV0 goes to (0,0), FOV1 to (0,1), etc.

@ziw-liu
Copy link
Collaborator

ziw-liu commented Jan 27, 2023

Note that even well plate acquisitions may not be perfectly square - it's not uncommon that the sample in one well will die or that the experiment will, for example, have more samples in one row than others. The reader, writer, and viewer should not be picky about that.

See #22 (comment)

We should allow for both of these options - manual sorting or automatic grid sorting based on the file name.

Here we are constrained by other community projects (ome/ome-zarr-py#200). To get the nice stitching behavior for visualization, some options are (ascending by amount of effort):

  1. Wait for ome-zarr-py and napari-ome-zarr to implement these features or try to contribute.
  2. Fork the viewer, modify its logic, and use the fork until it is merged to the main package.
  3. Make our own napari reader plugin.

However I would argue that none of the above is within the current scope of iohub. If we decide to invest in the last option, it might better fit in a separate package (e.g. iohub-napari).

@ziw-liu
Copy link
Collaborator

ziw-liu commented Feb 2, 2023

Can #31 as of 92fa0db close this?

@mattersoflight mattersoflight mentioned this issue Feb 3, 2023
@mattersoflight mattersoflight added this to the 0.2.0 milestone Feb 15, 2023
ziw-liu added a commit that referenced this issue Mar 14, 2023
* Merge pull request #14 from mehta-lab/QLIPP_pipeline

recOrder pipeline infrastructure + qlipp pipeline submodule

* Merge pull request #22 from mehta-lab/zarr_converter

Zarr converter

* Merge pull request #52 from mehta-lab/fluor_deconv

Fluorescence Deconvolution and PhaseFromBF pipelines

* Merge pull request #31 from mehta-lab/calibration_plugin

Calibration/Acquisition Plugin

* Merge pull request #112 from mehta-lab/cleanup-tests-and-readme

Improved testing, configs, and dev tools

* Merge pull request #123 from mehta-lab/zarr-converter-position-bug

Fix ome-tif to zarr converter for acquisitions with micromanager beta

* Merge pull request #140 from mehta-lab/restructure_tests

Restructure tests

* Merge pull request #148 from mehta-lab/pycromanager_converter_v2

Pycromanager converter v2

* Merge pull request #167 from mehta-lab/bkg-correction-fixes2

Fix background correction for non-square images and online mode

* Merge pull request #157 from mehta-lab/RAM-warning

Print RAM warning message in online and offline modes

* Merge pull request #169 from mehta-lab/warn-bkg-averaging

Remove background averaging

* Merge pull request #174 from mehta-lab/show-ram-warning

Show RAM warning in GUI / log in CLI

* Merge pull request #175 from mehta-lab/better-messages

Improved warning message

* Merge pull request #181 from mehta-lab/error-mismatched-bkg-and-img

Always load background and warn if background and image sizes are mismatched

* Merge pull request #182 from mehta-lab/error-mismatched-bkg-and-img

Mismatched x/y size of background and acquisition should error instead of warn

* Merge pull request #210 from mehta-lab/0.2.0-gui-hide

Remove fluorescence, preprocessing, and postprocessing; simplify GUI

* Merge pull request #219 from mehta-lab/0.2.0-integration

0.2.0 integration PR

* Introduce Black formatting into the code base (#229)

* black-format all `.py` files except recorder_ui.py

* create .git-blame-ignore-revs

* Document how to ignore formatting commits

* Document `git` version

Co-authored-by: Talon Chandler <[email protected]>

* draft refactor for imread

* expose primary entry points

* fix type check and tests

Signed-off-by: Ziwen Liu <[email protected]>

* fix formatting

* update `imread` docstring

* define supported formats

Signed-off-by: Ziwen Liu <[email protected]>

* rename pycromanager reader to ndtiff

Pycromanager is no longer a dependency, and MM can also write NDTIFF.

Signed-off-by: Ziwen Liu <[email protected]>

* remove 'doesnt work' code

* improve error messages

* rearrange files from patch

* depend on tqdm for progress bar in conversion

* move util function

* delete other util functions

* make util function private

* remove redundant file

* rename converter file

* fix some of the references and docstrings

* draft refactor

* write with new ngff module

* fix position grid

* fix image check

* close writer after conversion

* test ome-tiff conversion

* handle invalid stage position metadata

* support labelling positions

* fix typo

* fix path type

* convert single page tiff datasets

This is rather broken: the reader does not handle metadata well

* allow longer conversion time in tests

Signed-off-by: Ziwen Liu <[email protected]>

* draft cli command

Signed-off-by: Ziwen Liu <[email protected]>

* fix argument

* detect flat ndtiff

* sort imports

Signed-off-by: Ziwen Liu <[email protected]>

* limit bar length

* add -h shortcut for help

* test cli

* fix get_image

* test against a random choice of dataset

---------

Signed-off-by: Ziwen Liu <[email protected]>
Co-authored-by: Cameron Foltz <[email protected]>
Co-authored-by: Shalin Mehta <[email protected]>
Co-authored-by: Talon Chandler <[email protected]>
Co-authored-by: Ivan Ivanov <[email protected]>
@ziw-liu
Copy link
Collaborator

ziw-liu commented Mar 17, 2023

I think the current API is expressive enough to store arbitrary HCS-conformant layouts.

If there's a specific problem/question about usage, please open a separate issue.

@ziw-liu ziw-liu closed this as completed Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request NGFF OME-NGFF (OME-Zarr format)
Projects
None yet
Development

No branches or pull requests

8 participants