AllenInstitute / bmtk

Brain Modeling Toolkit
https://alleninstitute.github.io/bmtk/
BSD 3-Clause "New" or "Revised" License
267 stars 86 forks source link

Electrode positions for computing extracellular potentials #269

Closed nicolomeneghetti closed 1 year ago

nicolomeneghetti commented 1 year ago

Dear all,

sorry for bothering you again.

My issue concerns the relationship between the spatial coordinates of the neurons within a network and the coordinates specified in the .csv file of an extracellular electrode (that is supposed to record the extracellular potentials).

Let's take for example the 450 cells bionet of the bmtk examples (https://github.com/AllenInstitute/bmtk/tree/develop/examples/bio_450cells). Basically, in this example, the neuron somas are contained in a cylinder: 50 µm of radius and 200 µm of height with the center set to [0, 10.0, 0] µm. The y-axis of soma positions hence encompasses the range [-90,110] µm.

When running the example to get as output the extracellular potentials, the config.simulation_ecp.json takes as "electrode_positions" the "linear_electrode.csv" file. In such .csv files (https://github.com/AllenInstitute/bmtk/blob/develop/examples/bio_components/recXelectrodes/linear_electrode.csv) the y_pos of electrode contacts goes from 0 to -850 µm.

The question is: does the 0 µm that specifies the y_pos of the first electrode contact correspond to the 0µm position in the network (that corresponds to 10 µm below the center of the network cylinder in which the neuron somas were placed when building the network)?

If this is the case, is there a reason for placing the electrode contacts starting only from the lower half of the somatic network distribution?

Thanks in advance,

Best regards,

Nicolò Meneghetti

kaeldai commented 1 year ago

Hi @nicolomeneghetti

You are correct in that the cells and the electrode-probe share the same coordinate system. At the start of a simulation every compartment (aka segment) of each cell is translated so that the soma center is at the defined (x, y, z) followed by x|y|z-rotations around the soma center. Then for each compartment it calculates the euclidean distance to each electrode in the probe (eg each row in linear_electrode.csv).

In our cortical models we designate y=0 to the top of the cortex right below the pia matter. So if an electrode has y=0 and a synapse is placed at y=0, then it means both the electrode and the synapse lie on the same horizontal plane at the top of the cortex. (Of course other models/areas can have a completely different coordinate framework).

I think the confusion is that the 450 cell example isn't following our cortical coordinate system. The probe goes from 0 to -850 µm which is the depth of the visual cortex, but most of the cells are above that. In this case only the first few electrodes will pick up any significant activity. The 450 cell example should be place at layer (-400 to -600 µm) which would make more sense scientifically! Thanks for noticing that and we'll update it.

nicolomeneghetti commented 1 year ago

Dear @kaeldai

thank you very much for your comprehensive answer. Now it makes much more sense :)

Best regards,

Nicolò Meneghetti