navis.interfaces.blender.Handler¶
- class navis.interfaces.blender.Handler(scaling=0.0001, axes_order=[0, 1, 2], ax_translate=[1, 1, 1])[source]¶
Class that interfaces with scene in Blender.
- Parameters:
scaling (float, optional) – scaling factor between navis and Blender coordinates.
Notes
The handler adds neurons and keeps track of them in the scene.
If you request a list of objects via its attributes (e.g.
Handler.neurons
) or viaselect()
, aObjectList
is returned. This class lets you change basic parameters of your selected neurons.
- neurons¶
- Type:
returns list containing all neurons
- connectors¶
- Type:
returns list containing all connectors
- soma¶
- Type:
returns list containing all somata
- selected¶
- Type:
returns list containing selected objects
- presynapses¶
- Type:
returns list containing all presynapses
- postsynapses¶
- Type:
returns list containing all postsynapses
- gapjunctions¶
- Type:
returns list containing all gap junctions
- abutting¶
- Type:
returns list containing all abutting connectors
- all¶
- Type:
returns list containing all objects
Examples
>>> # This example assumes you have alread imported and set up navis >>> # b3d module has to be imported explicitly >>> from navis import b3d >>> # Get some neurons (you have already set up a remote instance?) >>> nl = navis.example_neurons() >>> # Initialize handler >>> h = b3d.Handler() >>> # Add neurons >>> h.add(nl) >>> # Assign colors to all neurons >>> h.colorize() >>> # Select all somas and change color to black >>> h.soma.color(0, 0, 0) >>> # Clear scene >>> h.clear() >>> # Add only soma >>> h.add(nl, neurites=False, connectors=False)
Methods
__init__
([scaling, axes_order, ax_translate])add
(x[, neurites, soma, connectors, redraw, ...])Add neuron(s) to scene.
alpha
(v)Change alpha (0-1).
bevel
(r)Change bevel of ALL neurons.
clear
()Clear all neurons
color
(r, g, b)Assign color to all neurons.
colorize
()Randomly colorize ALL neurons.
emit
(v)Change emit value.
hide
()Hide all neuron-related objects.
select
(x, *args)Select given neurons.
unhide
()Unide all neuron-related objects.
Change transparency (True/False).
Attributes
cn_dict
defaults