py-neuromodulation 0.0.4__py3-none-any.whl → 0.0.5__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 (80) hide show
  1. py_neuromodulation/ConnectivityDecoding/_get_grid_hull.m +34 -34
  2. py_neuromodulation/ConnectivityDecoding/_get_grid_whole_brain.py +95 -106
  3. py_neuromodulation/ConnectivityDecoding/_helper_write_connectome.py +107 -119
  4. py_neuromodulation/FieldTrip.py +589 -589
  5. py_neuromodulation/__init__.py +74 -13
  6. py_neuromodulation/_write_example_dataset_helper.py +83 -65
  7. py_neuromodulation/data/README +6 -6
  8. py_neuromodulation/data/dataset_description.json +8 -8
  9. py_neuromodulation/data/participants.json +32 -32
  10. py_neuromodulation/data/participants.tsv +2 -2
  11. py_neuromodulation/data/sub-testsub/ses-EphysMedOff/ieeg/sub-testsub_ses-EphysMedOff_space-mni_coordsystem.json +5 -5
  12. py_neuromodulation/data/sub-testsub/ses-EphysMedOff/ieeg/sub-testsub_ses-EphysMedOff_space-mni_electrodes.tsv +11 -11
  13. py_neuromodulation/data/sub-testsub/ses-EphysMedOff/ieeg/sub-testsub_ses-EphysMedOff_task-gripforce_run-0_channels.tsv +11 -11
  14. py_neuromodulation/data/sub-testsub/ses-EphysMedOff/ieeg/sub-testsub_ses-EphysMedOff_task-gripforce_run-0_ieeg.json +18 -18
  15. py_neuromodulation/data/sub-testsub/ses-EphysMedOff/ieeg/sub-testsub_ses-EphysMedOff_task-gripforce_run-0_ieeg.vhdr +35 -35
  16. py_neuromodulation/data/sub-testsub/ses-EphysMedOff/ieeg/sub-testsub_ses-EphysMedOff_task-gripforce_run-0_ieeg.vmrk +13 -13
  17. py_neuromodulation/data/sub-testsub/ses-EphysMedOff/sub-testsub_ses-EphysMedOff_scans.tsv +2 -2
  18. py_neuromodulation/grid_cortex.tsv +40 -40
  19. py_neuromodulation/liblsl/libpugixml.so.1.12 +0 -0
  20. py_neuromodulation/liblsl/linux/bionic_amd64/liblsl.1.16.2.so +0 -0
  21. py_neuromodulation/liblsl/linux/bookworm_amd64/liblsl.1.16.2.so +0 -0
  22. py_neuromodulation/liblsl/linux/focal_amd46/liblsl.1.16.2.so +0 -0
  23. py_neuromodulation/liblsl/linux/jammy_amd64/liblsl.1.16.2.so +0 -0
  24. py_neuromodulation/liblsl/linux/jammy_x86/liblsl.1.16.2.so +0 -0
  25. py_neuromodulation/liblsl/linux/noble_amd64/liblsl.1.16.2.so +0 -0
  26. py_neuromodulation/liblsl/macos/amd64/liblsl.1.16.2.dylib +0 -0
  27. py_neuromodulation/liblsl/macos/arm64/liblsl.1.16.0.dylib +0 -0
  28. py_neuromodulation/liblsl/windows/amd64/liblsl.1.16.2.dll +0 -0
  29. py_neuromodulation/liblsl/windows/x86/liblsl.1.16.2.dll +0 -0
  30. py_neuromodulation/nm_IO.py +413 -417
  31. py_neuromodulation/nm_RMAP.py +496 -531
  32. py_neuromodulation/nm_analysis.py +993 -1074
  33. py_neuromodulation/nm_artifacts.py +30 -25
  34. py_neuromodulation/nm_bispectra.py +154 -168
  35. py_neuromodulation/nm_bursts.py +292 -198
  36. py_neuromodulation/nm_coherence.py +251 -205
  37. py_neuromodulation/nm_database.py +149 -0
  38. py_neuromodulation/nm_decode.py +918 -992
  39. py_neuromodulation/nm_define_nmchannels.py +300 -302
  40. py_neuromodulation/nm_features.py +144 -116
  41. py_neuromodulation/nm_filter.py +219 -219
  42. py_neuromodulation/nm_filter_preprocessing.py +79 -91
  43. py_neuromodulation/nm_fooof.py +139 -159
  44. py_neuromodulation/nm_generator.py +45 -37
  45. py_neuromodulation/nm_hjorth_raw.py +52 -73
  46. py_neuromodulation/nm_kalmanfilter.py +71 -58
  47. py_neuromodulation/nm_linelength.py +21 -33
  48. py_neuromodulation/nm_logger.py +66 -0
  49. py_neuromodulation/nm_mne_connectivity.py +149 -112
  50. py_neuromodulation/nm_mnelsl_generator.py +90 -0
  51. py_neuromodulation/nm_mnelsl_stream.py +116 -0
  52. py_neuromodulation/nm_nolds.py +96 -93
  53. py_neuromodulation/nm_normalization.py +173 -214
  54. py_neuromodulation/nm_oscillatory.py +423 -448
  55. py_neuromodulation/nm_plots.py +585 -612
  56. py_neuromodulation/nm_preprocessing.py +83 -0
  57. py_neuromodulation/nm_projection.py +370 -394
  58. py_neuromodulation/nm_rereference.py +97 -95
  59. py_neuromodulation/nm_resample.py +59 -50
  60. py_neuromodulation/nm_run_analysis.py +325 -435
  61. py_neuromodulation/nm_settings.py +289 -68
  62. py_neuromodulation/nm_settings.yaml +244 -0
  63. py_neuromodulation/nm_sharpwaves.py +423 -401
  64. py_neuromodulation/nm_stats.py +464 -480
  65. py_neuromodulation/nm_stream.py +398 -0
  66. py_neuromodulation/nm_stream_abc.py +166 -218
  67. py_neuromodulation/nm_types.py +193 -0
  68. {py_neuromodulation-0.0.4.dist-info → py_neuromodulation-0.0.5.dist-info}/METADATA +29 -26
  69. py_neuromodulation-0.0.5.dist-info/RECORD +83 -0
  70. {py_neuromodulation-0.0.4.dist-info → py_neuromodulation-0.0.5.dist-info}/WHEEL +1 -1
  71. {py_neuromodulation-0.0.4.dist-info → py_neuromodulation-0.0.5.dist-info}/licenses/LICENSE +21 -21
  72. py_neuromodulation/nm_EpochStream.py +0 -92
  73. py_neuromodulation/nm_across_patient_decoding.py +0 -927
  74. py_neuromodulation/nm_cohortwrapper.py +0 -435
  75. py_neuromodulation/nm_eval_timing.py +0 -239
  76. py_neuromodulation/nm_features_abc.py +0 -39
  77. py_neuromodulation/nm_settings.json +0 -338
  78. py_neuromodulation/nm_stream_offline.py +0 -359
  79. py_neuromodulation/utils/_logging.py +0 -24
  80. py_neuromodulation-0.0.4.dist-info/RECORD +0 -72
@@ -1,39 +0,0 @@
1
- from abc import ABC, abstractmethod
2
- import numpy as np
3
- from typing import Iterable
4
-
5
-
6
- class Feature(ABC):
7
- @abstractmethod
8
- def __init__(
9
- self, settings: dict, ch_names: Iterable[str], sfreq: int | float
10
- ) -> None:
11
- pass
12
-
13
- @staticmethod
14
- @abstractmethod
15
- def test_settings(
16
- settings: dict,
17
- ch_names: Iterable[str],
18
- sfreq: int | float,
19
- ):
20
- """Method to check passed settings"""
21
- pass
22
-
23
- @abstractmethod
24
- def calc_feature(self, data: np.array, features_compute: dict) -> dict:
25
- """
26
- Feature calculation method. Each method needs to loop through all channels
27
-
28
- Parameters
29
- ----------
30
- data : np.array
31
- (channels, time)
32
- features_compute : dict
33
- ch_names : Iterable[str]
34
-
35
- Returns
36
- -------
37
- dict
38
- """
39
- pass
@@ -1,338 +0,0 @@
1
- {
2
- "sampling_rate_features_hz": 10,
3
- "segment_length_features_ms": 1000,
4
- "preprocessing": [
5
- "raw_resampling",
6
- "notch_filter",
7
- "re_referencing"
8
- ],
9
- "documentation_preprocessing_options": [
10
- "raw_resampling",
11
- "notch_filter",
12
- "re_referencing",
13
- "raw_normalization",
14
- "preprocessing_filter"
15
- ],
16
- "features": {
17
- "raw_hjorth": true,
18
- "return_raw": true,
19
- "bandpass_filter": false,
20
- "stft": false,
21
- "fft": true,
22
- "welch": true,
23
- "sharpwave_analysis": true,
24
- "fooof": false,
25
- "bursts": true,
26
- "linelength": true,
27
- "coherence": false,
28
- "nolds": false,
29
- "mne_connectivity": false,
30
- "bispectrum": false
31
- },
32
- "postprocessing": {
33
- "feature_normalization": true,
34
- "project_cortex": false,
35
- "project_subcortex": false
36
- },
37
- "raw_resampling_settings": {
38
- "resample_freq_hz": 1000
39
- },
40
- "preprocessing_filter": {
41
- "bandstop_filter": true,
42
- "lowpass_filter": true,
43
- "highpass_filter": true,
44
- "bandpass_filter": true,
45
- "bandstop_filter_settings": {
46
- "frequency_low_hz": 100,
47
- "frequency_high_hz": 160
48
- },
49
- "lowpass_filter_settings": {
50
- "frequency_cutoff_hz": 200
51
- },
52
- "highpass_filter_settings": {
53
- "frequency_cutoff_hz": 3
54
- },
55
- "bandpass_filter_settings": {
56
- "frequency_low_hz": 3,
57
- "frequency_high_hz": 200
58
- }
59
- },
60
- "re_referencing_settings": {
61
- "reference": "common"
62
- },
63
- "documentation_normalization_options": [
64
- "mean",
65
- "median",
66
- "zscore",
67
- "zscore-median",
68
- "quantile",
69
- "power",
70
- "robust",
71
- "minmax"
72
- ],
73
- "raw_normalization_settings": {
74
- "normalization_time_s": 30,
75
- "normalization_method": "zscore",
76
- "clip": 3
77
- },
78
- "feature_normalization_settings": {
79
- "normalization_time_s": 30,
80
- "normalization_method": "zscore",
81
- "clip": 3
82
- },
83
- "frequency_ranges_hz": {
84
- "theta": [
85
- 4,
86
- 8
87
- ],
88
- "alpha": [
89
- 8,
90
- 12
91
- ],
92
- "low beta": [
93
- 13,
94
- 20
95
- ],
96
- "high beta": [
97
- 20,
98
- 35
99
- ],
100
- "low gamma": [
101
- 60,
102
- 80
103
- ],
104
- "high gamma": [
105
- 90,
106
- 200
107
- ],
108
- "HFA": [
109
- 200,
110
- 400
111
- ]
112
- },
113
- "fft_settings": {
114
- "windowlength_ms": 1000,
115
- "log_transform": true,
116
- "features": {
117
- "mean": true,
118
- "median": false,
119
- "std": false,
120
- "max": false
121
- },
122
- "return_spectrum": false
123
- },
124
- "welch_settings": {
125
- "windowlength_ms": 1000,
126
- "log_transform": true,
127
- "features": {
128
- "mean": true,
129
- "median": false,
130
- "std": false,
131
- "max": false
132
- },
133
- "return_spectrum": false
134
- },
135
- "stft_settings": {
136
- "windowlength_ms": 500,
137
- "log_transform": true,
138
- "features": {
139
- "mean": true,
140
- "median": false,
141
- "std": false,
142
- "max": false
143
- },
144
- "return_spectrum": false
145
- },
146
- "bandpass_filter_settings": {
147
- "segment_lengths_ms": {
148
- "theta": 1000,
149
- "alpha": 500,
150
- "low beta": 333,
151
- "high beta": 333,
152
- "low gamma": 100,
153
- "high gamma": 100,
154
- "HFA": 100
155
- },
156
- "bandpower_features": {
157
- "activity": true,
158
- "mobility": false,
159
- "complexity": false
160
- },
161
- "log_transform": true,
162
- "kalman_filter": false
163
- },
164
- "kalman_filter_settings": {
165
- "Tp": 0.1,
166
- "sigma_w": 0.7,
167
- "sigma_v": 1,
168
- "frequency_bands": [
169
- "theta",
170
- "alpha",
171
- "low beta",
172
- "high beta",
173
- "low gamma",
174
- "high gamma",
175
- "HFA"
176
- ]
177
- },
178
- "burst_settings": {
179
- "threshold": 75,
180
- "time_duration_s": 30,
181
- "frequency_bands": [
182
- "low beta",
183
- "high beta",
184
- "low gamma"
185
- ],
186
- "burst_features": {
187
- "duration": true,
188
- "amplitude": true,
189
- "burst_rate_per_s": true,
190
- "in_burst": true
191
- }
192
- },
193
- "sharpwave_analysis_settings": {
194
- "sharpwave_features": {
195
- "peak_left": false,
196
- "peak_right": false,
197
- "trough": false,
198
- "width": false,
199
- "prominence": true,
200
- "interval": true,
201
- "decay_time": false,
202
- "rise_time": false,
203
- "sharpness": true,
204
- "rise_steepness": false,
205
- "decay_steepness": false,
206
- "slope_ratio": false
207
- },
208
- "filter_ranges_hz": [
209
- [
210
- 5,
211
- 80
212
- ],
213
- [
214
- 5,
215
- 30
216
- ]
217
- ],
218
- "detect_troughs": {
219
- "estimate": true,
220
- "distance_troughs_ms": 10,
221
- "distance_peaks_ms": 5
222
- },
223
- "detect_peaks": {
224
- "estimate": true,
225
- "distance_troughs_ms": 5,
226
- "distance_peaks_ms": 10
227
- },
228
- "estimator": {
229
- "mean": [
230
- "interval"
231
- ],
232
- "median": null,
233
- "max": [
234
- "prominence",
235
- "sharpness"
236
- ],
237
- "min": null,
238
- "var": null
239
- },
240
- "apply_estimator_between_peaks_and_troughs": true
241
- },
242
- "project_cortex_settings": {
243
- "max_dist_mm": 20
244
- },
245
- "project_subcortex_settings": {
246
- "max_dist_mm": 5
247
- },
248
- "coherence": {
249
- "channels": [
250
- [
251
- "STN_RIGHT_0",
252
- "ECOG_RIGHT_0"
253
- ]
254
- ],
255
- "frequency_bands": [
256
- "high beta"
257
- ],
258
- "features": {
259
- "mean_fband": true,
260
- "max_fband": true,
261
- "max_allfbands": true
262
- },
263
- "method": {
264
- "coh": true,
265
- "icoh": true
266
- }
267
- },
268
- "fooof": {
269
- "aperiodic": {
270
- "exponent": true,
271
- "offset": true,
272
- "knee": true
273
- },
274
- "periodic": {
275
- "center_frequency": false,
276
- "band_width": false,
277
- "height_over_ap": false
278
- },
279
- "windowlength_ms": 800,
280
- "peak_width_limits": [
281
- 0.5,
282
- 12
283
- ],
284
- "max_n_peaks": 3,
285
- "min_peak_height": 0,
286
- "peak_threshold": 2,
287
- "freq_range_hz": [
288
- 2,
289
- 40
290
- ],
291
- "knee": true
292
- },
293
- "nolds_features": {
294
- "sample_entropy": false,
295
- "correlation_dimension": false,
296
- "lyapunov_exponent": true,
297
- "hurst_exponent": false,
298
- "detrended_fluctutaion_analysis": false,
299
- "data": {
300
- "raw": true,
301
- "frequency_bands": [
302
- "low beta"
303
- ]
304
- }
305
- },
306
- "mne_connectiviy": {
307
- "method": "plv",
308
- "mode": "multitaper"
309
- },
310
- "bispectrum": {
311
- "f1s": [
312
- 5,
313
- 35
314
- ],
315
- "f2s": [
316
- 5,
317
- 35
318
- ],
319
- "compute_features_for_whole_fband_range": true,
320
- "frequency_bands": [
321
- "theta",
322
- "alpha",
323
- "low beta",
324
- "high beta"
325
- ],
326
- "components": {
327
- "absolute": true,
328
- "real": true,
329
- "imag": true,
330
- "phase": true
331
- },
332
- "bispectrum_features": {
333
- "mean": true,
334
- "sum": true,
335
- "var": true
336
- }
337
- }
338
- }