osl-ephys 2.0.0__py2.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 (107) hide show
  1. osl_ephys/__init__.py +40 -0
  2. osl_ephys/glm/README.md +3 -0
  3. osl_ephys/glm/__init__.py +6 -0
  4. osl_ephys/glm/glm_base.py +995 -0
  5. osl_ephys/glm/glm_epochs.py +386 -0
  6. osl_ephys/glm/glm_spectrum.py +1367 -0
  7. osl_ephys/maxfilter/README.md +141 -0
  8. osl_ephys/maxfilter/__init__.py +10 -0
  9. osl_ephys/maxfilter/maxfilter.py +775 -0
  10. osl_ephys/preprocessing/README.md +114 -0
  11. osl_ephys/preprocessing/__init__.py +10 -0
  12. osl_ephys/preprocessing/batch.py +1245 -0
  13. osl_ephys/preprocessing/ica_label.py +289 -0
  14. osl_ephys/preprocessing/mne_wrappers.py +831 -0
  15. osl_ephys/preprocessing/osl_wrappers.py +924 -0
  16. osl_ephys/preprocessing/plot_ica.py +1405 -0
  17. osl_ephys/report/README.md +31 -0
  18. osl_ephys/report/__init__.py +8 -0
  19. osl_ephys/report/preproc_report.py +1556 -0
  20. osl_ephys/report/src_report.py +499 -0
  21. osl_ephys/report/templates/raw_subject_panel.html +208 -0
  22. osl_ephys/report/templates/raw_summary_panel.html +89 -0
  23. osl_ephys/report/templates/src_subject_panel.html +142 -0
  24. osl_ephys/report/templates/src_summary_panel.html +129 -0
  25. osl_ephys/report/templates/subject_report.html +161 -0
  26. osl_ephys/report/templates/summary_report.html +92 -0
  27. osl_ephys/source_recon/README.md +3 -0
  28. osl_ephys/source_recon/__init__.py +6 -0
  29. osl_ephys/source_recon/batch.py +432 -0
  30. osl_ephys/source_recon/beamforming.py +1351 -0
  31. osl_ephys/source_recon/parcellation/__init__.py +6 -0
  32. osl_ephys/source_recon/parcellation/files/Glasser50_space-MNI152NLin6_res-8x8x8.nii.gz +0 -0
  33. osl_ephys/source_recon/parcellation/files/Glasser52_binary_space-MNI152NLin6_res-8x8x8.nii.gz +0 -0
  34. osl_ephys/source_recon/parcellation/files/HarvOxf-sub-Schaefer100-combined-2mm.nii.gz +0 -0
  35. osl_ephys/source_recon/parcellation/files/HarvOxf-sub-Schaefer100-combined-2mm_4d.nii.gz +0 -0
  36. osl_ephys/source_recon/parcellation/files/HarvOxf-sub-Schaefer100-combined-2mm_4d_ds8.nii.gz +0 -0
  37. osl_ephys/source_recon/parcellation/files/HarvardOxford-sub-prob-bin-2mm.nii.gz +0 -0
  38. osl_ephys/source_recon/parcellation/files/MNI152_T1_2mm_brain.nii.gz +0 -0
  39. osl_ephys/source_recon/parcellation/files/MNI152_T1_8mm_brain.nii.gz +0 -0
  40. osl_ephys/source_recon/parcellation/files/Schaefer2018_100Parcels_7Networks_order_FSLMNI152_2mm.nii.gz +0 -0
  41. osl_ephys/source_recon/parcellation/files/Schaefer2018_100Parcels_7Networks_order_FSLMNI152_2mm_4d.nii.gz +0 -0
  42. osl_ephys/source_recon/parcellation/files/Schaefer2018_100Parcels_7Networks_order_FSLMNI152_2mm_4d_ds8.nii.gz +0 -0
  43. osl_ephys/source_recon/parcellation/files/WTA_fMRI_parcellation_ds2mm.nii.gz +0 -0
  44. osl_ephys/source_recon/parcellation/files/WTA_fMRI_parcellation_ds8mm.nii.gz +0 -0
  45. osl_ephys/source_recon/parcellation/files/aal_cortical_merged_8mm_stacked.nii.gz +0 -0
  46. osl_ephys/source_recon/parcellation/files/dk_cortical.nii.gz +0 -0
  47. osl_ephys/source_recon/parcellation/files/dk_full.nii.gz +0 -0
  48. osl_ephys/source_recon/parcellation/files/fMRI_parcellation_ds2mm.nii.gz +0 -0
  49. osl_ephys/source_recon/parcellation/files/fMRI_parcellation_ds8mm.nii.gz +0 -0
  50. osl_ephys/source_recon/parcellation/files/fmri_d100_parcellation_with_PCC_reduced_2mm.nii.gz +0 -0
  51. osl_ephys/source_recon/parcellation/files/fmri_d100_parcellation_with_PCC_reduced_2mm_ss5mm_ds8mm.nii.gz +0 -0
  52. osl_ephys/source_recon/parcellation/files/fmri_d100_parcellation_with_PCC_tighterMay15_v2_2mm.nii.gz +0 -0
  53. osl_ephys/source_recon/parcellation/files/fmri_d100_parcellation_with_PCC_tighterMay15_v2_6mm_exclusive.nii.gz +0 -0
  54. osl_ephys/source_recon/parcellation/files/fmri_d100_parcellation_with_PCC_tighterMay15_v2_8mm.nii.gz +0 -0
  55. osl_ephys/source_recon/parcellation/files/giles_39_binary.nii.gz +0 -0
  56. osl_ephys/source_recon/parcellation/files/reduced_hcp-mmp_2mm.nii.gz +0 -0
  57. osl_ephys/source_recon/parcellation/files/reduced_hcp-mmp_8mm.nii.gz +0 -0
  58. osl_ephys/source_recon/parcellation/nii.py +131 -0
  59. osl_ephys/source_recon/parcellation/parcellation.py +980 -0
  60. osl_ephys/source_recon/rhino/__init__.py +10 -0
  61. osl_ephys/source_recon/rhino/coreg.py +1105 -0
  62. osl_ephys/source_recon/rhino/forward_model.py +325 -0
  63. osl_ephys/source_recon/rhino/fsl_utils.py +84 -0
  64. osl_ephys/source_recon/rhino/polhemus.py +466 -0
  65. osl_ephys/source_recon/rhino/surfaces.py +569 -0
  66. osl_ephys/source_recon/rhino/utils.py +1318 -0
  67. osl_ephys/source_recon/sign_flipping.py +380 -0
  68. osl_ephys/source_recon/wrappers.py +1073 -0
  69. osl_ephys/tests/__init__.py +0 -0
  70. osl_ephys/tests/test_00_package_canary.py +76 -0
  71. osl_ephys/tests/test_batch_api.py +75 -0
  72. osl_ephys/tests/test_batch_preproc.py +144 -0
  73. osl_ephys/tests/test_file_handling.py +196 -0
  74. osl_ephys/tests/test_glm.py +41 -0
  75. osl_ephys/tests/test_parallel.py +82 -0
  76. osl_ephys/utils/README.md +3 -0
  77. osl_ephys/utils/__init__.py +16 -0
  78. osl_ephys/utils/create_neuromag306_info.py +98 -0
  79. osl_ephys/utils/file_handling.py +217 -0
  80. osl_ephys/utils/logger.py +161 -0
  81. osl_ephys/utils/misc.py +30 -0
  82. osl_ephys/utils/neuromag306_info.yml +1548 -0
  83. osl_ephys/utils/opm.py +347 -0
  84. osl_ephys/utils/package.py +44 -0
  85. osl_ephys/utils/parallel.py +79 -0
  86. osl_ephys/utils/run_func.py +38 -0
  87. osl_ephys/utils/simulate.py +233 -0
  88. osl_ephys/utils/simulation_config/megin_template_info.fif +0 -0
  89. osl_ephys/utils/simulation_config/reduced_mvar_params_grad.npy +0 -0
  90. osl_ephys/utils/simulation_config/reduced_mvar_params_mag.npy +0 -0
  91. osl_ephys/utils/simulation_config/reduced_mvar_pcacomp_grad.npy +0 -0
  92. osl_ephys/utils/simulation_config/reduced_mvar_pcacomp_mag.npy +0 -0
  93. osl_ephys/utils/simulation_config/reduced_mvar_residcov_grad.npy +0 -0
  94. osl_ephys/utils/simulation_config/reduced_mvar_residcov_mag.npy +0 -0
  95. osl_ephys/utils/spmio/__init__.py +1 -0
  96. osl_ephys/utils/spmio/_data.py +132 -0
  97. osl_ephys/utils/spmio/_events.py +153 -0
  98. osl_ephys/utils/spmio/_spmmeeg_utils.py +19 -0
  99. osl_ephys/utils/spmio/spmmeeg.py +245 -0
  100. osl_ephys/utils/study.py +155 -0
  101. osl_ephys/utils/version_utils.py +64 -0
  102. osl_ephys-2.0.0.dist-info/LICENSE +23 -0
  103. osl_ephys-2.0.0.dist-info/METADATA +140 -0
  104. osl_ephys-2.0.0.dist-info/RECORD +107 -0
  105. osl_ephys-2.0.0.dist-info/WHEEL +6 -0
  106. osl_ephys-2.0.0.dist-info/entry_points.txt +6 -0
  107. osl_ephys-2.0.0.dist-info/top_level.txt +1 -0
osl_ephys/__init__.py ADDED
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/python
2
+
3
+ # --------------------------------------------------------
4
+ # If user hasn't configured NumExpr environment the an irritating low-level log
5
+ # is generated. We supress it by setting a default value of 8 if not already
6
+ # set.
7
+ #
8
+ # https://numexpr.readthedocs.io/projects/NumExpr3/en/latest/user_guide.html#threadpool-configuration
9
+ # https://github.com/pydata/numexpr/blob/7c2ef387d81cd450e8220fe4174cf46ec559994c/numexpr/utils.py#L118
10
+
11
+ import os
12
+ if 'NUMEXPR_MAX_THREADS' not in os.environ:
13
+ os.environ['NUMEXPR_MAX_THREADS'] = '8'
14
+
15
+ # Some modules are chatty by default when a logger is on - set log-levels to
16
+ # WARNING on setup
17
+ import logging
18
+ logging.getLogger("asyncio").setLevel(logging.WARNING)
19
+ logging.getLogger("matplotlib").setLevel(logging.WARNING)
20
+ logging.getLogger("PIL").setLevel(logging.WARNING)
21
+
22
+ # Feels like there should be a better solution for this. How do we setup a
23
+ # logger which only produces OSL outputs?!
24
+
25
+ # --------------------------------------------------------
26
+ # Main importing - set module structure here
27
+
28
+ from . import utils # noqa: F401, F403
29
+ from . import preprocessing # noqa: F401, F403
30
+ from . import maxfilter # noqa: F401, F403
31
+ from . import report # noqa: F401, F403
32
+ from . import source_recon # noqa: F401, F403
33
+ from . import glm # noqa: F401, F403
34
+
35
+ # --------------------------------------------------------
36
+ osl_logger = logging.getLogger(__name__)
37
+ osl_logger.debug('osl-ephys main init complete')
38
+
39
+ # --------------------------------------------------------
40
+ __version__ = '2.0.0'
@@ -0,0 +1,3 @@
1
+ # GLM
2
+
3
+ osl-ephys's GLM (generalized linear model) module, with modality specific functions based on https://pypi.org/project/glmtools/
@@ -0,0 +1,6 @@
1
+
2
+ from .glm_spectrum import *
3
+ from .glm_epochs import *
4
+
5
+ with open(os.path.join(os.path.dirname(__file__), "README.md"), 'r') as f:
6
+ __doc__ = f.read()