navis.interfaces.blender.Handler.add¶
- Handler.add(x, neurites=True, soma=True, connectors=True, redraw=False, use_radii=False, skip_existing=False, downsample=False, collection=None, **kwargs)[source]¶
Add neuron(s) to scene.
- Parameters:
x (TreeNeuron | MeshNeuron | NeuronList | core.Volume) – Objects to import into Blender.
neurites (bool, optional) – Plot neurites. TreeNeurons only.
soma (bool, optional) – Plot somas. TreeNeurons only.
connectors (bool, optional) – Plot connectors. Uses a defaults dictionary to set color/type. See Examples on how to change.
redraw (bool, optional) – If True, will redraw window after each neuron. This will slow down loading!
use_radii (bool, optional) – If True, will use node radii. For TreeNeurons only.
skip_existing (bool, optional) – If True, will skip neurons that are already loaded.
downsample (False | int, optional) – If integer < 1, will downsample neurites upon import. Preserves branch point/roots. TreeNeurons only.
collection (str, optional) – Only for Blender >2.8: add object(s) to given collection. If collection does not exist, will be created.
Examples
Add one of the example neurons:
>>> h = navis.interfaces.blender.Handler() >>> n = navis.example_neurons(1) >>> h.add(n, connectors=True)
Change connector settings:
>>> h.cn_dict['display'] = 'sphere' >>> h.cn_dict[0]['color'] = (1, 1, 0)