AllenInstitute / bmtk

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

Example CSV for Custom Input Waveform #207

Open mjhyman opened 2 years ago

mjhyman commented 2 years ago

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: