navis-org / navis

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

disallow Dotprops for `write_swc` #145

Closed schlegelp closed 9 months ago

schlegelp commented 9 months ago

Currently, when passing a Dotprop to navis.write_swc it will be converted into a skeleton by turning each point + tangent vector into a 2-point skeleton segment. When reading the file back using navis.read_swc the user gets a skeleton which consists of thousands of disconnected fragments. That's obviously not ideal. In hindsight I don't know why I implemented it that way to be honest.

I'm bringing this up because I had a student asking why their skeletons look funky and it transpired that they actually started out with Dotprops and then ended up with skeletons through write_swc -> read_swc.

We could teach navis.read_swc to load Dotprops but that feels convoluted. My first hunch is to just disallow Dotprops for write_swc - maybe with a message that points users to write_nrrd or write_parqet. Thoughts @clbarnes?

clbarnes commented 9 months ago

I agree, swc is not an appropriate file format for dotprops. The writer should throw an error if dotprops are given and there shouldn't be a reader.

schlegelp commented 9 months ago

Dropped writing dotprops to swc with caba243b67ff4a1c942db3b7cb83a18c37bb4d2c.