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

Content idea: How to save outputs from napari #20

Open
melissawm opened this issue Sep 12, 2022 · 8 comments
Open

Content idea: How to save outputs from napari #20

melissawm opened this issue Sep 12, 2022 · 8 comments
Labels
content Ideas for new or improved content

Comments

@melissawm
Copy link
Member

📚 Documentation

It would be great to have a how-to guide on saving outputs from napari.

A possible outline:

  • What is the best/quickest way to save data from napari
  • What are the possible output formats (csv? svg?)
  • What elements from a napari state/operation can be saved (layers? camera angle/position? just the data? a subset of the data as selected by a plugin?)
  • Plugins that allow you to save in popular formats (gif? tiff?)

Related issues:

May be related:

@melissawm melissawm added the documentation Improvements or additions to documentation label Sep 12, 2022
@chili-chiu
Copy link
Contributor

Thanks @melissawm!

Currently, not all layer types have napari native saving capability, and there's no support for metadata saving (from my understanding).

Current native data saving options (File > Save Selected Layer(s)) -
Image layer: lossless formats (recommend tiff for interoperability) and lossy formats (not recommended for data)
Points layer: csv
Shapes layer: csv
Tracks, Vectors, Surface layer: no built-in saving option :(

Perhaps Zarr could be an integrated way to handle the metadata and the diverse layers @kevinyamauchi?

@kevinyamauchi
Copy link
Contributor

kevinyamauchi commented Sep 19, 2022

Currently, not all layer types have napari native saving capability, and there's no support for metadata saving (from my understanding).

I believe this is correct, @chili-chiu . Even though, there currently aren't built-in writiers for all layer types, I think it would still be valuable to have clear documentation on what can/cannot be written without a plugin and how to do it. We could then potentially link to docs on making writer plugins and napari-hub?

Perhaps Zarr could be an integrated way to handle the metadata and the diverse layers @kevinyamauchi?

Yes, I think this is a great long term goal! With the forthcoming tables spec, we will have the data structure required to save most napari layer types in OME-NGFF. However, there is still to work on the OME side to create specifications for how the data structures are used to store polygons (shapes), points, tracks, and meshes (surface). After the October OME-NGFF community meetings, I would be happy to have a chat about what it would take to make specs for the remaining layer data!

@melissawm melissawm transferred this issue from napari/napari Oct 27, 2022
@melissawm melissawm added content Ideas for new or improved content and removed documentation Improvements or additions to documentation labels Oct 27, 2022
@rjlopez2
Copy link

rjlopez2 commented Nov 7, 2023

Thanks for this effort.
In the meantime what is the recommended way to let's say save and read an image layer preserving its metadata?
Let's say I have an image layer that contain some metadata dict with number of info/features I want to associate with the image (fps, acquisition, some operations on the image, etc). I want to be able to save the image with this info. The default napari writer doesn't seem to preserve the info when exporting in tif format.

@Czaki
Copy link
Contributor

Czaki commented Nov 7, 2023

At this moment we do not know a plugin that properly reads all metadata.

In the context of a sequence of operations, we now not even save such information, so the writer does not have the option to save it as it is not passed to it.

@rjlopez2
Copy link

rjlopez2 commented Nov 7, 2023

Thanks
In the case of sequence of operation, I manage to deal with that. I wrote a reader plugin that can read the image an also collect the info for a specific data format (.sif from Andor). As I do operations I add that information on top of the native metadata.
for instance here is an example

image

This is obviously not a general solution but is sufficient for now.
the idea would be that when I export an image, let's say in tiff format this information is saved along and eventually also read it back. Could you provide a suggestion how could I achieve this?
I am still new to Napari

@Czaki
Copy link
Contributor

Czaki commented Nov 7, 2023

You need to write your own writer for that. There is tifffile library to interact with tiff. You may take a look on OME TIFF file format to check if it allow to fit your data.

Maybe @melonora has more information for this (or knows who call).

@rjlopez2
Copy link

rjlopez2 commented Nov 7, 2023

ok
I will see what can I do.
thanks

@melonora
Copy link
Contributor

melonora commented Nov 8, 2023

You could put all your custom metadata in the comment of an OME-Tiff. I believe this would allow for also reading it back in though it might not be automatically parsed in a manner that is useful. For that you would require a custom reader. Let me know if you have additional questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content Ideas for new or improved content
Projects
Development

No branches or pull requests

6 participants