Is it possible to load an svg file as a Shapes Layer in Napari?


I would like to know if it is possible to load an svg file as a Shapes Layer in Napari?. This would be very useful to load a set of annotations stored as an svg file. I found a plugin called " napari-svg". According to its readme file, it is “an io plugin for reading and writing svg files with napari”. I read the code but I could not find any code related with reading an svg file. All advices and suggestions are truly welcome! :slight_smile:

Indeed napari-svg only provides Save functionality for now, not Read. @sofroniewn might know whether it would be hard or easy to add read functionality!

eek! yes that is overly ambitious documentation right now. here is a link to a stub issue on the repo for further discussion

I suspect that it will be quite easy to add support for reading any svg that we write, which seems like a good first step. Supporting reading arbitrary svgs might be more complex, but we should look into.

Any community input on this would be welcome, if someone was interested in contributing to the project and very excited about svgs!

1 Like

Thank you very much for your response @sofroniewn. I am a very beginner new user of Napari, I just started to learn Napari last week :blush:, but thanks to the advises and suggestions from @jni I am now able to load my “big data” into Napari. Even thought I am a beginner user, I really like the project a lot!, and I would love to contribute to it. If you let me, I would like to give it a try to the github issue you mentioned before, this way I would be able to know the inner working of this amazing library ;).

1 Like

Yes, that’s great, let’s continue this discussion on that issue, and i encourage anyone else interested to checkout the issues on napari-svg.