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

Trouble opening ndtiff dataset #105

Closed
talonchandler opened this issue Apr 7, 2023 · 3 comments
Closed

Trouble opening ndtiff dataset #105

talonchandler opened this issue Apr 7, 2023 · 3 comments
Labels
bug Something isn't working μManager Micro-Manager files and metadata

Comments

@talonchandler
Copy link
Contributor

I'm running into issues opening some, but not all, recently acquired ndtiff datasets.

Reproduce with:

python
>>> from iohub import read_micromanager
>>> reader = read_micromanager('/hpc/projects/compmicro/rawdata/mantis/2023_03_29_argolight/rings-LF-LS_1/rings-LF-LS_labelfree_1/')
Dataset opened
>>> reader.get_array(0)

fails with

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/talon.chandler/iohub/iohub/ndtiff.py", line 182, in get_array
    return np.asarray(self.get_zarr(position))
  File "/home/talon.chandler/iohub/iohub/ndtiff.py", line 166, in get_zarr
    return da.reshape(shape)
  File "/home/talon.chandler/.conda/envs/recorder-test/lib/python3.9/site-packages/dask/array/core.py", line 2185, in reshape
    return reshape(self, shape, merge_chunks=merge_chunks, limit=limit)
  File "/home/talon.chandler/.conda/envs/recorder-test/lib/python3.9/site-packages/dask/array/reshape.py", line 248, in reshape
    inchunks, outchunks = reshape_rechunk(x.shape, shape, x.chunks)
  File "/home/talon.chandler/.conda/envs/recorder-test/lib/python3.9/site-packages/dask/array/reshape.py", line 62, in reshape_rechunk
    raise NotImplementedError(_not_implemented_message)
NotImplementedError:
Dask's reshape only supports operations that merge or split existing dimensions
evenly. For example:

>>> x = da.ones((6, 5, 4), chunks=(3, 2, 2))
>>> x.reshape((3, 2, 5, 4))  # supported, splits 6 into 3 & 2
>>> x.reshape((30, 4))       # supported, merges 6 & 5 into 30
>>> x.reshape((4, 5, 6))     # unsupported, existing dimensions split unevenly

To work around this you may call reshape in multiple passes, or (if your data
is small enough) call ``compute`` first and handle reshaping in ``numpy``
directly.
@ziw-liu ziw-liu added bug Something isn't working μManager Micro-Manager files and metadata labels Apr 20, 2023
@ziw-liu
Copy link
Collaborator

ziw-liu commented Apr 21, 2023

Are the ndtiff (or pycromanager) versions in the acquisition environment and the analysis environment the same?

@ieivanov
Copy link
Contributor

ieivanov commented May 2, 2023

This is fixed in ndtiff >= 1.12.1, see micro-manager/NDStorage#107

@talonchandler
Copy link
Contributor Author

Tested and it's working. Thanks @ziw-liu and @ieivanov!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working μManager Micro-Manager files and metadata
Projects
None yet
Development

No branches or pull requests

3 participants