Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Colouring neurons

4 views
Skip to first unread message

Ben Ibbott

unread,
Sep 9, 2024, 2:15:12 PM9/9/24
to sup...@virtualflybrain.org
Hello,

After attending the VFB connectomics workshop at NeuroFly I have been playing around with vfb-connect. 
I wanted to ask for some advice on colouring neurons. I wanted to create a schematic of olfactory neuronal response from ORNs receiving the stimuli, the OPN projecting to the MB and processing by Kenyon cells. 
I created 3 objects for a subset of each of these neuron types and used the .plot3d function, and could not figure out a better way to overlay all the neurons on a single brain template and separate the neuronal types by different colours.

this is how I ended up doing it after checking the documentation and I have also attached the plot to visualize:
  • (opn_neurons + orn_neurons + kc_neurons).plot3d(include_template=True, color = ['teal','teal','teal','teal','teal', 'teal','teal','teal','teal','teal', 'teal','teal','teal','teal','teal', 'teal','teal','teal','teal','teal','teal','teal','teal','teal','teal', 'teal','teal','teal','teal','teal', 'teal','teal','teal','teal','teal', 'teal','teal','teal','teal','teal',
                                                                                    'purple', 'purple', 'purple', 'purple', 'purple','purple', 'purple', 'purple', 'purple', 'purple','purple', 'purple', 'purple', 'purple', 'purple','purple', 'purple', 'purple', 'purple'])


This will obviously not work well with large subsets of neurons. I would appreciate any advice on optimizing this.

Kind regards,
Ben

Alex McLachlan

unread,
Sep 10, 2024, 6:10:32 AM9/10/24
to VFB support
Hi,

If you combine the vfb.terms before plotting you can use get_colours_for('parents'):

orn_pathway_neurons = (orn_neurons + opn_neurons + kc_neurons)
orn_pathway_neurons.plot3d(include_template=True, color=orn_pathway_neurons.get_colours_for('parents'))

This will then colour by the neuron types, but as there is often multiple inheritance this may not be exactly what you are looking for (example attached).

Otherwise, you may want to use navis and pull in vfb neurons: https://www.virtualflybrain.org/docs/tutorials/apis/connectome/3_visualisation/

Robbie may have other options for how to add these colours in VFB-connect.

Best,

Alex
Screenshot 2024-09-10 at 10.53.32.png
Reply all
Reply to author
Forward
0 new messages