We need a way to allow the user easy access to the meta data, and also to write a file with meta data. This can be very powerful, and is a simple necessity for scientific formats.
For functions that write an image this is easy: we can just include a keyword argument called "meta" which should be a dict.
From the current status of the discussion about reading multiple images, this seems to not be a problem either; we could add a get_meta() method to the reader object, akin to the get_image() method.
But what about imread()? Let me kick off with three ideas:
- a separate function "metaread".
- let imread return an array that has an extra "meta" attribute.
- only allow reading via a reader object.
IMO, a separate function introduces extra "clutter" and somehow does not seem consistent with writing meta information; there is no metawrite. Also, it means that a file needs to be opened twice if you need both the data and the info.
I like that by returning an array with a meta attribute the image data and meta info are kept together. So if you pass the image to a function, that function can access the meta data too.
With the 3d option, I envision that you call a certain function ("read"?) that always returns a reader object. The user can then use that to read the image and/or the meta data. The advantage is that if the user only wants the meta information, the image data is not loaded.
Regards,
Almar