napari / napari-core

BSD 3-Clause "New" or "Revised" License
5 stars 3 forks source link

Appropriately handle metadata #5

Open jni opened 6 years ago

jni commented 6 years ago

Biological and physical images carry important information about pixel size, wavelength, etc. We need to be able to preserve this throughout a processing pipeline.

XREF https://github.com/scikit-image/scikit-image/issues/2605

kne42 commented 5 years ago

@jni So from the sounds of it, we want to pass along a metadata dictionary containing important information about its corresponding image (NumPy array)? We would also need to write functions for reading in the images and returning the NumPy array along with their metadata. I'm guessing that we could have specific functions for when the user knows said metadata (imread_multichannel_2D, imread_3D, imread_12bit, etc.), ones that read it from metadata hosted in a specific filetype (imread_tiff, imread_jpeg, etc.), and one which guesses and automatically generates the metadata.

jni commented 5 years ago

@kne42 I'm actually not positive about what my preferred approach is, but meta=[dict] and return_meta=bool is close.

Our medium-term plan is to use imageio for IO, in which case we get a .meta attribute on the read-in image. I don't know whether input depth is in that dictionary, nor provenance. I am strongly against imread_* but would instead prefer kwargs to imread and maybe additional info provided by the user of our API (ie in this case, Napari).

Let's continue the discussion on scikit-image though.