AllenInstitute/bmtk

Example CSV for Custom Input Waveform

mjhyman opened this issue · 0 comments

Hello,

I would like to use a custom biphasic waveform as the input to the extracellular stimulating electrode (xstim module). I am using a simulation_config.json file that contains a field for "Extracellular_Stim"

"inputs": {  
    "Extracellular_Stim": {
      "input_type": "lfp",
      "node_set": "all",
      "module": "xstim",
      "positions_file": "$STIM_DIR\\485058595_0000_position1.csv",
      "mesh_files_dir": "$STIM_DIR",
      "waveform": {
        "shape": "sin",
        "del": 1000.0,
        "amp": 0.500,
        "dur": 2000.0,
        "freq": 8.0
      }
    }
  },

The CSV file "485058595_0000_position1.csv" is a modified version of the original one from the directory: "bmtk/examples/bio_components/stimulations/485058595_0000.csv" on the develop branch. It contains the following:

ip electrode_mesh_file pos_x pos_y pos_z rotation_x rotation_y rotation_z waveform
0 stimxmesh.csv 100.0 100.0 100.0 0. 0. 0. waveform0.csv

I was unable to find mention of the waveform0.csv file elsewhere in the repository nor on the BMTK website. Do you have an example of the waveform0.csv file?

I examined the files "xstim.py" and "xstim_waveforms.py" in the directory "bmtk\bmtk\simulator\bionet\modules." I saw that the file "xstim_waveforms.py" contains a class "WaveformCustom" that reads a waveform csv file, but I'm unable to understand how it parses the waveform csv file.

As an aside, I have a few related questions:

  • What are the units in the "amp" value in the waveform field in the simulation_config.json file?
  • What are the units of "pos_*" in the positions file "485058595_0000_position1.csv"?
  • I would like to create a 3D figure of a population of neurons and the electrode point. Is there a class that contains the position of the neuron(s) in cartesian coordinates?