navis-org / navis

Python library for analysis of neuroanatomical data.
https://navis-org.github.io/navis/
GNU General Public License v3.0
80 stars 31 forks source link

meshio for mesh I/O #51

Open clbarnes opened 3 years ago

clbarnes commented 3 years ago

Spotted some commits implementing more mesh formats - would it be worth just (optionally?) depending on meshio and calling it a day? Improvements and additional formats could be contributed back upstream. It has neuroglancer's mesh format from a while back - reducing the number of implementations out in the wild is probably for the best.

schlegelp commented 3 years ago

Ah good point! I didn't bother hunting for existing implementations for neuroglancer's "precomputed" format. I have independent functions in various other packages and this was actually my attempt at consolidating those into navis.

At a glance it looks like meshio currently only deals with the legacy mesh format. The recent commits to navis do a bit more than that:

I guess the latter two could be contributed back upstream to meshio? As things stand, adding meshio as dependency would shed ~20 lines of code in navis.

clbarnes commented 3 years ago

Yes, it was a while ago that I added that so not surprised if the format as come on since then. As it is such a simple format, it also doesn't surprise that the dependency (which is pretty light without extras) wouldn't save much code, but it would add quite a lot of flexibility to navis for reading and writing different mesh formats.

schlegelp commented 3 years ago

Oh, I see. We might be thinking of slightly different things here. I'm not at all opposed to adding it as a dependency but perhaps you can elaborate a bit on how you would suggest proceeding?