mehta-lab / waveorder

Wave optical models and inverse algorithms for label-agnostic imaging of density & orientation.
BSD 3-Clause "New" or "Revised" License
12 stars 3 forks source link

Pycromanager data reader for WaveorderReader class #79

Closed ieivanov closed 1 year ago

ieivanov commented 1 year ago

This PR extends the WaveorderReader with a subclass for reading pycromanager data with regular dimensions. Reading pycromanager data with irregular dimensions may not be supported, to be tested and extended at a later point.

In an accompanying PR, the recOrder zarr converter is also extended to allow converting pycromanager data into a zarr store that can be easily loaded in napari. Currently viewing pycromanager data is difficult, even if it has regular dimensions.

Note: The Dataset.as_array() function in pycromanager 0.13.2 loads the data into memory, which is not the intended behavior of the WaveorderReader.get_zarr() wrapper for this function. This bug is fixed in the current (0.18.3) version of pycromanager - with this version WaveorderReader.get_zarr() returns a lazy-loaded Dask array. I haven't been able to cast the dask array into zarr without bringing the data into memory, I think returning a dask array is OK for now. I think this is one good reason to upgrade to a move recent version of pycromanager (and MM).

ieivanov commented 1 year ago

@talonchandler this PR is ready for review and merge.

mehta-lab/recOrder#130 depends on a pypi release of this version of waveorder. Here is our action plan:

Let me know what you think

talonchandler commented 1 year ago

Plan sounds good! I'll review this afternoon.

talonchandler commented 1 year ago

Thanks for flagging the problem with lazy-loading in pycromanager 0.13.2. I think a pycromanager upgrade to 0.18.3 makes sense for recOrder 1.0.0, so I'll write a recOrder issue (since we're planning to move io to recOrder for 1.0.0). I'll tag this PR so that we don't forget.

ieivanov commented 1 year ago

Thanks Talon!

talonchandler commented 1 year ago

Ready to merge from my perspective.

talonchandler commented 1 year ago

I can push to pypi version 1.0.0b1 when I get back (Aug 22), but if this is holding you up feel free to go ahead and push yourself.

Instructions:

  1. Manually update the version number in setup.py to 1.0.0-beta1 (we're using setuptools_scm and git tags in recOrder, but I haven't set this up inwaveorder).
  2. Login to PyPI with compmicro's lastpass.
  3. Use PyPI to generate a token and put it in your .pypirc file like this
    [pypi]
    username = __token__
    password = pypi-*******
  4. Navigate to the waveorder folder and checkout the version you'd like to push. Use the following commands:
    python setup.py sdist bdist_wheel # generates a tarball and wheel. 
    # Optional: use `pip install dist/*whl` to test the wheel that will be uploaded.
    pip install --upgrade twine # install twine
    twine check dist/* # check that the tarball and wheel are ready for upload
    twine upload dist/* # uploads to PyPI, requires key in .pypirc