Making LineStrips with connectivity from a "Parent" attribute (tree structure)

Hi, I am playing with importing some neuroscience data into POPs, specifically a data format called .swc that has data for “neuron skeletons” which is a list of points with Attributes:
PointID - Position.xyz - Label - Radius - Parent
(of interest here besides Position is the Parent and the Label which defines end-points and branch-points)

There’s some really cool branching structures in the data.

I’m able to import the list of points via DATtoPOP. Now I want to connect the points into LineStrips, that follow the connectivity given by the “Parent” attribute and tree-structure.

I’ve made a toy model with just 8 points to illustrate and investigate:

I have made a super-simple instancing setup with lines that are scaled and rotated to go from Parent to Child and this looks great!


But I really want to get back the connectivity so I can then play with visualising signals flowing along each branch and eventually branching to other neurons.

The options I’ve considered after reading other forums posts are:
-somehow join/merge end-points of lines from the instancing setup shown above?
-GLSL (maybe GLSL advanced is needed to address vertex data?)
-Topology POP
-do some upstream DAT processing or python to create more attributes (I’d rather keep it all in POPs though..)

Any suggestions on avenues to pursue here would be welcome.
.tox is attached for your curiosity.
swc_import_connectivity.tox (33.8 KB)

Thanks!

Hello @michaeljohnson.tv

Interesting topic! Indeed you should be able to create the line strips with GLSL Advanced POP (indeed only the GLSL Advanced allows to write the primitives information), maybe in combination with Topology POP but not necessarily.

Definitely not so straigtforward as line strips creation is a little more complex than other primitives because of the varying length. I’ll try to get you a relevant example in a bit.

Best,
Vincent

See attached toe for a prototype with GLSL POPs, hope that helps!

swc_import_connectivity.toe (24.7 KB)

edit: meant to add unfortunately the line break POP won’t help you here since it creates gaps.
maybe we could add a mode where it doesn’t create gaps but splits the line strips - it probably wouldn’t be enough here in any case.

trop fort, merci beaucoup!

1 Like