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.
- pynibs/__init__.py +26 -14
- pynibs/coil/__init__.py +6 -0
- pynibs/{coil.py → coil/coil.py} +213 -543
- pynibs/coil/export.py +508 -0
- pynibs/congruence/__init__.py +4 -1
- pynibs/congruence/congruence.py +37 -45
- pynibs/congruence/ext_metrics.py +40 -11
- pynibs/congruence/stimulation_threshold.py +1 -2
- pynibs/expio/Mep.py +120 -370
- pynibs/expio/__init__.py +10 -0
- pynibs/expio/brainsight.py +34 -37
- pynibs/expio/cobot.py +25 -25
- pynibs/expio/exp.py +10 -7
- pynibs/expio/fit_funs.py +3 -0
- pynibs/expio/invesalius.py +70 -0
- pynibs/expio/localite.py +190 -91
- pynibs/expio/neurone.py +139 -0
- pynibs/expio/signal_ced.py +345 -2
- pynibs/expio/visor.py +16 -15
- pynibs/freesurfer.py +34 -33
- pynibs/hdf5_io/hdf5_io.py +149 -132
- pynibs/hdf5_io/xdmf.py +35 -31
- pynibs/mesh/__init__.py +1 -1
- pynibs/mesh/mesh_struct.py +77 -92
- pynibs/mesh/transformations.py +121 -21
- pynibs/mesh/utils.py +191 -99
- pynibs/models/_TMS.py +2 -1
- pynibs/muap.py +1 -2
- pynibs/neuron/__init__.py +10 -0
- pynibs/neuron/models/mep.py +566 -0
- pynibs/neuron/neuron_regression.py +98 -8
- pynibs/optimization/__init__.py +12 -2
- pynibs/optimization/{optimization.py → coil_opt.py} +157 -133
- pynibs/optimization/multichannel.py +1174 -24
- pynibs/optimization/workhorses.py +7 -8
- pynibs/regression/__init__.py +4 -2
- pynibs/regression/dual_node_detection.py +229 -219
- pynibs/regression/regression.py +92 -61
- pynibs/roi/__init__.py +4 -1
- pynibs/roi/roi_structs.py +19 -21
- pynibs/roi/{roi.py → roi_utils.py} +56 -33
- pynibs/subject.py +24 -14
- pynibs/util/__init__.py +20 -4
- pynibs/util/dosing.py +4 -5
- pynibs/util/quality_measures.py +39 -38
- pynibs/util/rotations.py +116 -9
- pynibs/util/{simnibs.py → simnibs_io.py} +29 -19
- pynibs/util/{util.py → utils.py} +20 -22
- pynibs/visualization/para.py +4 -4
- pynibs/visualization/render_3D.py +4 -4
- pynibs-0.2026.1.dist-info/METADATA +105 -0
- pynibs-0.2026.1.dist-info/RECORD +69 -0
- {pyNIBS-0.2024.8.dist-info → pynibs-0.2026.1.dist-info}/WHEEL +1 -1
- pyNIBS-0.2024.8.dist-info/METADATA +0 -723
- pyNIBS-0.2024.8.dist-info/RECORD +0 -107
- pynibs/data/configuration_exp0.yaml +0 -59
- pynibs/data/configuration_linear_MEP.yaml +0 -61
- pynibs/data/configuration_linear_RT.yaml +0 -61
- pynibs/data/configuration_sigmoid4.yaml +0 -68
- pynibs/data/network mapping configuration/configuration guide.md +0 -238
- pynibs/data/network mapping configuration/configuration_TEMPLATE.yaml +0 -42
- pynibs/data/network mapping configuration/configuration_for_testing.yaml +0 -43
- pynibs/data/network mapping configuration/configuration_modelTMS.yaml +0 -43
- pynibs/data/network mapping configuration/configuration_reg_isi_05.yaml +0 -43
- pynibs/data/network mapping configuration/output_documentation.md +0 -185
- pynibs/data/network mapping configuration/recommendations_for_accuracy_threshold.md +0 -77
- pynibs/data/neuron/models/L23_PC_cADpyr_biphasic_v1.csv +0 -1281
- pynibs/data/neuron/models/L23_PC_cADpyr_monophasic_v1.csv +0 -1281
- pynibs/data/neuron/models/L4_LBC_biphasic_v1.csv +0 -1281
- pynibs/data/neuron/models/L4_LBC_monophasic_v1.csv +0 -1281
- pynibs/data/neuron/models/L4_NBC_biphasic_v1.csv +0 -1281
- pynibs/data/neuron/models/L4_NBC_monophasic_v1.csv +0 -1281
- pynibs/data/neuron/models/L4_SBC_biphasic_v1.csv +0 -1281
- pynibs/data/neuron/models/L4_SBC_monophasic_v1.csv +0 -1281
- pynibs/data/neuron/models/L5_TTPC2_cADpyr_biphasic_v1.csv +0 -1281
- pynibs/data/neuron/models/L5_TTPC2_cADpyr_monophasic_v1.csv +0 -1281
- pynibs/tests/data/InstrumentMarker20200225163611937.xml +0 -19
- pynibs/tests/data/TriggerMarkers_Coil0_20200225163443682.xml +0 -14
- pynibs/tests/data/TriggerMarkers_Coil1_20200225170337572.xml +0 -6373
- pynibs/tests/data/Xdmf.dtd +0 -89
- pynibs/tests/data/brainsight_niiImage_nifticoord.txt +0 -145
- pynibs/tests/data/brainsight_niiImage_nifticoord_largefile.txt +0 -1434
- pynibs/tests/data/brainsight_niiImage_niifticoord_mixedtargets.txt +0 -47
- pynibs/tests/data/create_subject_testsub.py +0 -332
- pynibs/tests/data/data.hdf5 +0 -0
- pynibs/tests/data/geo.hdf5 +0 -0
- pynibs/tests/test_coil.py +0 -474
- pynibs/tests/test_elements2nodes.py +0 -100
- pynibs/tests/test_hdf5_io/test_xdmf.py +0 -61
- pynibs/tests/test_mesh_transformations.py +0 -123
- pynibs/tests/test_mesh_utils.py +0 -143
- pynibs/tests/test_nnav_imports.py +0 -101
- pynibs/tests/test_quality_measures.py +0 -117
- pynibs/tests/test_regressdata.py +0 -289
- pynibs/tests/test_roi.py +0 -17
- pynibs/tests/test_rotations.py +0 -86
- pynibs/tests/test_subject.py +0 -71
- pynibs/tests/test_util.py +0 -24
- /pynibs/{regression/score_types.py → neuron/models/m1_montbrio.py} +0 -0
- {pyNIBS-0.2024.8.dist-info → pynibs-0.2026.1.dist-info/licenses}/LICENSE +0 -0
- {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
|
|
pynibs/regression/__init__.py
CHANGED
|
@@ -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 *
|