Simulating Multielectrode Arrays#

A common system of interest in neural simulation are Multielectrode Arrays (MEA) which integrate multiple microelectrodes to obtain or deliver neural signals to the culture.

To construct MEAs in simulation, you can position artificial STIM(umlus) cells that emulate delivering electrodes and/or position LFP readouts to emulate obtaining electrodes.

Positioning ‘electrode’ STIM cells#

Given the x,y,z coordinates of your MEA electrodes, you can insert them into the culture via a callback.

# define callable that returns MEA coordinates
def callable(n, extents): # -> (n, 3)
    ...
    return xyz_coordinate_array


"cell_distributions": {
  "STIM": {     # generate STIM(ulus) cells
    "@callable": 64   # @ to invoke callable during generation
  },
  ...
}

"layer_extents": {
   "@callable": [      # extents definition
       [0.0, 0.0, 0.0],
       [200.0, 200.0, 150.0],
   ],
   ...
}

Positioning ‘electrode’ LFPs#

To emulate the readout feature of the electrodes, you can leverage the miv_simulator.lfp.LFP class.

 1from miv_simulator.lfp import LFP
 2
 3        lfp = LFP(
 4            "ReadoutElectrode",
 5            env.pc,
 6            pop_gid_dict={
 7                pop_name: set(env.cells[pop_name].keys()).difference(
 8                    set(env.artificial_cells[pop_name].keys())
 9                )
10                for pop_name in env.cells.keys()
11            },
12            pos=[500.0, 500.0, 0.0],  # top-center
13            rho=333.0,
14            dt_lfp=0.1,
15            fdst=0.1,
16            maxEDist=100.0,  # radius
17            seed=self.seed + 1,