SciPy

The pyNIBS documentation.

pyNIBS is a Pyhon package to work with non-invasive brain stimulation (NIBS) data, foremost from transcranial magnetic stimulation (TMS) experiments.

We created this package to allow the mapping of causal structure-function relationships with TMS. A lot of analyses is based on calculations of the induced electric fields (e-fields) – for this we rely on SimNIBS.

Install pyNIBS via pip:

pip install pynibs

or directly grab from our repository at gitlab.gwdg.de/tms-localization/pynibs

Contents.

References.

  • Numssen*, O., Martin*, C. W., Worbs, T., Thielscher, A., Weise, K., & Knösche, T. R. (2025). Optimizing and assessing multichannel TMS focality. bioRxiv. doi: 10.1101/2025.09.19.677136

  • Jing, Y., Numssen, O., Hartwigsen, G., Knösche, T. R., & Weise, K. (2024). Effects of Electric Field Direction on TMS-based Motor Cortex Mapping. bioRxiv. doi: 10.1101/2024.12.10.627753

  • Weise, K., Makaroff, S. N., Numssen, O., Bikson, M., & Knösche, T. R. (2025). Statistical method accounts for microscopic electric field distortions around neurons when simulating activation thresholds. *Brain Stimulation, 18*(2), 280–286. doi: 10.1016/j.brs.2025.02.007

  • Numssen, O., Martin, S., Williams, K., Knösche, T. R., & Hartwigsen, G. (2024). Quantification of subject motion during TMS via pulsewise coil displacement. *Brain Stimulation, 17*(5), 1045–1047. doi: 10.1016/j.brs.2024.08.009

  • Numssen*, O., Kuhnke*, P., Weise, K., & Hartwigsen, G. (2024). Electric field based dosing for TMS. Imaging Neuroscience. doi: 10.1162/imag_a_00106

  • Jing, Y., Numssen, O., Weise, K., Kalloch, B., Buchberger, L., Haueisen, J., Hartwigsen, G., Knösche, T. (2023). Modeling the Effects of Transcranial Magnetic Stimulation on Spatial Attention. Physics in Medicine & Biology. doi: 10.1088/1361-6560/acff34

  • Weise*, K., Numssen*, O., Kalloch, B., Zier, A. L., Thielscher, A., Hartwigsen, G., Knösche, T. R. (2022). Precise transcranial magnetic stimulation motor-mapping. Nature Protocols. doi: 10.1038/s41596-022-00776-6

  • Numssen*, O., Zier, A. L., Thielscher, A., Hartwigsen, G., Knösche, T. R., & Weise, K. (2021). Efficient high-resolution TMS mapping of the human motor cortex by nonlinear regression. NeuroImage, 245, 118654. doi:10.1016/j.neuroimage.2021.118654

  • Weise*, K., Numssen*, O., Thielscher, A., Hartwigsen, G., & Knösche, T. R. (2020). A novel approach to localize cortical TMS effects. Neuroimage, 209, 116486. doi: 10.1016/j.neuroimage.2019.116486