Skip to content

load the data of TMS experiments recorded with the UKT-Toolbox into Matlab and Python

Notifications You must be signed in to change notification settings

agricolab/tool-load-tms

 
 

Repository files navigation

Tools to load TMS data from the legacy matlab protocols into Matlab or Python

Installation

clone the repository with https://github.com/neuromti/tool-load-tms.git and pip install -e .

Requires a Matlab installation with valid registration.

Example

If you want to read the MEP traces from an old matfile into Python, you can do as follows:

from matprot.convert.traces import convert_mat, cut_into_traces
content = convert_mat("path_to.mat")
print(content['chan_names'])
# e.g. [[array(['EDC_L'], dtype='<U5') array(['BB_L'], dtype='<U4')
#        array(['EDC_R'], dtype='<U5')]]
# convert the array of onset sample indices into a list of integers
onsets = [onset[0] for onset in content['stim_onset']]
# select an existing channel, and
# cut from 100 before to 100 samples after each onset
traces = cut_into_traces(content, "EDC_L", 100, 100,  onsets)

cut traces video

See also

https://github.com/neuromti/TMS_Toolbox https://github.com/neuromti/UKT_toolbox

About

load the data of TMS experiments recorded with the UKT-Toolbox into Matlab and Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • MATLAB 98.0%
  • Python 2.0%