Provide extra metadata to napari layer as dictionary #27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR searches for all *
_metadata
attributes found in the tifffile python object, and puts them in a dictionary that is passed into the napari layer.Napari layer objects have a
metadata
attribute, which can hold a dictionary. Napari doesn't actually do anything with this dictionary, but it does get stored in the layer right beside the actual data, so it is possible for the user to look up the metadata (and possibly do something with it themselves later on).TiffFile objects have a number of *
_metadata
attributes (for any given case, most will return None or an empty list/tuple):Context: we've been discussing ome-tiff files and their related metadata. Seeing just how many other types of metadata could potentially be stored makes me think that a more generic solution like this one would be preferable to individually checking for 27 different types of possible metadata.