py-neuromodulation 0.0.2__tar.gz → 0.0.3__tar.gz

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 (224) hide show
  1. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/PKG-INFO +182 -142
  2. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/README.rst +19 -7
  3. py_neuromodulation-0.0.3/docs/build/_downloads/09df217f95985497f45d69e2d4bdc5b1/plot_2_example_add_feature.py +68 -0
  4. py_neuromodulation-0.0.3/docs/build/_downloads/3b4900a2b2818ff30362215b76f7d5eb/plot_1_example_BIDS.py +233 -0
  5. py_neuromodulation-0.0.3/docs/build/_downloads/7e92dd2e6cc86b239d14cafad972ae4f/plot_3_example_sharpwave_analysis.py +219 -0
  6. py_neuromodulation-0.0.3/docs/build/_downloads/c2db0bf2b334d541b00662b991682256/plot_6_real_time_demo.py +97 -0
  7. py_neuromodulation-0.0.3/docs/build/_downloads/ce3914826f782cbd1ea8fd024eaf0ac3/plot_5_example_rmap_computing.py +64 -0
  8. py_neuromodulation-0.0.3/docs/build/_downloads/da36848a41e6a3235d91fb7cfb6d59b4/plot_0_first_demo.py +192 -0
  9. py_neuromodulation-0.0.3/docs/build/_downloads/eaa4305c75b19a1e2eea941f742a6331/plot_4_example_gridPointProjection.py +210 -0
  10. py_neuromodulation-0.0.3/docs/build/html/_downloads/09df217f95985497f45d69e2d4bdc5b1/plot_2_example_add_feature.py +68 -0
  11. py_neuromodulation-0.0.3/docs/build/html/_downloads/3b4900a2b2818ff30362215b76f7d5eb/plot_1_example_BIDS.py +239 -0
  12. py_neuromodulation-0.0.3/docs/build/html/_downloads/7e92dd2e6cc86b239d14cafad972ae4f/plot_3_example_sharpwave_analysis.py +219 -0
  13. py_neuromodulation-0.0.3/docs/build/html/_downloads/c2db0bf2b334d541b00662b991682256/plot_6_real_time_demo.py +97 -0
  14. py_neuromodulation-0.0.3/docs/build/html/_downloads/ce3914826f782cbd1ea8fd024eaf0ac3/plot_5_example_rmap_computing.py +64 -0
  15. py_neuromodulation-0.0.3/docs/build/html/_downloads/da36848a41e6a3235d91fb7cfb6d59b4/plot_0_first_demo.py +192 -0
  16. py_neuromodulation-0.0.3/docs/build/html/_downloads/eaa4305c75b19a1e2eea941f742a6331/plot_4_example_gridPointProjection.py +210 -0
  17. py_neuromodulation-0.0.3/docs/source/_build/html/_downloads/09df217f95985497f45d69e2d4bdc5b1/plot_2_example_add_feature.py +76 -0
  18. py_neuromodulation-0.0.3/docs/source/_build/html/_downloads/0d0d0a76e8f648d5d3cbc47da6351932/plot_real_time_demo.py +97 -0
  19. py_neuromodulation-0.0.3/docs/source/_build/html/_downloads/3b4900a2b2818ff30362215b76f7d5eb/plot_1_example_BIDS.py +240 -0
  20. py_neuromodulation-0.0.3/docs/source/_build/html/_downloads/5d73cadc59a8805c47e3b84063afc157/plot_example_BIDS.py +233 -0
  21. py_neuromodulation-0.0.3/docs/source/_build/html/_downloads/7660317fa5a6bfbd12fcca9961457fc4/plot_example_rmap_computing.py +63 -0
  22. py_neuromodulation-0.0.3/docs/source/_build/html/_downloads/7e92dd2e6cc86b239d14cafad972ae4f/plot_3_example_sharpwave_analysis.py +219 -0
  23. py_neuromodulation-0.0.3/docs/source/_build/html/_downloads/839e5b319379f7fd9e867deb00fd797f/plot_example_gridPointProjection.py +210 -0
  24. py_neuromodulation-0.0.3/docs/source/_build/html/_downloads/ae8be19afe5e559f011fc9b138968ba0/plot_first_demo.py +192 -0
  25. py_neuromodulation-0.0.3/docs/source/_build/html/_downloads/b8b06cacc17969d3725a0b6f1d7741c5/plot_example_sharpwave_analysis.py +219 -0
  26. py_neuromodulation-0.0.3/docs/source/_build/html/_downloads/c2db0bf2b334d541b00662b991682256/plot_6_real_time_demo.py +121 -0
  27. py_neuromodulation-0.0.3/docs/source/_build/html/_downloads/c31a86c0b68cb4167d968091ace8080d/plot_example_add_feature.py +68 -0
  28. py_neuromodulation-0.0.3/docs/source/_build/html/_downloads/ce3914826f782cbd1ea8fd024eaf0ac3/plot_5_example_rmap_computing.py +64 -0
  29. py_neuromodulation-0.0.3/docs/source/_build/html/_downloads/da36848a41e6a3235d91fb7cfb6d59b4/plot_0_first_demo.py +189 -0
  30. py_neuromodulation-0.0.3/docs/source/_build/html/_downloads/eaa4305c75b19a1e2eea941f742a6331/plot_4_example_gridPointProjection.py +210 -0
  31. py_neuromodulation-0.0.3/docs/source/auto_examples/plot_0_first_demo.py +189 -0
  32. py_neuromodulation-0.0.3/docs/source/auto_examples/plot_1_example_BIDS.py +240 -0
  33. py_neuromodulation-0.0.3/docs/source/auto_examples/plot_2_example_add_feature.py +76 -0
  34. py_neuromodulation-0.0.3/docs/source/auto_examples/plot_3_example_sharpwave_analysis.py +219 -0
  35. py_neuromodulation-0.0.3/docs/source/auto_examples/plot_4_example_gridPointProjection.py +210 -0
  36. py_neuromodulation-0.0.3/docs/source/auto_examples/plot_5_example_rmap_computing.py +64 -0
  37. py_neuromodulation-0.0.3/docs/source/auto_examples/plot_6_real_time_demo.py +121 -0
  38. py_neuromodulation-0.0.3/docs/source/conf.py +105 -0
  39. py_neuromodulation-0.0.3/examples/plot_0_first_demo.py +189 -0
  40. py_neuromodulation-0.0.3/examples/plot_1_example_BIDS.py +240 -0
  41. py_neuromodulation-0.0.3/examples/plot_2_example_add_feature.py +76 -0
  42. py_neuromodulation-0.0.3/examples/plot_3_example_sharpwave_analysis.py +219 -0
  43. py_neuromodulation-0.0.3/examples/plot_4_example_gridPointProjection.py +210 -0
  44. py_neuromodulation-0.0.3/examples/plot_5_example_rmap_computing.py +64 -0
  45. py_neuromodulation-0.0.3/examples/plot_6_real_time_demo.py +121 -0
  46. py_neuromodulation-0.0.3/packages/realtime_decoding/build/lib/realtime_decoding/__init__.py +4 -0
  47. py_neuromodulation-0.0.3/packages/realtime_decoding/build/lib/realtime_decoding/decoder.py +104 -0
  48. py_neuromodulation-0.0.3/packages/realtime_decoding/build/lib/realtime_decoding/features.py +163 -0
  49. py_neuromodulation-0.0.3/packages/realtime_decoding/build/lib/realtime_decoding/helpers.py +15 -0
  50. py_neuromodulation-0.0.3/packages/realtime_decoding/build/lib/realtime_decoding/run_decoding.py +345 -0
  51. py_neuromodulation-0.0.3/packages/realtime_decoding/build/lib/realtime_decoding/trainer.py +54 -0
  52. py_neuromodulation-0.0.3/packages/tmsi/build/lib/TMSiFileFormats/__init__.py +37 -0
  53. py_neuromodulation-0.0.3/packages/tmsi/build/lib/TMSiFileFormats/file_formats/__init__.py +36 -0
  54. py_neuromodulation-0.0.3/packages/tmsi/build/lib/TMSiFileFormats/file_formats/lsl_stream_writer.py +200 -0
  55. py_neuromodulation-0.0.3/packages/tmsi/build/lib/TMSiFileFormats/file_formats/poly5_file_writer.py +496 -0
  56. py_neuromodulation-0.0.3/packages/tmsi/build/lib/TMSiFileFormats/file_formats/poly5_to_edf_converter.py +236 -0
  57. py_neuromodulation-0.0.3/packages/tmsi/build/lib/TMSiFileFormats/file_formats/xdf_file_writer.py +977 -0
  58. py_neuromodulation-0.0.3/packages/tmsi/build/lib/TMSiFileFormats/file_readers/__init__.py +35 -0
  59. py_neuromodulation-0.0.3/packages/tmsi/build/lib/TMSiFileFormats/file_readers/edf_reader.py +116 -0
  60. py_neuromodulation-0.0.3/packages/tmsi/build/lib/TMSiFileFormats/file_readers/poly5reader.py +294 -0
  61. py_neuromodulation-0.0.3/packages/tmsi/build/lib/TMSiFileFormats/file_readers/xdf_reader.py +229 -0
  62. py_neuromodulation-0.0.3/packages/tmsi/build/lib/TMSiFileFormats/file_writer.py +102 -0
  63. py_neuromodulation-0.0.3/packages/tmsi/build/lib/TMSiPlotters/__init__.py +2 -0
  64. py_neuromodulation-0.0.3/packages/tmsi/build/lib/TMSiPlotters/gui/__init__.py +39 -0
  65. py_neuromodulation-0.0.3/packages/tmsi/build/lib/TMSiPlotters/gui/_plotter_gui.py +234 -0
  66. py_neuromodulation-0.0.3/packages/tmsi/build/lib/TMSiPlotters/gui/plotting_gui.py +440 -0
  67. py_neuromodulation-0.0.3/packages/tmsi/build/lib/TMSiPlotters/plotters/__init__.py +44 -0
  68. py_neuromodulation-0.0.3/packages/tmsi/build/lib/TMSiPlotters/plotters/hd_emg_plotter.py +446 -0
  69. py_neuromodulation-0.0.3/packages/tmsi/build/lib/TMSiPlotters/plotters/impedance_plotter.py +589 -0
  70. py_neuromodulation-0.0.3/packages/tmsi/build/lib/TMSiPlotters/plotters/signal_plotter.py +1326 -0
  71. py_neuromodulation-0.0.3/packages/tmsi/build/lib/TMSiSDK/__init__.py +54 -0
  72. py_neuromodulation-0.0.3/packages/tmsi/build/lib/TMSiSDK/device.py +588 -0
  73. py_neuromodulation-0.0.3/packages/tmsi/build/lib/TMSiSDK/devices/__init__.py +34 -0
  74. py_neuromodulation-0.0.3/packages/tmsi/build/lib/TMSiSDK/devices/saga/TMSi_Device_API.py +1764 -0
  75. py_neuromodulation-0.0.3/packages/tmsi/build/lib/TMSiSDK/devices/saga/__init__.py +34 -0
  76. py_neuromodulation-0.0.3/packages/tmsi/build/lib/TMSiSDK/devices/saga/saga_device.py +1366 -0
  77. py_neuromodulation-0.0.3/packages/tmsi/build/lib/TMSiSDK/devices/saga/saga_types.py +520 -0
  78. py_neuromodulation-0.0.3/packages/tmsi/build/lib/TMSiSDK/devices/saga/xml_saga_config.py +165 -0
  79. py_neuromodulation-0.0.3/packages/tmsi/build/lib/TMSiSDK/error.py +95 -0
  80. py_neuromodulation-0.0.3/packages/tmsi/build/lib/TMSiSDK/sample_data.py +63 -0
  81. py_neuromodulation-0.0.3/packages/tmsi/build/lib/TMSiSDK/sample_data_server.py +99 -0
  82. py_neuromodulation-0.0.3/packages/tmsi/build/lib/TMSiSDK/settings.py +45 -0
  83. py_neuromodulation-0.0.3/packages/tmsi/build/lib/TMSiSDK/tmsi_device.py +111 -0
  84. py_neuromodulation-0.0.3/packages/tmsi/build/lib/__init__.py +4 -0
  85. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/__init__.py +34 -0
  86. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/device/__init__.py +41 -0
  87. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/device/devices/apex/apex_API.py +1009 -0
  88. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/device/devices/apex/apex_API_enums.py +239 -0
  89. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/device/devices/apex/apex_API_structures.py +668 -0
  90. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/device/devices/apex/apex_device.py +1611 -0
  91. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/device/devices/apex/apex_dongle.py +38 -0
  92. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/device/devices/apex/apex_event_reader.py +57 -0
  93. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/device/devices/apex/apex_structures/apex_channel.py +44 -0
  94. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/device/devices/apex/apex_structures/apex_config.py +150 -0
  95. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/device/devices/apex/apex_structures/apex_const.py +36 -0
  96. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/device/devices/apex/apex_structures/apex_impedance_channel.py +48 -0
  97. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/device/devices/apex/apex_structures/apex_info.py +108 -0
  98. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/device/devices/apex/apex_structures/dongle_info.py +39 -0
  99. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/device/devices/apex/measurements/download_measurement.py +77 -0
  100. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/device/devices/apex/measurements/eeg_measurement.py +150 -0
  101. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/device/devices/apex/measurements/impedance_measurement.py +129 -0
  102. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/device/threads/conversion_thread.py +59 -0
  103. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/device/threads/sampling_thread.py +57 -0
  104. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/device/tmsi_channel.py +83 -0
  105. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/device/tmsi_device.py +201 -0
  106. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/device/tmsi_device_enums.py +103 -0
  107. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/device/tmsi_dongle.py +43 -0
  108. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/device/tmsi_event_reader.py +50 -0
  109. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/device/tmsi_measurement.py +118 -0
  110. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/sample_data_server/__init__.py +33 -0
  111. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/sample_data_server/event_data.py +44 -0
  112. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/sample_data_server/sample_data.py +50 -0
  113. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/sample_data_server/sample_data_server.py +136 -0
  114. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/tmsi_errors/error.py +126 -0
  115. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/tmsi_sdk.py +113 -0
  116. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/tmsi_utilities/apex/apex_structure_generator.py +134 -0
  117. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/tmsi_utilities/decorators.py +60 -0
  118. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/tmsi_utilities/logger_filter.py +42 -0
  119. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/tmsi_utilities/singleton.py +42 -0
  120. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/tmsi_utilities/support_functions.py +72 -0
  121. py_neuromodulation-0.0.3/packages/tmsi/build/lib/apex_sdk/tmsi_utilities/tmsi_logger.py +98 -0
  122. py_neuromodulation-0.0.2/py_neuromodulation/helper.py → py_neuromodulation-0.0.3/py_neuromodulation/_write_example_dataset_helper.py +1 -1
  123. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/py_neuromodulation/nm_EpochStream.py +2 -3
  124. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/py_neuromodulation/nm_IO.py +43 -70
  125. py_neuromodulation-0.0.3/py_neuromodulation/nm_RMAP.py +531 -0
  126. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/py_neuromodulation/nm_analysis.py +1 -1
  127. py_neuromodulation-0.0.3/py_neuromodulation/nm_artifacts.py +25 -0
  128. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/py_neuromodulation/nm_bispectra.py +64 -29
  129. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/py_neuromodulation/nm_bursts.py +44 -30
  130. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/py_neuromodulation/nm_coherence.py +2 -1
  131. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/py_neuromodulation/nm_features.py +4 -2
  132. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/py_neuromodulation/nm_filter.py +63 -32
  133. py_neuromodulation-0.0.3/py_neuromodulation/nm_filter_preprocessing.py +91 -0
  134. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/py_neuromodulation/nm_fooof.py +47 -29
  135. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/py_neuromodulation/nm_mne_connectivity.py +1 -1
  136. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/py_neuromodulation/nm_normalization.py +50 -74
  137. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/py_neuromodulation/nm_oscillatory.py +151 -31
  138. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/py_neuromodulation/nm_plots.py +13 -10
  139. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/py_neuromodulation/nm_rereference.py +10 -8
  140. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/py_neuromodulation/nm_run_analysis.py +28 -13
  141. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/py_neuromodulation/nm_sharpwaves.py +103 -136
  142. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/py_neuromodulation/nm_stats.py +44 -30
  143. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/py_neuromodulation/nm_stream_abc.py +18 -10
  144. py_neuromodulation-0.0.3/py_neuromodulation/nm_stream_offline.py +358 -0
  145. py_neuromodulation-0.0.3/py_neuromodulation/utils/_logging.py +24 -0
  146. py_neuromodulation-0.0.3/py_neuromodulation.egg-info/PKG-INFO +182 -0
  147. py_neuromodulation-0.0.3/py_neuromodulation.egg-info/SOURCES.txt +191 -0
  148. {py_neuromodulation-0.0.2/py_neuromodulation → py_neuromodulation-0.0.3}/py_neuromodulation.egg-info/requires.txt +9 -2
  149. py_neuromodulation-0.0.3/py_neuromodulation.egg-info/top_level.txt +9 -0
  150. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/pyproject.toml +30 -7
  151. py_neuromodulation-0.0.3/setup.cfg +4 -0
  152. py_neuromodulation-0.0.3/tests/__init__.py +0 -0
  153. py_neuromodulation-0.0.3/tests/conftest.py +117 -0
  154. py_neuromodulation-0.0.3/tests/test_all_examples.py +10 -0
  155. py_neuromodulation-0.0.3/tests/test_all_features.py +63 -0
  156. py_neuromodulation-0.0.3/tests/test_bispectra.py +70 -0
  157. py_neuromodulation-0.0.3/tests/test_bursts.py +105 -0
  158. py_neuromodulation-0.0.3/tests/test_feature_sampling_rates.py +143 -0
  159. py_neuromodulation-0.0.3/tests/test_fooof.py +16 -0
  160. py_neuromodulation-0.0.3/tests/test_initalization_offline_stream.py +41 -0
  161. py_neuromodulation-0.0.3/tests/test_multiprocessing.py +58 -0
  162. py_neuromodulation-0.0.3/tests/test_nan_values.py +29 -0
  163. py_neuromodulation-0.0.3/tests/test_nm_filter.py +95 -0
  164. py_neuromodulation-0.0.3/tests/test_nm_resample.py +63 -0
  165. py_neuromodulation-0.0.3/tests/test_normalization_settings.py +146 -0
  166. py_neuromodulation-0.0.3/tests/test_notch_filter.py +31 -0
  167. py_neuromodulation-0.0.3/tests/test_osc_features.py +424 -0
  168. py_neuromodulation-0.0.3/tests/test_preprocessing_filter.py +151 -0
  169. py_neuromodulation-0.0.3/tests/test_rereference.py +171 -0
  170. py_neuromodulation-0.0.3/tests/test_sampling.py +57 -0
  171. py_neuromodulation-0.0.3/tests/test_settings_change_after_init.py +76 -0
  172. py_neuromodulation-0.0.3/tests/test_sharpwave.py +165 -0
  173. py_neuromodulation-0.0.3/tests/test_target_channel_add.py +100 -0
  174. py_neuromodulation-0.0.3/tests/test_timing.py +80 -0
  175. py_neuromodulation-0.0.2/py_neuromodulation/data/README +0 -6
  176. py_neuromodulation-0.0.2/py_neuromodulation/data/dataset_description.json +0 -8
  177. py_neuromodulation-0.0.2/py_neuromodulation/data/derivatives/sub-testsub_ses-EphysMedOff_task-gripforce_run-0/MOV_aligned_features_ch_ECOG_RIGHT_0_all.png +0 -0
  178. py_neuromodulation-0.0.2/py_neuromodulation/data/derivatives/sub-testsub_ses-EphysMedOff_task-gripforce_run-0/all_feature_plt.pdf +0 -0
  179. py_neuromodulation-0.0.2/py_neuromodulation/data/derivatives/sub-testsub_ses-EphysMedOff_task-gripforce_run-0/sub-testsub_ses-EphysMedOff_task-gripforce_run-0_FEATURES.csv +0 -182
  180. py_neuromodulation-0.0.2/py_neuromodulation/data/derivatives/sub-testsub_ses-EphysMedOff_task-gripforce_run-0/sub-testsub_ses-EphysMedOff_task-gripforce_run-0_LM_ML_RES.p +0 -0
  181. py_neuromodulation-0.0.2/py_neuromodulation/data/derivatives/sub-testsub_ses-EphysMedOff_task-gripforce_run-0/sub-testsub_ses-EphysMedOff_task-gripforce_run-0_SETTINGS.json +0 -273
  182. py_neuromodulation-0.0.2/py_neuromodulation/data/derivatives/sub-testsub_ses-EphysMedOff_task-gripforce_run-0/sub-testsub_ses-EphysMedOff_task-gripforce_run-0_SIDECAR.json +0 -6
  183. py_neuromodulation-0.0.2/py_neuromodulation/data/derivatives/sub-testsub_ses-EphysMedOff_task-gripforce_run-0/sub-testsub_ses-EphysMedOff_task-gripforce_run-0_decoding_performance.png +0 -0
  184. py_neuromodulation-0.0.2/py_neuromodulation/data/derivatives/sub-testsub_ses-EphysMedOff_task-gripforce_run-0/sub-testsub_ses-EphysMedOff_task-gripforce_run-0_nm_channels.csv +0 -11
  185. py_neuromodulation-0.0.2/py_neuromodulation/data/participants.json +0 -32
  186. py_neuromodulation-0.0.2/py_neuromodulation/data/participants.tsv +0 -2
  187. py_neuromodulation-0.0.2/py_neuromodulation/data/sub-testsub/ses-EphysMedOff/ieeg/sub-testsub_ses-EphysMedOff_space-mni_coordsystem.json +0 -5
  188. py_neuromodulation-0.0.2/py_neuromodulation/data/sub-testsub/ses-EphysMedOff/ieeg/sub-testsub_ses-EphysMedOff_space-mni_electrodes.tsv +0 -11
  189. py_neuromodulation-0.0.2/py_neuromodulation/data/sub-testsub/ses-EphysMedOff/ieeg/sub-testsub_ses-EphysMedOff_task-gripforce_run-0_channels.tsv +0 -11
  190. py_neuromodulation-0.0.2/py_neuromodulation/data/sub-testsub/ses-EphysMedOff/ieeg/sub-testsub_ses-EphysMedOff_task-gripforce_run-0_ieeg.eeg +0 -0
  191. py_neuromodulation-0.0.2/py_neuromodulation/data/sub-testsub/ses-EphysMedOff/ieeg/sub-testsub_ses-EphysMedOff_task-gripforce_run-0_ieeg.json +0 -18
  192. py_neuromodulation-0.0.2/py_neuromodulation/data/sub-testsub/ses-EphysMedOff/ieeg/sub-testsub_ses-EphysMedOff_task-gripforce_run-0_ieeg.vhdr +0 -35
  193. py_neuromodulation-0.0.2/py_neuromodulation/data/sub-testsub/ses-EphysMedOff/ieeg/sub-testsub_ses-EphysMedOff_task-gripforce_run-0_ieeg.vmrk +0 -13
  194. py_neuromodulation-0.0.2/py_neuromodulation/data/sub-testsub/ses-EphysMedOff/sub-testsub_ses-EphysMedOff_scans.tsv +0 -2
  195. py_neuromodulation-0.0.2/py_neuromodulation/grid_cortex.tsv +0 -40
  196. py_neuromodulation-0.0.2/py_neuromodulation/grid_subcortex.tsv +0 -1429
  197. py_neuromodulation-0.0.2/py_neuromodulation/nm_RMAP.py +0 -234
  198. py_neuromodulation-0.0.2/py_neuromodulation/nm_settings.json +0 -290
  199. py_neuromodulation-0.0.2/py_neuromodulation/nm_stream_offline.py +0 -217
  200. py_neuromodulation-0.0.2/py_neuromodulation/plots/STN_surf.mat +0 -0
  201. py_neuromodulation-0.0.2/py_neuromodulation/plots/Vertices.mat +0 -0
  202. py_neuromodulation-0.0.2/py_neuromodulation/plots/faces.mat +0 -0
  203. py_neuromodulation-0.0.2/py_neuromodulation/plots/grid.mat +0 -0
  204. py_neuromodulation-0.0.2/py_neuromodulation/py_neuromodulation.egg-info/PKG-INFO +0 -104
  205. py_neuromodulation-0.0.2/py_neuromodulation/py_neuromodulation.egg-info/top_level.txt +0 -1
  206. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/LICENSE +0 -0
  207. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/py_neuromodulation/FieldTrip.py +0 -0
  208. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/py_neuromodulation/__init__.py +0 -0
  209. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/py_neuromodulation/nm_across_patient_decoding.py +0 -0
  210. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/py_neuromodulation/nm_cohortwrapper.py +0 -0
  211. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/py_neuromodulation/nm_decode.py +0 -0
  212. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/py_neuromodulation/nm_define_nmchannels.py +0 -0
  213. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/py_neuromodulation/nm_eval_timing.py +0 -0
  214. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/py_neuromodulation/nm_features_abc.py +0 -0
  215. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/py_neuromodulation/nm_generator.py +0 -0
  216. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/py_neuromodulation/nm_hjorth_raw.py +0 -0
  217. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/py_neuromodulation/nm_kalmanfilter.py +0 -0
  218. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/py_neuromodulation/nm_linelength.py +0 -0
  219. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/py_neuromodulation/nm_nolds.py +0 -0
  220. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/py_neuromodulation/nm_projection.py +0 -0
  221. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/py_neuromodulation/nm_resample.py +0 -0
  222. {py_neuromodulation-0.0.2 → py_neuromodulation-0.0.3}/py_neuromodulation/nm_settings.py +0 -0
  223. /py_neuromodulation-0.0.2/py_neuromodulation/py_neuromodulation.egg-info/SOURCES.txt → /py_neuromodulation-0.0.3/py_neuromodulation/utils/__init__.py +0 -0
  224. {py_neuromodulation-0.0.2/py_neuromodulation → py_neuromodulation-0.0.3}/py_neuromodulation.egg-info/dependency_links.txt +0 -0
@@ -1,142 +1,182 @@
1
- Metadata-Version: 2.1
2
- Name: py_neuromodulation
3
- Version: 0.0.2
4
- Summary: Real-time analysis of intracranial neurophysiology recordings.
5
- Keywords: real-time,eeg,ieeg,dbs,ecog,electrocorticography,deep-brain-stimulation,machine-learning
6
- Author-email: Timon Merk <timon.merk@charite.de>
7
- Maintainer: Timon Merk
8
- Requires-Python: >=3.10
9
- Description-Content-Type: text/x-rst
10
- Classifier: Development Status :: 2 - Pre-Alpha
11
- Classifier: License :: OSI Approved :: MIT License
12
- Classifier: Programming Language :: Python
13
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
14
- Requires-Dist: mne
15
- Requires-Dist: filterpy >= 1.4.5
16
- Requires-Dist: fooof
17
- Requires-Dist: imbalanced-learn
18
- Requires-Dist: matplotlib >= 3.3.4
19
- Requires-Dist: mne-bids >= 0.8
20
- Requires-Dist: mne-connectivity
21
- Requires-Dist: mrmr-selection
22
- Requires-Dist: nolds
23
- Requires-Dist: numpy >= 1.21.2
24
- Requires-Dist: pandas >= 1.2.2
25
- Requires-Dist: pip
26
- Requires-Dist: pynput
27
- Requires-Dist: pybids
28
- Requires-Dist: scikit-image
29
- Requires-Dist: scikit-learn >= 0.24.2
30
- Requires-Dist: scikit-optimize
31
- Requires-Dist: scipy >= 1.7.1
32
- Requires-Dist: seaborn >= 0.11
33
- Requires-Dist: notebook
34
- Requires-Dist: ipython
35
- Requires-Dist: pybispectra
36
- Requires-Dist: black ; extra == "dev"
37
- Requires-Dist: pytest ; extra == "dev"
38
- Requires-Dist: pytest-cov ; extra == "dev"
39
- Project-URL: bugtracker, https://github.com/neuromodulation/py_neuromodulation/issues
40
- Project-URL: repository, https://github.com/neuromodulation/py_neuromodulation
41
- Provides-Extra: dev
42
-
43
- py_neuromodulation
44
- ==================
45
-
46
- Analyzing neural data can be a troublesome, trial and error prone,
47
- and beginner unfriendly process. *py_neuromodulation* allows using a simple
48
- interface for extraction of established neurophysiological features and includes commonly applied pre -and postprocessing methods.
49
-
50
- Only **time series data** with a corresponding **sampling frequency** are required for feature extraction.
51
-
52
- The output will be a `pandas.DataFrame <https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html>`_ including different time-resolved computed features. Internally a **stream** get's initialized,
53
- which resembles an *online* data-stream that can in theory also be be used with a hardware acquisition system.
54
-
55
- The following features are currently included:
56
-
57
- * oscillatory: fft, stft or bandpass filtered band power
58
- * `temporal waveform shape <https://www.sciencedirect.com/science/article/pii/S1364661316302182>`_
59
- * `fooof <https://fooof-tools.github.io/fooof/>`_
60
- * `mne_connectivity estimates <https://mne.tools/mne-connectivity/stable/index.html>`_
61
- * `Hjorth parameter <https://en.wikipedia.org/wiki/Hjorth_parameters>`_
62
- * `non-linear dynamical estimates <https://nolds.readthedocs.io/en/latest/>`_
63
- * various burst features
64
- * line length
65
- * and more...
66
-
67
-
68
- Find here the preprint of **py_neuromodulation** called *"Invasive neurophysiology and whole brain connectomics for neural decoding in patients with brain implants"* [1]_.
69
-
70
- The original intention for writing this toolbox was movement decoding from invasive brain signals [2]_.
71
- The application however could be any neural decoding problem.
72
- *py_neuromodulation* offers wrappers around common practice machine learning methods for efficient analysis.
73
-
74
- Find the documentation here http://py-neuromodulation.readthedocs.io for example usage and parametrization.
75
-
76
- Installation
77
- ============
78
-
79
- py_neuromodulation requires at least python 3.10. For installation you can use pip:
80
-
81
- .. code-block::
82
-
83
- pip install py-neuromodulation
84
-
85
- We recommend however installing the package in a new new conda environment:
86
-
87
- .. code-block::
88
-
89
- git clone https://github.com/neuromodulation/py_neuromodulation.git
90
- conda create -n pynm-test python=3.10
91
- conda activate pynm-test
92
-
93
- Then install the packages listed in the `pyproject.toml`:
94
-
95
- .. code-block::
96
-
97
- pip install .
98
-
99
-
100
- Optionally the ipython kernel can be specified for the installed pynm-test conda environment:
101
-
102
- .. code-block::
103
-
104
- ipython kernel install --user --name=pynm-test
105
-
106
- Then *py_neuromodulation* can be imported via:
107
-
108
- .. code-block::
109
-
110
- import py_neuromodulation as py_nm
111
-
112
- Basic Usage
113
- ===========
114
-
115
- .. code-block:: python
116
-
117
- import py_neuromodulation as pn
118
- import numpy as np
119
-
120
- NUM_CHANNELS = 5
121
- NUM_DATA = 10000
122
- sfreq = 1000 # Hz
123
- feature_freq = 3 # Hz
124
-
125
- data = np.random.random([NUM_CHANNELS, NUM_DATA])
126
-
127
- stream = pn.Stream(sfreq=sfreq, data=data, sampling_rate_features_hz=sampling_rate_features_hz)
128
- features = stream.run()
129
-
130
- Check the `Usage <https://py-neuromodulation.readthedocs.io/en/latest/usage.html>`_ and `First examples <https://py-neuromodulation.readthedocs.io/en/latest/auto_examples/plot_first_demo.html>`_ for further introduction.
131
-
132
- Contact information
133
- -------------------
134
- For any question or suggestion please find my contact
135
- information at `my GitHub profile <https://github.com/timonmerk>`_.
136
-
137
- References
138
- ----------
139
-
140
- .. [1] Merk, T. et al. *Invasive neurophysiology and whole brain connectomics for neural decoding in patients with brain implants*, `https://doi.org/10.21203/rs.3.rs-3212709/v1` (2023).
141
- .. [2] Merk, T. et al. *Electrocorticography is superior to subthalamic local field potentials for movement decoding in Parkinson’s disease*. Elife 11, e75126, `https://doi.org/10.7554/eLife.75126` (2022).
142
-
1
+ Metadata-Version: 2.1
2
+ Name: py_neuromodulation
3
+ Version: 0.0.3
4
+ Summary: Real-time analysis of intracranial neurophysiology recordings.
5
+ Author-email: Timon Merk <timon.merk@charite.de>
6
+ Maintainer: Timon Merk
7
+ License: MIT License
8
+
9
+ Copyright (c) 2021 Interventional Cognitive Neuromodulation - Neumann Lab Berlin
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ of this software and associated documentation files (the "Software"), to deal
13
+ in the Software without restriction, including without limitation the rights
14
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ copies of the Software, and to permit persons to whom the Software is
16
+ furnished to do so, subject to the following conditions:
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
28
+
29
+ Project-URL: bugtracker, https://github.com/neuromodulation/py_neuromodulation/issues
30
+ Project-URL: repository, https://github.com/neuromodulation/py_neuromodulation
31
+ Keywords: real-time,eeg,ieeg,dbs,ecog,electrocorticography,deep-brain-stimulation,machine-learning
32
+ Classifier: Development Status :: 2 - Pre-Alpha
33
+ Classifier: License :: OSI Approved :: MIT License
34
+ Classifier: Programming Language :: Python
35
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
36
+ Requires-Python: >=3.10
37
+ Description-Content-Type: text/x-rst
38
+ License-File: LICENSE
39
+ Requires-Dist: mne
40
+ Requires-Dist: filterpy>=1.4.5
41
+ Requires-Dist: fooof
42
+ Requires-Dist: imbalanced-learn
43
+ Requires-Dist: matplotlib>=3.3.4
44
+ Requires-Dist: mne-bids>=0.8
45
+ Requires-Dist: mne-connectivity
46
+ Requires-Dist: mrmr-selection
47
+ Requires-Dist: nolds
48
+ Requires-Dist: numpy>=1.21.2
49
+ Requires-Dist: pandas>=1.2.2
50
+ Requires-Dist: pip
51
+ Requires-Dist: pynput
52
+ Requires-Dist: pybids
53
+ Requires-Dist: scikit-image
54
+ Requires-Dist: scikit-learn>=0.24.2
55
+ Requires-Dist: scikit-optimize
56
+ Requires-Dist: scipy>=1.7.1
57
+ Requires-Dist: seaborn>=0.11
58
+ Requires-Dist: notebook
59
+ Requires-Dist: ipython
60
+ Requires-Dist: pybispectra>=1.0.0
61
+ Requires-Dist: pyparrm
62
+ Requires-Dist: pyarrow>=14.0.2
63
+ Requires-Dist: joblib>=1.3.2
64
+ Requires-Dist: black>=24.2.0
65
+ Requires-Dist: pytest>=8.0.2
66
+ Requires-Dist: wget
67
+ Provides-Extra: dev
68
+ Requires-Dist: black; extra == "dev"
69
+ Requires-Dist: pytest; extra == "dev"
70
+ Requires-Dist: pytest-cov; extra == "dev"
71
+
72
+ py_neuromodulation
73
+ ==================
74
+
75
+ Analyzing neural data can be a troublesome, trial and error prone,
76
+ and beginner unfriendly process. *py_neuromodulation* allows using a simple
77
+ interface for extraction of established neurophysiological features and includes commonly applied pre -and postprocessing methods.
78
+
79
+ Only **time series data** with a corresponding **sampling frequency** are required for feature extraction.
80
+
81
+ The output will be a `pandas.DataFrame <https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html>`_ including different time-resolved computed features. Internally a **stream** get's initialized,
82
+ which resembles an *online* data-stream that can in theory also be be used with a hardware acquisition system.
83
+
84
+ The following features are currently included:
85
+
86
+ * oscillatory: fft, stft or bandpass filtered band power
87
+ * `temporal waveform shape <https://www.sciencedirect.com/science/article/pii/S1364661316302182>`_
88
+ * `fooof <https://fooof-tools.github.io/fooof/>`_
89
+ * `mne_connectivity estimates <https://mne.tools/mne-connectivity/stable/index.html>`_
90
+ * `Hjorth parameter <https://en.wikipedia.org/wiki/Hjorth_parameters>`_
91
+ * `non-linear dynamical estimates <https://nolds.readthedocs.io/en/latest/>`_
92
+ * various burst features
93
+ * line length
94
+ * and more...
95
+
96
+
97
+ Find here the preprint of **py_neuromodulation** called *"Invasive neurophysiology and whole brain connectomics for neural decoding in patients with brain implants"* [1]_.
98
+
99
+ The original intention for writing this toolbox was movement decoding from invasive brain signals [2]_.
100
+ The application however could be any neural decoding problem.
101
+ *py_neuromodulation* offers wrappers around common practice machine learning methods for efficient analysis.
102
+
103
+ Find the documentation here http://py-neuromodulation.readthedocs.io for example usage and parametrization.
104
+
105
+ Installation
106
+ ============
107
+
108
+ py_neuromodulation requires at least python 3.10. For installation you can use pip:
109
+
110
+ .. code-block::
111
+
112
+ pip install py-neuromodulation
113
+
114
+
115
+ We recommend however installing the package using `rye <https://rye-up.com/guide/installation/>`_:
116
+
117
+ .. code-block::
118
+
119
+ git clone https://github.com/neuromodulation/py_neuromodulation.git
120
+ rye pin 3.11
121
+ rye sync
122
+
123
+ And then activating the virtual environment e.g. in Windows using:
124
+
125
+ .. code-block::
126
+
127
+ .\.venv\Scripts\activate
128
+
129
+ Alternatively you can also install the package in a conda environment:
130
+
131
+ conda create -n pynm-test python=3.11
132
+ conda activate pynm-test
133
+
134
+ Then install the packages listed in the `pyproject.toml`:
135
+
136
+ .. code-block::
137
+
138
+ pip install .
139
+
140
+
141
+ Optionally the ipython kernel can be specified for the installed pynm-test conda environment:
142
+
143
+ .. code-block::
144
+
145
+ ipython kernel install --user --name=pynm-test
146
+
147
+ Then *py_neuromodulation* can be imported via:
148
+
149
+ .. code-block::
150
+
151
+ import py_neuromodulation as nm
152
+
153
+ Basic Usage
154
+ ===========
155
+
156
+ .. code-block:: python
157
+
158
+ import py_neuromodulation as nm
159
+ import numpy as np
160
+
161
+ NUM_CHANNELS = 5
162
+ NUM_DATA = 10000
163
+ sfreq = 1000 # Hz
164
+ sampling_rate_features_hz = 3 # Hz
165
+
166
+ data = np.random.random([NUM_CHANNELS, NUM_DATA])
167
+
168
+ stream = nm.Stream(sfreq=sfreq, data=data, sampling_rate_features_hz=sampling_rate_features_hz)
169
+ features = stream.run()
170
+
171
+ Check the `Usage <https://py-neuromodulation.readthedocs.io/en/latest/usage.html>`_ and `First examples <https://py-neuromodulation.readthedocs.io/en/latest/auto_examples/plot_0_first_demo.html>`_ for further introduction.
172
+
173
+ Contact information
174
+ -------------------
175
+ For any question or suggestion please find my contact
176
+ information at `my GitHub profile <https://github.com/timonmerk>`_.
177
+
178
+ References
179
+ ----------
180
+
181
+ .. [1] Merk, T. et al. *Invasive neurophysiology and whole brain connectomics for neural decoding in patients with brain implants*, `https://doi.org/10.21203/rs.3.rs-3212709/v1` (2023).
182
+ .. [2] Merk, T. et al. *Electrocorticography is superior to subthalamic local field potentials for movement decoding in Parkinson’s disease*. Elife 11, e75126, `https://doi.org/10.7554/eLife.75126` (2022).
@@ -40,12 +40,24 @@ py_neuromodulation requires at least python 3.10. For installation you can use p
40
40
 
41
41
  pip install py-neuromodulation
42
42
 
43
- We recommend however installing the package in a new new conda environment:
43
+
44
+ We recommend however installing the package using `rye <https://rye-up.com/guide/installation/>`_:
44
45
 
45
46
  .. code-block::
46
47
 
47
48
  git clone https://github.com/neuromodulation/py_neuromodulation.git
48
- conda create -n pynm-test python=3.10
49
+ rye pin 3.11
50
+ rye sync
51
+
52
+ And then activating the virtual environment e.g. in Windows using:
53
+
54
+ .. code-block::
55
+
56
+ .\.venv\Scripts\activate
57
+
58
+ Alternatively you can also install the package in a conda environment:
59
+
60
+ conda create -n pynm-test python=3.11
49
61
  conda activate pynm-test
50
62
 
51
63
  Then install the packages listed in the `pyproject.toml`:
@@ -65,27 +77,27 @@ Then *py_neuromodulation* can be imported via:
65
77
 
66
78
  .. code-block::
67
79
 
68
- import py_neuromodulation as py_nm
80
+ import py_neuromodulation as nm
69
81
 
70
82
  Basic Usage
71
83
  ===========
72
84
 
73
85
  .. code-block:: python
74
86
 
75
- import py_neuromodulation as pn
87
+ import py_neuromodulation as nm
76
88
  import numpy as np
77
89
 
78
90
  NUM_CHANNELS = 5
79
91
  NUM_DATA = 10000
80
92
  sfreq = 1000 # Hz
81
- feature_freq = 3 # Hz
93
+ sampling_rate_features_hz = 3 # Hz
82
94
 
83
95
  data = np.random.random([NUM_CHANNELS, NUM_DATA])
84
96
 
85
- stream = pn.Stream(sfreq=sfreq, data=data, sampling_rate_features_hz=sampling_rate_features_hz)
97
+ stream = nm.Stream(sfreq=sfreq, data=data, sampling_rate_features_hz=sampling_rate_features_hz)
86
98
  features = stream.run()
87
99
 
88
- Check the `Usage <https://py-neuromodulation.readthedocs.io/en/latest/usage.html>`_ and `First examples <https://py-neuromodulation.readthedocs.io/en/latest/auto_examples/plot_first_demo.html>`_ for further introduction.
100
+ Check the `Usage <https://py-neuromodulation.readthedocs.io/en/latest/usage.html>`_ and `First examples <https://py-neuromodulation.readthedocs.io/en/latest/auto_examples/plot_0_first_demo.html>`_ for further introduction.
89
101
 
90
102
  Contact information
91
103
  -------------------
@@ -0,0 +1,68 @@
1
+ """
2
+ ===================
3
+ Adding New Features
4
+ ===================
5
+
6
+ """
7
+
8
+ import py_neuromodulation as pn
9
+ from py_neuromodulation import nm_features_abc
10
+ import numpy as np
11
+ from typing import Iterable
12
+
13
+ # %%
14
+ # In this example we will demonstrate how a new feature can be added to the existing feature pipeline.
15
+ # This can be done simply by adding an object of the inherited :class:`~nm_features_abc.Feature`
16
+ # class to the stream `stream.run_analysis.features.features` list.
17
+
18
+ data = np.random.random([1, 1000])
19
+
20
+ stream = pn.Stream(sfreq=1000, data=data, sampling_rate_features_hz=10, verbose=False,)
21
+
22
+ class NewFeature(nm_features_abc.Feature):
23
+
24
+ def __init__(
25
+ self, settings: dict, ch_names: Iterable[str], sfreq: float
26
+ ) -> None:
27
+ self.s = settings
28
+ self.ch_names = ch_names
29
+
30
+ def calc_feature(self, data: np.array, features_compute: dict) -> dict:
31
+ for ch_idx, ch in enumerate(self.ch_names):
32
+ features_compute[f"new_feature_{ch}"] = np.mean(data[ch_idx, :])
33
+
34
+ return features_compute
35
+
36
+ def test_settings():
37
+ pass
38
+
39
+ newFeature = NewFeature(stream.settings, list(stream.nm_channels["name"]), stream.sfreq)
40
+ stream.run_analysis.features.features.append(newFeature)
41
+
42
+ features = stream.run_analysis.process(data)
43
+ feature_name = f"new_feature_{stream.nm_channels['name'][0]}"
44
+
45
+ print(f"{feature_name}: {features[feature_name]}")
46
+
47
+ # %%
48
+ # This example shows a simple newly instantiated feature class called `NewFeature`.
49
+ # The instantiated `newFeature` object could then be added to the existing feature list by calling
50
+ # `stream.run_analysis.features.features.append(newFeature)`.
51
+ #
52
+ # To permanently add a novel feature, the new feature class needs to be added to
53
+ # the :class:`~nm_features` class. This can be done by inserting the feature_name in
54
+ # in the :class:`~nm_features.Feature` init function:
55
+ #
56
+ # .. code-block:: python
57
+ #
58
+ # for feature in s["features"]:
59
+ # if s["features"][feature] is False:
60
+ # continue
61
+ # match feature:
62
+ # case "new_feature":
63
+ # FeatureClass = nm_new_feature.NewFeature
64
+ # ...
65
+ #
66
+ # The new feature class can then be used by setting the `settings["feature"]["new_feature"]` value in the
67
+ # settings to true.
68
+ #