Getting Started

Below are text guides for BlenderNEURON

Video tutorials are available on the Tutorials Page.

Have you installed BlenderNEURON? See Installation for help on installing BlenderNEURON in Blender and NEURON.

Import Cells

  1. Load your model in NEURON and start BlenderNEURON

  • You can download SampleCell.hoc to test BlenderNEURON with

  • sample of code to run in python:

from neuron import h, gui
h.load_file('path/to/SampleCell.hoc')
cell1 = h.SampleCell()
  1. In the NEURON GUI, open Graph > Shape Plot, to ensure the model is loaded correctly

  2. Start BlenderNEURON in NEURON/Python by running:

from blenderneuron import neuronstart
  1. Start Blender with the BlenderNEURON add-on

  2. Navigate to the BlenderNEURON tab in the sidebar

  • press ‘N’ to toggle sidebar

Sidebar
  1. Import cells with ‘Import Cell Groups to Blender’ under ‘Import / Export’

Import Cells

Edit and Save Cells

  1. With the cells imported, left click a cell in the 3d view to select it (like other Blender objects)

  1. To select and rotate individual sections:

  • Under ‘Cell Group Options’, select ‘Interact with Each:’ ‘Section’

  • Import cells again

Choose ‘Group’ to display all cells in a cell group as one Blender object. Moving or rotating that object moves the entire group together and reduces object overhead for large networks. ‘Cell’ creates one object per cell; ‘Section’ creates one per section. Recording granularity remains independent.

  1. To export changes to NEURON after editing cell morphology/position in Blender:

  • Click ‘Update Groups with View Changes’ under ‘Import / Export’

  • Then click ‘Export Cell Groups to NEURON’ under ‘Import / Export’

Warning

Morphology export updates the coordinates and radii of existing NEURON sections; it does not create or delete sections or reconnect cell topology. Child branches are matched to the previously imported morphology by their position in the section tree rather than rebuilt by name. Adding, deleting, or reordering splines or branches in Blender may therefore cause export to fail or update the wrong section. Reshaping or repositioning existing branches is supported.

Export updates the physical pt3d morphology: coordinates, the section length implied by those coordinates, and diameters. Although nseg is serialized, it is not assigned back to the NEURON section, so export does not change NEURON’s spatial discretization.

Add Cells to Groups

  1. Expand ‘Cell Groups’ and ‘Cells in Group’

  2. Add groups with the ‘+’ to the right of the group names

  3. Check off cells under ‘Cells in Group’ to add them to the currently selected group

  • A cell can only be in one group at a time

Adding Cells to Groups

Change Cell Colors

  1. Select Cell Group to change display settings for

  2. Expand ‘Cell Group Options’

  3. Next to ‘Init. Color’, select a color on the color wheel

Select Group Color
  • The cells will be in that color the next time the cell group is imported

Animate Cell Model Activity

  1. Have your model with activity loaded in NEURON

    • To check voltage activity in the NEURON GUI, go to ‘Graph’ > ‘Voltage Axis’ and ‘Tools > Run Control’ and select ‘Init & Run’

  2. Select Cell Group to animate in ‘Cell Groups’

  3. Expand ‘Cell Group Options’

  4. Check off ‘Record Activity’

    • Activity will be recorded next time the cells are imported

  5. Select granularity (‘Record from Each:’)

    • Record activity by cell (at each soma), section (at the midpoint of each section), or segment (at each segment). Finer granularity has better detail but requires more time and memory.

    Note

    For segment recording, BlenderNEURON assumes that section geometry remains fixed during each simulation run. Geometry changes made between runs are detected automatically. If a script changes NEURON pt3d geometry while activity is being collected, start a new simulation run before continuing collection so the segment recording locations are rebuilt.

  6. Choose Recording Settings

    • Select ‘Record’ variable: NEURON section variable name to record/animate. ‘v’ by default for voltage (e.g ‘v’ of soma(0.5).v). (note: for variables other not voltage, make sure target variable exists in sections that will be recorded from)

    • Set ‘Start Recording’ and ‘Stop Recording’ times (in ms): what time range in the NEURON simulation to record

    • Select ‘Sampling Period’: how many milliseconds between samples collected of the recorded variable (e.g. voltage)

    • Under NEURON, below ‘Time (ms)’, set ‘Blender frames per millisecond’ (default 10). This scene-wide setting applies to every cell group and retimes existing activity animations when changed.

    • Set colors on the color scale to correspond with low and high values

    • Set ‘Variable Low’ and ‘High’ values: set minimum and maximum values to cover the range of the recorded variable (e.g. voltage) in your model

  7. Import cells with ‘Import Cell Groups to Blender’ under ‘Import / Export’

  8. Scrub the timeline on the bottom to see animation

    • Change in voltage/recording variable value should be visible as change in color and/or brightness (to preview change in brightness without rendering image, press ‘Z’ > ‘Material Preview’)

    • Frame number = NEURON simulation time (ms) x ‘Blender frames per millisecond’

Timeline

Create Synapses by Proximity

  1. Make sure to have at least 2 cells instantiated in NEURON

  2. Add cells that will form synapses to different groups

  3. Expand ‘Form Synapses’

    • This section will appear when you have at least two groups

  4. Select groups for the ‘Source’ (presynaptic) and ‘Destination’ (postsynaptic) cells

    • Must be different groups

  5. Select which sections will form synapses next to ‘Sections:’

    • Surround characters with asterisks (*example*) to include all sections with those characters in the name

  6. Select synaptic mechanism next to ‘Synapse’, if you have additional mechanisms loaded in NEURON

    • By default, NEURON lets you use ‘ExpSyn’ mechanism

    • For help on compiling mod files to add mechanisms: Mod Files

  7. Press ‘Find Synapse Locations’

    • Synapse locations will be shown in orange

Synapse Preview
  1. Create the synapses in NEURON by pressing ‘Create Synapses’

Confine Cells between Layers

  1. Import cells with ‘Import Cell Groups to Blender’

  2. Import or create mesh object(s) to confine the cells between

  3. Expand ‘Confine Between Layers’

    • This section will appear once at least 1 cell is imported

  4. Select objects for the confinement ‘Start Layer’ and ‘End Layer’

  5. Next to ‘Name Contains:’, select sections that will be confined

    • Surround characters with asterisks (*dend*) to confine all sections with those characters

  6. Press ‘Confine’ to confine the sections between the layers

  7. Save changes in Blender by pressing ‘Update Groups with Confinement Results’

  8. Save confinement results to NEURON by pressing ‘Export Cell Groups to NEURON’ under ‘Import / Export’

Remote connections and MPI

See Remote Connections and MPI for Docker, SSH tunnels, and pairing. For script-based simulations and MPI jobs, see Offline Simulation Results.