pyNIBS 0.2024.8__py3-none-any.whl → 0.2026.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. pynibs/__init__.py +26 -14
  2. pynibs/coil/__init__.py +6 -0
  3. pynibs/{coil.py → coil/coil.py} +213 -543
  4. pynibs/coil/export.py +508 -0
  5. pynibs/congruence/__init__.py +4 -1
  6. pynibs/congruence/congruence.py +37 -45
  7. pynibs/congruence/ext_metrics.py +40 -11
  8. pynibs/congruence/stimulation_threshold.py +1 -2
  9. pynibs/expio/Mep.py +120 -370
  10. pynibs/expio/__init__.py +10 -0
  11. pynibs/expio/brainsight.py +34 -37
  12. pynibs/expio/cobot.py +25 -25
  13. pynibs/expio/exp.py +10 -7
  14. pynibs/expio/fit_funs.py +3 -0
  15. pynibs/expio/invesalius.py +70 -0
  16. pynibs/expio/localite.py +190 -91
  17. pynibs/expio/neurone.py +139 -0
  18. pynibs/expio/signal_ced.py +345 -2
  19. pynibs/expio/visor.py +16 -15
  20. pynibs/freesurfer.py +34 -33
  21. pynibs/hdf5_io/hdf5_io.py +149 -132
  22. pynibs/hdf5_io/xdmf.py +35 -31
  23. pynibs/mesh/__init__.py +1 -1
  24. pynibs/mesh/mesh_struct.py +77 -92
  25. pynibs/mesh/transformations.py +121 -21
  26. pynibs/mesh/utils.py +191 -99
  27. pynibs/models/_TMS.py +2 -1
  28. pynibs/muap.py +1 -2
  29. pynibs/neuron/__init__.py +10 -0
  30. pynibs/neuron/models/mep.py +566 -0
  31. pynibs/neuron/neuron_regression.py +98 -8
  32. pynibs/optimization/__init__.py +12 -2
  33. pynibs/optimization/{optimization.py → coil_opt.py} +157 -133
  34. pynibs/optimization/multichannel.py +1174 -24
  35. pynibs/optimization/workhorses.py +7 -8
  36. pynibs/regression/__init__.py +4 -2
  37. pynibs/regression/dual_node_detection.py +229 -219
  38. pynibs/regression/regression.py +92 -61
  39. pynibs/roi/__init__.py +4 -1
  40. pynibs/roi/roi_structs.py +19 -21
  41. pynibs/roi/{roi.py → roi_utils.py} +56 -33
  42. pynibs/subject.py +24 -14
  43. pynibs/util/__init__.py +20 -4
  44. pynibs/util/dosing.py +4 -5
  45. pynibs/util/quality_measures.py +39 -38
  46. pynibs/util/rotations.py +116 -9
  47. pynibs/util/{simnibs.py → simnibs_io.py} +29 -19
  48. pynibs/util/{util.py → utils.py} +20 -22
  49. pynibs/visualization/para.py +4 -4
  50. pynibs/visualization/render_3D.py +4 -4
  51. pynibs-0.2026.1.dist-info/METADATA +105 -0
  52. pynibs-0.2026.1.dist-info/RECORD +69 -0
  53. {pyNIBS-0.2024.8.dist-info → pynibs-0.2026.1.dist-info}/WHEEL +1 -1
  54. pyNIBS-0.2024.8.dist-info/METADATA +0 -723
  55. pyNIBS-0.2024.8.dist-info/RECORD +0 -107
  56. pynibs/data/configuration_exp0.yaml +0 -59
  57. pynibs/data/configuration_linear_MEP.yaml +0 -61
  58. pynibs/data/configuration_linear_RT.yaml +0 -61
  59. pynibs/data/configuration_sigmoid4.yaml +0 -68
  60. pynibs/data/network mapping configuration/configuration guide.md +0 -238
  61. pynibs/data/network mapping configuration/configuration_TEMPLATE.yaml +0 -42
  62. pynibs/data/network mapping configuration/configuration_for_testing.yaml +0 -43
  63. pynibs/data/network mapping configuration/configuration_modelTMS.yaml +0 -43
  64. pynibs/data/network mapping configuration/configuration_reg_isi_05.yaml +0 -43
  65. pynibs/data/network mapping configuration/output_documentation.md +0 -185
  66. pynibs/data/network mapping configuration/recommendations_for_accuracy_threshold.md +0 -77
  67. pynibs/data/neuron/models/L23_PC_cADpyr_biphasic_v1.csv +0 -1281
  68. pynibs/data/neuron/models/L23_PC_cADpyr_monophasic_v1.csv +0 -1281
  69. pynibs/data/neuron/models/L4_LBC_biphasic_v1.csv +0 -1281
  70. pynibs/data/neuron/models/L4_LBC_monophasic_v1.csv +0 -1281
  71. pynibs/data/neuron/models/L4_NBC_biphasic_v1.csv +0 -1281
  72. pynibs/data/neuron/models/L4_NBC_monophasic_v1.csv +0 -1281
  73. pynibs/data/neuron/models/L4_SBC_biphasic_v1.csv +0 -1281
  74. pynibs/data/neuron/models/L4_SBC_monophasic_v1.csv +0 -1281
  75. pynibs/data/neuron/models/L5_TTPC2_cADpyr_biphasic_v1.csv +0 -1281
  76. pynibs/data/neuron/models/L5_TTPC2_cADpyr_monophasic_v1.csv +0 -1281
  77. pynibs/tests/data/InstrumentMarker20200225163611937.xml +0 -19
  78. pynibs/tests/data/TriggerMarkers_Coil0_20200225163443682.xml +0 -14
  79. pynibs/tests/data/TriggerMarkers_Coil1_20200225170337572.xml +0 -6373
  80. pynibs/tests/data/Xdmf.dtd +0 -89
  81. pynibs/tests/data/brainsight_niiImage_nifticoord.txt +0 -145
  82. pynibs/tests/data/brainsight_niiImage_nifticoord_largefile.txt +0 -1434
  83. pynibs/tests/data/brainsight_niiImage_niifticoord_mixedtargets.txt +0 -47
  84. pynibs/tests/data/create_subject_testsub.py +0 -332
  85. pynibs/tests/data/data.hdf5 +0 -0
  86. pynibs/tests/data/geo.hdf5 +0 -0
  87. pynibs/tests/test_coil.py +0 -474
  88. pynibs/tests/test_elements2nodes.py +0 -100
  89. pynibs/tests/test_hdf5_io/test_xdmf.py +0 -61
  90. pynibs/tests/test_mesh_transformations.py +0 -123
  91. pynibs/tests/test_mesh_utils.py +0 -143
  92. pynibs/tests/test_nnav_imports.py +0 -101
  93. pynibs/tests/test_quality_measures.py +0 -117
  94. pynibs/tests/test_regressdata.py +0 -289
  95. pynibs/tests/test_roi.py +0 -17
  96. pynibs/tests/test_rotations.py +0 -86
  97. pynibs/tests/test_subject.py +0 -71
  98. pynibs/tests/test_util.py +0 -24
  99. /pynibs/{regression/score_types.py → neuron/models/m1_montbrio.py} +0 -0
  100. {pyNIBS-0.2024.8.dist-info → pynibs-0.2026.1.dist-info/licenses}/LICENSE +0 -0
  101. {pyNIBS-0.2024.8.dist-info → pynibs-0.2026.1.dist-info}/top_level.txt +0 -0
@@ -1,7 +1,5 @@
1
1
  import scipy
2
2
  import numpy as np
3
- from sklearn.neighbors import KernelDensity
4
-
5
3
  import pynibs
6
4
 
7
5
 
@@ -34,9 +32,9 @@ def mc(idx_list, array, ele_idx_1, mode="cols", **kwargs):
34
32
 
35
33
  for ind in idx_list:
36
34
  if mode == "cols":
37
- res.append(pynibs.mutual_coherence(array[ind, :]))
35
+ res.append(pynibs.util.utils.mutual_coherence(array[ind, :]))
38
36
  elif mode == "rows":
39
- res.append(pynibs.mutual_coherence(array[ind, :].transpose()))
37
+ res.append(pynibs.util.utils.mutual_coherence(array[ind, :].transpose()))
40
38
  else:
41
39
  raise NotImplementedError("Specified mode not implemented. Choose 'rows' or 'cols'.")
42
40
 
@@ -392,9 +390,9 @@ def dist_mc(idx_list, array, ele_idx_1, ele_idx_2, mode="cols", **kwargs):
392
390
 
393
391
  # mc
394
392
  if mode == "cols":
395
- res_mc[j] = pynibs.mutual_coherence(array_mc[ind, :])
393
+ res_mc[j] = pynibs.util.utils.mutual_coherence(array_mc[ind, :])
396
394
  elif mode == "rows":
397
- res_mc[j] = pynibs.mutual_coherence(array_mc[ind, :].transpose())
395
+ res_mc[j] = pynibs.util.utils.mutual_coherence(array_mc[ind, :].transpose())
398
396
  else:
399
397
  raise NotImplementedError("Specified mode not implemented. Choose 'rows' or 'cols'.")
400
398
 
@@ -444,6 +442,7 @@ def coverage_prepare(idx_list, array, zap_idx, **kwargs):
444
442
  x = np.zeros((n_x, len(idx_list)))
445
443
  y = np.zeros((n_x, len(idx_list)))
446
444
 
445
+ from sklearn.neighbors import KernelDensity
447
446
  kde = KernelDensity(bandwidth=0.03, kernel='gaussian')
448
447
 
449
448
  for j, ind in enumerate(idx_list):
@@ -658,9 +657,9 @@ def fim_mc(idx_list, array, ele_idx_1, ele_idx_2, e_opt, c=None, mode="rows", **
658
657
 
659
658
  # mc
660
659
  if mode == "cols":
661
- res_mc[j] = pynibs.mutual_coherence(array_mc[ind, :])
660
+ res_mc[j] = pynibs.util.utils.mutual_coherence(array_mc[ind, :])
662
661
  elif mode == "rows":
663
- res_mc[j] = pynibs.mutual_coherence(array_mc[ind, :].transpose())
662
+ res_mc[j] = pynibs.util.utils.mutual_coherence(array_mc[ind, :].transpose())
664
663
  else:
665
664
  raise NotImplementedError("Specified mode not implemented. Choose 'rows' or 'cols'.")
666
665
 
@@ -1,11 +1,13 @@
1
1
  """
2
- This holds methods for the TMS-based cortical localization approach as published in [1]_
2
+ This holds methods for the TMS-based cortical localization approach as published in [1]_ and [2]_.
3
3
 
4
4
  References
5
5
  ----------
6
6
  .. [1] Numssen, O., Zier, A. L., Thielscher, A., Hartwigsen, G., Knösche, T. R., & Weise, K. (2021).
7
7
  Efficient high-resolution TMS mapping of the human motor cortex by nonlinear regression. NeuroImage, 245, 118654.
8
+ .. [2] Jing, Y., Numssen, O., Weise, K., Kalloch, B., Buchberger, L., Haueisen, J., Hartwigsen, G., Knösche, T. (2023).
9
+ Modeling the Effects of Transcranial Magnetic Stimulation on Spatial Attention. *Physics in Medicine & Biology*.
10
+ doi: `10.1088/1361-6560/acff34 <https://doi.org/10.1088/1361-6560/acff34>`_
8
11
  """
9
12
  from .regression import *
10
- from .score_types import *
11
13
  from .dual_node_detection import *