Replies: 13 comments 27 replies
-
big +1! this kind of Some challenges I could see:
|
Beta Was this translation helpful? Give feedback.
-
re: visualization, i've been using https://github.com/pyvista/pyvista a lot lately - i wonder what the pros/cons are relative to pygfx. one thing that I appreciate about pyvista is that it seems to have a big user base, which helps with googling for solutions. |
Beta Was this translation helpful? Give feedback.
-
re: representations:
|
Beta Was this translation helpful? Give feedback.
-
But yes, would be a big fan of a morphology representations hackathon! Perhaps as a way to get started, it could be worth writing down a kind of desired API, and working backwards from there in terms of how to implement things? |
Beta Was this translation helpful? Give feedback.
-
Unsurprisingly, Ben and I are on the same page here with our goals. A few things that I have come to believe are useful generalizations/distinctions for such a project:
|
Beta Was this translation helpful? Give feedback.
-
In fact, to not just totally repeat what @bdpedigo said while I was already typing, a key distinction between the mesh and a spatial graph is that the mesh is built of faces and is typically not a single connected component. We always have to remove disconnected faces and graft in connecting edges in order to build a "nice" single component graph out of it, which already makes it not a true triangle mesh. |
Beta Was this translation helpful? Give feedback.
-
Exactly, and now a TreeNeuron/skeleton can inherit from spatial graph, but could have extra methods specific to trees (e.g. a notion of tips and a root) |
Beta Was this translation helpful? Give feedback.
-
FYI: I converted this to a discussion since it allows directly responding to a post. |
Beta Was this translation helpful? Give feedback.
-
General question for spatial graphs: is there a reason why the spatial graph can't just be the mesh's skeleton, fixed up and without breaks? Or the other way around: is there an advantage of having the spatial graph consist of the mesh's vertices and edges plus a set of extra edges that make it a single connected component? |
Beta Was this translation helpful? Give feedback.
-
My utility for and ability to contribute to navis has severely diminished, but my two cents about the "single neuron representation" conversation is that there is plenty of functionality which only applies to certain representations. Given that, it is nice to be able to rely on the type system to enforce what kind of representation you're working with rather than having a mixed bag and try to keep track yourself. That would mean separate types for different representations, and any given function could Union[Rep1, Rep2] for all the types it works with. You could, for convenience, additionally have a joint representation which composes over them all and has some basic functionality which can call on any of the representations (e.g. a bounding box which prefers meshes, then trees, then point clouds) but I'd be quite cautious about over-using it when it comes to type annotations. |
Beta Was this translation helpful? Give feedback.
-
Something else to consider: a good chunk of navis' data is stored using pandas, and pandas supports the arrow backend. With increased interest in speeding up some hot loops with rust, as well as interoperating with nat in some places, v2 might be an opportunity to start insisting on the arrow backend internally. To my understanding, pandas' arrow implementation isn't complete - pandas dataframes are basically a bag of arrow arrays rather than using an arrow table directly, so that interop may not be quite such an easy win. Additionally, while there are arrow implementations in rust, I have a sneaking suspicion that the arrow support in rust is not as good as the numpy support (somewhat conjecture, as I haven't used the arrow crates, just had a look over the docs). A much larger change and probably too pie-in-the-sky would be to look into polars, which uses a more complete arrow representation and has better rust interop too. |
Beta Was this translation helpful? Give feedback.
-
The right thing to do here to cover the most use cases is probably just use |
Beta Was this translation helpful? Give feedback.
-
One more thing to consider is loosing some weight. Candidates for deprecation and subsequent removal in navis 2.0:
|
Beta Was this translation helpful? Give feedback.
-
This issue is to suggest & discuss (read: spitball) potential breaking changes that might warrant a new major version.
Plotting
Over the past months I have experimented more with the pygfx library and I'm pretty much set on replacing the current vispy-based 3d viewer with octarine. This may well happen already in the next minor version (see #138) but I wonder if a general refactoring of the plotting interface is in order. In particular:
pygfx
as a 2d plotting backend (see also fastplotlib)? It's much faster and perspectively correct (unlike matplotlib).Additional backends
Currently,
navis
can utilize multiple CPUs (viapathos
) but it doesn't scale beyond a single machine. It'd be nice if there was an easy way to divvy up e.g. a big NBLAST across multiple nodes. @aschampion has already made a start in #111 for a Dask backend and the implementation is generic so that it would be easy to tack on more.Neuron Classes
Two things that have been on my mind with regards to neurons:
As discussed with @bdpedigo in Berlin, can we generate a "unified" neuron object that combines multiple representations (skeleton, mesh, image)? @ceesem has done something similar in MeshParty.
The current neuron names (
TreeNeuron
,MeshNeuron
,VoxelNeuron
) are... uglyIt would be nice if there was only a single
Neuron
class that could be either a single type or multiple. Something along these lines:Combining multiple representations could then look like this:
Individual representations can be accessed like this:
Under-the-hood
navis
already combines representations when needed. For example,navis.prune_twigs
works onMeshNeurons
by (a) skeletonizing the mesh, (b) pruning the skeleton and (c) removing faces corresponding to the removed skeleton nodes from the mesh. The big question then is: does making this explicity actually simplify things for the user? I imagine that most users will work with either skeletons or meshes and don't need to know how things happen under-the-hood.I will add above list as I think of more stuff.
Perhaps some of the above can be tackled in a longer hackathon?
Beta Was this translation helpful? Give feedback.
All reactions