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

Process more tiff tags #349

Closed
ianhi opened this issue Nov 4, 2021 · 2 comments
Closed

Process more tiff tags #349

ianhi opened this issue Nov 4, 2021 · 2 comments

Comments

@ianhi
Copy link
Contributor

ianhi commented Nov 4, 2021

Use Case

Loading the tiff from a micromanager MDA it seems a large amount of metadata is getting thrown into tag code: 50839 (which is not included in https://www.loc.gov/preservation/digital/formats/content/tiff_tags.shtml) and I can't figure out where it's documented.

(I'm not exactly sure what the difference between processed and unprocessed tags is so that may be part of my issue here)

When you look at the repr of xarray_dask_data in a notebook the attrs are rendered as a long string because xarray does not nicely render nested dicts:
image

It would be nice to process these and when turning it into xarray split these keys up into attrs.

Solution

Break up the processed and unprocessed attrs into individual items so that it renders like this:

image

You can do this breaking up something like this:

unprocessed = []
processed = []
xarr = gr.xarray_dask_data
attrs = xarr.attrs
for k,v in attrs['unprocessed'].items():
    attrs[k] =v 
    unprocessed.append(k)
attrs['unprocessed'] = unprocessed

# also break up code 50839 which is where it seems MM metadata lives
import json
for k,v in json.loads(attrs[50839]['Info']).items():
    attrs[k] =v
attrs.pop(50839)
# attrs
xarr = xarr.assign_attrs(attrs)

Alternatives

Please describe any alternatives you've considered, even if you've dismissed them

@toloudis
Copy link
Collaborator

also see #450

@SeanLeRoy
Copy link
Collaborator

AICSImageIO is entering maintenance mode meaning only critical bugfixes will be applied due to bioio a new python package taking over in place of AICSImageIO with the same features. I copied this feature over to bioio-ome-tiff which is the plugin to bioio responsible for reading OME TIFF files. Feel free to close or move that issue as you see fit.

bioio-devs/bioio-ome-tiff#5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants