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

Provide extra metadata to napari layer as dictionary #27

Merged
merged 2 commits into from
Mar 26, 2024

Conversation

GenevieveBuckley
Copy link
Collaborator

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):

  • andor_metadata
  • astrotiff_metadata
  • eer_metadata
  • epics_metadata
  • fei_metadata
  • fluoview_metadata
  • gdal_metadata
  • gdal_structural_metadata
  • geotiff_metadata
  • imagej_metadata
  • indica_metadata
  • lsm_metadata
  • mdgel_metadata
  • metaseries_metadata
  • micromanager_metadata
  • nih_metadata
  • ome_metadata
  • philips_metadata
  • pilatus_metadata
  • scanimage_metadata
  • scn_metadata
  • sem_metadata
  • shaped_metadata
  • sis_metadata
  • stk_metadata
  • streak_metadata
  • tvips_metadata

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.

@GenevieveBuckley GenevieveBuckley merged commit 815f7bf into napari:main Mar 26, 2024
7 checks passed
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

Successfully merging this pull request may close these issues.

1 participant