Dataset: Electrode position, size, and orientation determine efficacy of cervical epidural stimulation to recruit forelimb muscles in rats
收藏资源简介:
This repository contains the datasets used in the manuscript: Electrode position, size, and orientation determine efficacy of cervical epidural stimulation to recruit forelimb muscles in rats It includes three recruitment curve datasets: L_CIRC.csv - Circular array experiments with 21 cardinal configurations (8 radii, 4 diameters, 8 vertices, and 1 center). L_SHIE.csv - Circular array experiments with high-definition montage. C_SMA_LAR.csv - Linear array experiments with small and large electrode size, and mediolateral positions. Visualization A Python script is provided below to generate recruitment curve plots for all datasets. It uses hbmep version 0.7.0 Before running the script, update the constants DATA_DIR and OUTPUT_DIR to point to the correct paths (see comments in the script). import os import logging import pandas as pd import numpy as np import hbmep as mep from hbmep.util import setup_logging assert mep.__version__ == "0.7.0" logger = logging.getLogger(__name__) # Point this to directory where rat dataset is present # after cloning this repository DATA_DIR = "/home/vishu/data/rat-dataset" # Point this to directory where the output PDFs will be saved OUTPUT_DIR = "/home/vishu/reports/rat-mapping/plot_data" os.makedirs(OUTPUT_DIR, exist_ok=True) def main(experiment): intensity = "pulse_amplitude" response = ["LADM", "LBiceps", "LDeltoid", "LECR", "LFCR", "LTriceps"] features = ["participant", "compound_position"] match experiment: case "L_CIRC": pass case "L_SHIE": features.append("compound_charge_params") case "C_SMA_LAR": features.append("compound_size") case _: raise ValueError data_path = os.path.join(DATA_DIR, f"{experiment}.csv") df = pd.read_csv(data_path) # # Plot only a subset of the data # idx = (df[features[0]].isin(['amap01'])) # df = df[idx].reset_index(drop=True).copy() output_path = os.path.join(OUTPUT_DIR, f"{experiment}.pdf") mep.plot( df=df, intensity=intensity, features=features, response=response, output_path=output_path, ) logger.info(f"Saved to {output_path}") return if __name__ == "__main__": setup_logging(OUTPUT_DIR) experiments = ["L_CIRC", "L_SHIE", "C_SMA_LAR"] for experiment in experiments: main(experiment)



