@brainpilot/skills 0.0.6
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.
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/package.json +35 -0
- package/skills/01_Meta-Skills/contribute-skill/SKILL.md +277 -0
- package/skills/01_Meta-Skills/contribute-skills-via-pr/SKILL.md +163 -0
- package/skills/01_Meta-Skills/paper-to-skill/SKILL.md +435 -0
- package/skills/01_Meta-Skills/paper-to-skill/references/extraction-guide.md +286 -0
- package/skills/01_Meta-Skills/paper-to-skill/references/skill-template.md +250 -0
- package/skills/01_Meta-Skills/repo-to-skill/SKILL.md +289 -0
- package/skills/01_Meta-Skills/share-case/SKILL.md +253 -0
- package/skills/01_Meta-Skills/share-usage/README.md +63 -0
- package/skills/01_Meta-Skills/share-usage/SKILL.md +395 -0
- package/skills/01_Meta-Skills/verify-skill/SKILL.md +331 -0
- package/skills/02_Cross-Domain_Foundation/cogsci-power-analysis/SKILL.md +194 -0
- package/skills/02_Cross-Domain_Foundation/cogsci-power-analysis/references/effect-sizes.md +352 -0
- package/skills/02_Cross-Domain_Foundation/cogsci-power-analysis/references/sample-size-guide.md +407 -0
- package/skills/02_Cross-Domain_Foundation/cogsci-statistics/SKILL.md +361 -0
- package/skills/02_Cross-Domain_Foundation/cogsci-statistics/references/common-analyses.md +517 -0
- package/skills/02_Cross-Domain_Foundation/cogsci-visualization/SKILL.md +292 -0
- package/skills/02_Cross-Domain_Foundation/cogsci-visualization/references/plot-recipes.md +709 -0
- package/skills/02_Cross-Domain_Foundation/research-literacy/SKILL.md +286 -0
- package/skills/02_Cross-Domain_Foundation/research-literacy/references/common-assumptions.md +320 -0
- package/skills/02_Cross-Domain_Foundation/research-literacy/references/planning-template.md +143 -0
- package/skills/03_Cognitive_Psychology/alternative-uses-task-designer/SKILL.md +197 -0
- package/skills/03_Cognitive_Psychology/alternative-uses-task-designer/references/instruction-templates.md +60 -0
- package/skills/03_Cognitive_Psychology/cognitive-paradigm-design/SKILL.md +246 -0
- package/skills/03_Cognitive_Psychology/cognitive-paradigm-design/references/classic-paradigms.md +435 -0
- package/skills/03_Cognitive_Psychology/cognitive-paradigm-design/references/design-principles.md +256 -0
- package/skills/03_Cognitive_Psychology/creativity-self-efficacy-mediation/SKILL.md +270 -0
- package/skills/03_Cognitive_Psychology/creativity-self-efficacy-mediation/references/lavaan-templates.md +172 -0
- package/skills/03_Cognitive_Psychology/divergent-thinking-scoring/SKILL.md +238 -0
- package/skills/03_Cognitive_Psychology/divergent-thinking-scoring/references/scoring-rubric.md +143 -0
- package/skills/03_Cognitive_Psychology/drift-diffusion-model/SKILL.md +203 -0
- package/skills/03_Cognitive_Psychology/drift-diffusion-model/references/fitting-guide.md +571 -0
- package/skills/03_Cognitive_Psychology/drift-diffusion-model/references/model-variants.md +427 -0
- package/skills/03_Cognitive_Psychology/evidence-accumulation-selector/SKILL.md +310 -0
- package/skills/03_Cognitive_Psychology/evidence-accumulation-selector/references/ez-diffusion-formulas.md +137 -0
- package/skills/03_Cognitive_Psychology/signal-detection-analysis/SKILL.md +300 -0
- package/skills/03_Cognitive_Psychology/signal-detection-analysis/references/application-guide.md +278 -0
- package/skills/03_Cognitive_Psychology/signal-detection-analysis/references/sdt-formulas.md +318 -0
- package/skills/03_Cognitive_Psychology/visual-search-array-generator/SKILL.md +283 -0
- package/skills/03_Cognitive_Psychology/visual-search-array-generator/references/array-generation-parameters.yaml +111 -0
- package/skills/04_Psycholinguistics/reading-time-analysis/SKILL.md +301 -0
- package/skills/04_Psycholinguistics/reading-time-analysis/references/measure-computation-guide.md +195 -0
- package/skills/04_Psycholinguistics/self-paced-reading-designer/SKILL.md +257 -0
- package/skills/04_Psycholinguistics/self-paced-reading-designer/references/analysis-guide.md +356 -0
- package/skills/04_Psycholinguistics/self-paced-reading-designer/references/region-segmentation.md +266 -0
- package/skills/04_Psycholinguistics/sentence-stimulus-norming/SKILL.md +346 -0
- package/skills/04_Psycholinguistics/sentence-stimulus-norming/references/lexical-databases-guide.md +184 -0
- package/skills/05_EEG_ERP/eeg-paradigm-designer/SKILL.md +226 -0
- package/skills/05_EEG_ERP/eeg-paradigm-designer/references/component-paradigm-map.md +276 -0
- package/skills/05_EEG_ERP/eeg-paradigm-designer/references/timing-parameters.md +244 -0
- package/skills/05_EEG_ERP/eeg-preprocessing-pipeline-guide/SKILL.md +367 -0
- package/skills/05_EEG_ERP/eeg-preprocessing-pipeline-guide/references/parameter-lookup-tables.md +138 -0
- package/skills/05_EEG_ERP/erp-analysis/SKILL.md +185 -0
- package/skills/05_EEG_ERP/erp-analysis/references/erp-components.md +447 -0
- package/skills/05_EEG_ERP/erp-analysis/references/preprocessing-pipeline.md +277 -0
- package/skills/05_EEG_ERP/erp-analysis/references/statistical-approaches.md +351 -0
- package/skills/05_EEG_ERP/mne-python-guide/SKILL.md +174 -0
- package/skills/05_EEG_ERP/mne-python-guide/references/decoding.md +178 -0
- package/skills/05_EEG_ERP/mne-python-guide/references/io_formats.md +160 -0
- package/skills/05_EEG_ERP/mne-python-guide/references/preprocessing.md +259 -0
- package/skills/05_EEG_ERP/mne-python-guide/references/simulation.md +173 -0
- package/skills/05_EEG_ERP/mne-python-guide/references/source_localization.md +234 -0
- package/skills/05_EEG_ERP/mne-python-guide/references/statistics.md +196 -0
- package/skills/05_EEG_ERP/mne-python-guide/references/time_frequency.md +165 -0
- package/skills/05_EEG_ERP/mne-python-guide/references/visualization.md +175 -0
- package/skills/06_fMRI_Neuroimaging/brain-connectivity-modeler/SKILL.md +317 -0
- package/skills/06_fMRI_Neuroimaging/brain-connectivity-modeler/references/method-implementation-guide.md +116 -0
- package/skills/06_fMRI_Neuroimaging/fmri-glm-analysis-guide/SKILL.md +296 -0
- package/skills/06_fMRI_Neuroimaging/fmri-glm-analysis-guide/references/design-matrix-guide.md +214 -0
- package/skills/06_fMRI_Neuroimaging/fmri-glm-analysis-guide/references/statistical-inference.md +288 -0
- package/skills/06_fMRI_Neuroimaging/fmri-preprocessing-pipeline-guide/SKILL.md +274 -0
- package/skills/06_fMRI_Neuroimaging/fmri-preprocessing-pipeline-guide/references/quality-control.md +336 -0
- package/skills/06_fMRI_Neuroimaging/fmri-preprocessing-pipeline-guide/references/step-by-step-pipeline.md +380 -0
- package/skills/06_fMRI_Neuroimaging/fmri-task-design-guide/SKILL.md +264 -0
- package/skills/06_fMRI_Neuroimaging/fmri-task-design-guide/references/design-optimization-examples.md +114 -0
- package/skills/06_fMRI_Neuroimaging/neural-decoding-analysis/SKILL.md +273 -0
- package/skills/06_fMRI_Neuroimaging/neural-decoding-analysis/references/decoding-methods.md +170 -0
- package/skills/06_fMRI_Neuroimaging/neural-decoding-analysis/references/rsa-guide.md +266 -0
- package/skills/06_fMRI_Neuroimaging/pycortex-guide/SKILL.md +123 -0
- package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/database-subjects.md +179 -0
- package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/dataset-types.md +208 -0
- package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/freesurfer-fmriprep.md +162 -0
- package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/mapping-transforms.md +181 -0
- package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/mni-utils.md +207 -0
- package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/surface-analysis.md +219 -0
- package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/visualization.md +251 -0
- package/skills/07_Computational_Modeling/act-r-model-builder/SKILL.md +297 -0
- package/skills/07_Computational_Modeling/act-r-model-builder/references/model-patterns.md +197 -0
- package/skills/07_Computational_Modeling/act-r-model-builder/references/parameter-table.yaml +204 -0
- package/skills/07_Computational_Modeling/bayesian-cognitive-model-builder/SKILL.md +294 -0
- package/skills/07_Computational_Modeling/bayesian-cognitive-model-builder/references/diagnostics-checklist.md +351 -0
- package/skills/07_Computational_Modeling/bayesian-cognitive-model-builder/references/prior-selection-guide.md +241 -0
- package/skills/07_Computational_Modeling/parameter-recovery-checker/SKILL.md +269 -0
- package/skills/07_Computational_Modeling/parameter-recovery-checker/references/recovery-diagnostics.md +207 -0
- package/skills/08_Computational_Neuroscience/brain-connectivity-modeler/SKILL.md +317 -0
- package/skills/08_Computational_Neuroscience/brain-connectivity-modeler/references/method-implementation-guide.md +116 -0
- package/skills/08_Computational_Neuroscience/neural-decoding-analysis/SKILL.md +273 -0
- package/skills/08_Computational_Neuroscience/neural-decoding-analysis/references/decoding-methods.md +170 -0
- package/skills/08_Computational_Neuroscience/neural-decoding-analysis/references/rsa-guide.md +266 -0
- package/skills/08_Computational_Neuroscience/neural-population-analysis-guide/SKILL.md +305 -0
- package/skills/08_Computational_Neuroscience/neural-population-analysis-guide/references/data-requirements.md +60 -0
- package/skills/08_Computational_Neuroscience/neural-population-analysis-guide/references/method-comparison.md +151 -0
- package/skills/08_Computational_Neuroscience/spiking-network-model-builder/SKILL.md +376 -0
- package/skills/08_Computational_Neuroscience/spiking-network-model-builder/references/hh-parameters.md +117 -0
- package/skills/08_Computational_Neuroscience/spiking-network-model-builder/references/network-regimes.md +130 -0
- package/skills/09_Cellular_Molecular_Neuroscience/calcium-imaging-analysis-guide/SKILL.md +258 -0
- package/skills/09_Cellular_Molecular_Neuroscience/calcium-imaging-analysis-guide/references/indicator-parameters.md +242 -0
- package/skills/09_Cellular_Molecular_Neuroscience/calcium-imaging-analysis-guide/references/pipeline-details.md +211 -0
- package/skills/09_Cellular_Molecular_Neuroscience/optogenetics-protocol-designer/SKILL.md +261 -0
- package/skills/09_Cellular_Molecular_Neuroscience/optogenetics-protocol-designer/references/opsin-catalog.md +124 -0
- package/skills/09_Cellular_Molecular_Neuroscience/optogenetics-protocol-designer/references/stimulation-parameters.md +304 -0
- package/skills/10_Clinical_Neuropsychology/lesion-symptom-mapping-guide/SKILL.md +367 -0
- package/skills/10_Clinical_Neuropsychology/lesion-symptom-mapping-guide/references/disconnection-guide.md +152 -0
- package/skills/10_Clinical_Neuropsychology/lesion-symptom-mapping-guide/references/vlsm-pipeline.md +182 -0
- package/skills/10_Clinical_Neuropsychology/neuropsych-battery-selector/SKILL.md +250 -0
- package/skills/10_Clinical_Neuropsychology/neuropsych-battery-selector/references/deficit-profiles.md +302 -0
- package/skills/10_Clinical_Neuropsychology/neuropsych-battery-selector/references/test-catalog.md +304 -0
- package/skills/11_Developmental_Cognition/infant-looking-time-designer/SKILL.md +345 -0
- package/skills/11_Developmental_Cognition/infant-looking-time-designer/references/age-parameters.yaml +186 -0
- package/skills/12_Social_Cognition/tom-task-selector/SKILL.md +379 -0
- package/skills/12_Social_Cognition/tom-task-selector/references/task-database.md +317 -0
- package/skills/13_Visualization/nature-figure/README.md +442 -0
- package/skills/13_Visualization/nature-figure/SKILL.md +60 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-01-bar-charts.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-02-line-trends.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-03-heatmaps.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-04-scatter-bubble.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-05-radar-polar.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-06-distributions.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-07-forest-interval.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-08-area-stacked.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-09-image-plates.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-10-network-matrix.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/Dispersion_motivation.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/Dispersion_observation.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/Dispersion_observation_distillation.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/ImmunoStruct_contrastive.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/ImmunoStruct_results_CEDAR.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/ImmunoStruct_results_IEDB.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/ImmunoStruct_schematic.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/RNAGenScape_schematic.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_CellSpliceNet/figures/ablation.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_CellSpliceNet/figures/comparison.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_CellSpliceNet/plot_ablation.py +86 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_CellSpliceNet/plot_comparison.py +109 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/diffusion_swiss_roll.py +97 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/diffusion_swiss_roll.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/fig2_comparison_GeneRegulatory.pdf +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/fig2_comparison_GeneRegulatory.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/fig2_comparison_Trajectory.pdf +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/fig2_comparison_Trajectory.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/figX_comparison_Ablation.pdf +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/figX_comparison_Ablation.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/plot_comparison_Ablation.py +64 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/plot_comparison_GeneRegulatory.py +74 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/plot_comparison_Trajectory.py +74 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Dispersion/figures/idea.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Dispersion/figures/illustration.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Dispersion/plot_idea.py +76 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Dispersion/plot_illustration.py +404 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_FPGM/figures/freq_prior.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_FPGM/plot_freq_prior.py +146 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/figures/bars_ablation_Cancer.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/figures/bars_ablation_IEDB.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/figures/bars_comparison_Cancer.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/figures/bars_comparison_IEDB.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/plot_bars.py +216 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/raw_data.py +125 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/figures/manifold.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/figures/manifold_holes.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/figures/results_comparison_optimization.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/figures/results_comparison_speed.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/figures/results_sweep.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/plot_comparison.py +228 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/plot_hole_manifold.py +82 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/plot_manifold.py +61 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/plot_sweep.py +77 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_VIGIL/figures/comparison_posttraining.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_VIGIL/figures/comparison_radar.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_VIGIL/plot_comparison_radar.py +173 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_VIGIL/plot_posttraining.py +82 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/figures/brute_force.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/figures/correctness_by_category.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/figures/correctness_by_subcategory.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/figures/rewriting.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/figures/selfcorrection_math.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/plot_brute_force.py +248 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/plot_correctness_by_category.py +132 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/plot_correctness_by_subcategory.py +131 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/plot_rewriting.py +105 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/plot_selfcorrection_math.py +99 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ophthal_review/figures/composition_heatmap.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ophthal_review/figures/trend_by_month.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ophthal_review/plot_composition.py +81 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ophthal_review/plot_trend.py +125 -0
- package/skills/13_Visualization/nature-figure/assets/gallery/fig1-material-mechanism-rich.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/gallery/fig2-spatial-imaging-rich.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/gallery/fig3-in-vivo-efficacy-rich.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/gallery/fig4-single-cell-systems-rich.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/gallery/fig5-validation-perturbation-rich.png +0 -0
- package/skills/13_Visualization/nature-figure/evals/evals.json +37 -0
- package/skills/13_Visualization/nature-figure/manifest.yaml +57 -0
- package/skills/13_Visualization/nature-figure/references/api.md +428 -0
- package/skills/13_Visualization/nature-figure/references/backend-selection.md +100 -0
- package/skills/13_Visualization/nature-figure/references/chart-types.md +281 -0
- package/skills/13_Visualization/nature-figure/references/common-patterns.md +350 -0
- package/skills/13_Visualization/nature-figure/references/demos.md +65 -0
- package/skills/13_Visualization/nature-figure/references/design-theory.md +436 -0
- package/skills/13_Visualization/nature-figure/references/figure-contract.md +93 -0
- package/skills/13_Visualization/nature-figure/references/nature-2026-observations.md +112 -0
- package/skills/13_Visualization/nature-figure/references/qa-contract.md +119 -0
- package/skills/13_Visualization/nature-figure/references/r-template-index.md +66 -0
- package/skills/13_Visualization/nature-figure/references/r-workflow.md +161 -0
- package/skills/13_Visualization/nature-figure/references/tutorials.md +251 -0
- package/skills/13_Visualization/nature-figure/static/core/contract.md +29 -0
- package/skills/13_Visualization/nature-figure/static/core/stance.md +37 -0
- package/skills/13_Visualization/nature-figure/static/fragments/backend/python.md +37 -0
- package/skills/13_Visualization/nature-figure/static/fragments/backend/r.md +44 -0
- package/skills/14_Writing/markdown-report-writing/SKILL.md +306 -0
- package/skills/14_Writing/markdown-report-writing/references/compatibility-matrix.md +72 -0
- package/skills/14_Writing/markdown-report-writing/references/templates.md +299 -0
- package/skills/15_Others/neuroimaging-power-guide/SKILL.md +324 -0
- package/skills/15_Others/neuroimaging-power-guide/references/effect-size-lookup-tables.md +102 -0
- package/skills/15_Others/neuroimaging-sample-size-calculator/SKILL.md +330 -0
- package/skills/15_Others/neuroimaging-sample-size-calculator/references/worked-examples.md +220 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "mne-python-guide"
|
|
3
|
+
description: "Domain-validated pipeline guidance for EEG/MEG data analysis using MNE-Python: data loading, preprocessing (filtering, ICA, re-referencing), epoching, ERP/ERF computation, time-frequency decomposition, source localization, decoding/MVPA, statistical testing, simulation, and visualization. Use this skill whenever the user works with EEG/MEG/sEEG/ECoG/NIRS/eye-tracking data in Python, mentions MNE, or needs neurophysiological analysis guidance."
|
|
4
|
+
domain: "neuroimaging-methods"
|
|
5
|
+
version: "2.0.0"
|
|
6
|
+
authors:
|
|
7
|
+
- "Claude (AI-assisted)"
|
|
8
|
+
papers:
|
|
9
|
+
- "Gramfort et al., 2013"
|
|
10
|
+
- "Gramfort et al., 2014"
|
|
11
|
+
- "Luck, 2014"
|
|
12
|
+
- "Jas et al., 2018"
|
|
13
|
+
- "Dale et al., 2000"
|
|
14
|
+
- "Pascual-Marqui, 2002"
|
|
15
|
+
- "Tallon-Baudry et al., 1997"
|
|
16
|
+
- "Maris & Oostenveld, 2007"
|
|
17
|
+
- "Blankertz et al., 2008"
|
|
18
|
+
- "King & Dehaene, 2014"
|
|
19
|
+
dependencies:
|
|
20
|
+
required:
|
|
21
|
+
- research-literacy
|
|
22
|
+
review_status: "ai-generated"
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
# MNE-Python Analysis Guide
|
|
26
|
+
|
|
27
|
+
## Purpose
|
|
28
|
+
|
|
29
|
+
This skill encodes expert methodological knowledge for analyzing neurophysiological data (EEG, MEG, sEEG, ECoG, NIRS, eye-tracking) using MNE-Python (Gramfort et al., 2013; Gramfort et al., 2014). It covers the complete analysis pipeline with recommended parameters, code examples, and common pitfall warnings.
|
|
30
|
+
|
|
31
|
+
## When to Use This Skill
|
|
32
|
+
|
|
33
|
+
Activate when the user:
|
|
34
|
+
- Asks about EEG/MEG/sEEG/ECoG/NIRS data analysis in Python
|
|
35
|
+
- Mentions MNE, MNE-Python, epochs, evoked, Raw, source estimate, ICA, ERP, ERF
|
|
36
|
+
- Wants to load neurophysiological data files (.fif, .edf, .bdf, .set, .vhdr, .mff, .cnt, .snirf)
|
|
37
|
+
- Needs preprocessing, time-frequency, source localization, decoding, or statistical testing guidance
|
|
38
|
+
- Wants to create MNE objects from numpy arrays or simulate data
|
|
39
|
+
|
|
40
|
+
## Research Planning Protocol
|
|
41
|
+
|
|
42
|
+
1. **State the research question** — What is the user investigating?
|
|
43
|
+
2. **Justify the method choice** — Confirm MNE-Python fits their data type and goal.
|
|
44
|
+
3. **Declare expected outcomes** — What output format? (ERP plots, TFR maps, source maps, decoding accuracy)
|
|
45
|
+
4. **Note assumptions and limitations** — Data quality, sample size, MRI availability, montage info.
|
|
46
|
+
5. **Present the plan and WAIT for confirmation** before writing code.
|
|
47
|
+
|
|
48
|
+
## Verification Notice
|
|
49
|
+
|
|
50
|
+
> This skill was generated by AI from MNE-Python source code and academic literature. All parameters, thresholds, and citations require independent verification. If you find errors, please open an issue at https://github.com/NeuroAIHub/awesome_cognitive_and_neuroscience_skills/issues.
|
|
51
|
+
|
|
52
|
+
## Reference Files (Progressive Disclosure)
|
|
53
|
+
|
|
54
|
+
This skill uses layered references. Read the relevant file when the user's question goes deeper than the overview below:
|
|
55
|
+
|
|
56
|
+
| Topic | Reference File | When to Read |
|
|
57
|
+
|-------|---------------|--------------|
|
|
58
|
+
| Data I/O (30+ formats) | `references/io_formats.md` | User asks about loading specific file formats, creating objects from arrays, or exporting |
|
|
59
|
+
| Preprocessing | `references/preprocessing.md` | User needs ICA details, Maxwell filtering, artifact annotation, bad channel detection, CSD, fNIRS/iEEG-specific preprocessing |
|
|
60
|
+
| Time-Frequency | `references/time_frequency.md` | User asks about TFR methods, PSD, CSD, baseline modes, array-level functions |
|
|
61
|
+
| Source Localization | `references/source_localization.md` | User needs forward modeling, inverse methods, beamformers, dipole fitting details |
|
|
62
|
+
| Decoding & MVPA | `references/decoding.md` | User asks about classification, temporal generalization, CSP, SPoC, receptive fields |
|
|
63
|
+
| Statistics | `references/statistics.md` | User needs cluster permutation, TFCE, ANOVA, adjacency matrices, correction methods |
|
|
64
|
+
| Visualization | `references/visualization.md` | User asks about plotting functions, publication figures, 3D brain rendering |
|
|
65
|
+
| Simulation | `references/simulation.md` | User wants to create synthetic data, simulate sources, add artifacts |
|
|
66
|
+
|
|
67
|
+
## Pipeline Overview
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
Raw → Mark bad channels → Filter → ICA → Re-reference → Resample
|
|
71
|
+
→ Epochs → Evoked (ERP/ERF)
|
|
72
|
+
→ Time-Frequency (TFR/PSD)
|
|
73
|
+
→ Source Localization (MNE/dSPM/LCMV)
|
|
74
|
+
→ Decoding (MVPA)
|
|
75
|
+
→ Statistics (cluster permutation)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Core Data Structures
|
|
79
|
+
|
|
80
|
+
| Object | Description | Create from |
|
|
81
|
+
|--------|-------------|-------------|
|
|
82
|
+
| `Raw` | Continuous data | `mne.io.read_raw_*()` or `mne.io.RawArray(data, info)` |
|
|
83
|
+
| `Epochs` | Event-segmented data | `mne.Epochs(raw, events, ...)` or `mne.EpochsArray(data, info)` |
|
|
84
|
+
| `Evoked` | Averaged epochs | `epochs.average()` or `mne.EvokedArray(data, info)` |
|
|
85
|
+
| `SourceEstimate` | Brain-mapped activity | `apply_inverse(evoked, inv, ...)` |
|
|
86
|
+
| `Spectrum` | Power spectrum | `raw.compute_psd()` or `epochs.compute_psd()` |
|
|
87
|
+
| `AverageTFR` | Time-frequency map | `epochs.compute_tfr(method, freqs, ...)` |
|
|
88
|
+
|
|
89
|
+
All objects carry an `info` attribute (`mne.Info`) with channel metadata that propagates through the pipeline.
|
|
90
|
+
|
|
91
|
+
## Quick Start Pipeline
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
import mne
|
|
95
|
+
import numpy as np
|
|
96
|
+
|
|
97
|
+
# 1. Load
|
|
98
|
+
raw = mne.io.read_raw_fif('data_raw.fif', preload=True)
|
|
99
|
+
# or: raw = mne.io.read_raw_edf('data.edf', preload=True)
|
|
100
|
+
|
|
101
|
+
# 2. Preprocess
|
|
102
|
+
raw.filter(l_freq=0.1, h_freq=40.) # bandpass
|
|
103
|
+
raw.notch_filter(freqs=[50, 100]) # line noise
|
|
104
|
+
ica = mne.preprocessing.ICA(n_components=20, random_state=97, max_iter=800)
|
|
105
|
+
ica.fit(raw.copy().filter(l_freq=1., h_freq=None)) # fit on 1 Hz highpass copy
|
|
106
|
+
eog_idx, _ = ica.find_bads_eog(raw)
|
|
107
|
+
ica.exclude = eog_idx
|
|
108
|
+
ica.apply(raw)
|
|
109
|
+
raw.set_eeg_reference('average')
|
|
110
|
+
|
|
111
|
+
# 3. Epoch
|
|
112
|
+
events, event_id = mne.events_from_annotations(raw)
|
|
113
|
+
epochs = mne.Epochs(raw, events, event_id, tmin=-0.2, tmax=0.5,
|
|
114
|
+
baseline=(None, 0), preload=True,
|
|
115
|
+
reject=dict(eeg=150e-6))
|
|
116
|
+
|
|
117
|
+
# 4. ERP
|
|
118
|
+
evoked = epochs['target'].average()
|
|
119
|
+
evoked.plot_joint()
|
|
120
|
+
|
|
121
|
+
# 5. Time-frequency
|
|
122
|
+
freqs = np.arange(4, 30, 2)
|
|
123
|
+
power = epochs.compute_tfr(method="morlet", freqs=freqs, n_cycles=freqs / 2.)
|
|
124
|
+
power.plot()
|
|
125
|
+
|
|
126
|
+
# 6. Source localization (requires anatomy)
|
|
127
|
+
noise_cov = mne.compute_covariance(epochs, tmax=0., method='auto')
|
|
128
|
+
fwd = mne.read_forward_solution('sample-fwd.fif')
|
|
129
|
+
inv = mne.minimum_norm.make_inverse_operator(epochs.info, fwd, noise_cov)
|
|
130
|
+
stc = mne.minimum_norm.apply_inverse(evoked, inv, lambda2=1./9., method='dSPM')
|
|
131
|
+
|
|
132
|
+
# 7. Decoding
|
|
133
|
+
from mne.decoding import SlidingEstimator, cross_val_multiscore
|
|
134
|
+
from sklearn.linear_model import LogisticRegression
|
|
135
|
+
from sklearn.pipeline import make_pipeline
|
|
136
|
+
from sklearn.preprocessing import StandardScaler
|
|
137
|
+
X = epochs.get_data(copy=True)
|
|
138
|
+
y = epochs.events[:, -1]
|
|
139
|
+
clf = make_pipeline(StandardScaler(), LogisticRegression(solver='liblinear'))
|
|
140
|
+
slider = SlidingEstimator(clf, scoring='roc_auc')
|
|
141
|
+
scores = cross_val_multiscore(slider, X, y, cv=5)
|
|
142
|
+
|
|
143
|
+
# 8. Statistics
|
|
144
|
+
from mne.stats import spatio_temporal_cluster_test
|
|
145
|
+
adjacency, _ = mne.channels.find_ch_adjacency(epochs.info, 'eeg')
|
|
146
|
+
T_obs, clusters, p_values, H0 = spatio_temporal_cluster_test(
|
|
147
|
+
[X_cond1, X_cond2], adjacency=adjacency, n_permutations=1000)
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Common Pitfalls
|
|
151
|
+
|
|
152
|
+
1. **ICA on unfiltered data** — Highpass ≥1 Hz before ICA fitting; slow drifts degrade decomposition (Jas et al., 2018)
|
|
153
|
+
2. **Baseline correction before ICA** — Apply baseline after ICA, not before
|
|
154
|
+
3. **Filtering after epoching** — Filter Raw, not Epochs, to avoid edge artifacts (Luck, 2014)
|
|
155
|
+
4. **Wrong rejection thresholds** — Start with EEG 100–150 µV, adjust via `epochs.plot_drop_log()`
|
|
156
|
+
5. **Forgetting `preload=True`** — Many operations require data in memory
|
|
157
|
+
6. **Re-referencing timing** — Set reference after ICA but before epoching
|
|
158
|
+
7. **Events after resampling** — Recompute events after downsampling, or resample Epochs directly
|
|
159
|
+
8. **Legacy API** — Use `epochs.compute_tfr()` / `raw.compute_psd()` instead of deprecated `tfr_morlet()` / `psd_welch()`
|
|
160
|
+
9. **Decoding data leakage** — Always cross-validate; never fit scaler on test data
|
|
161
|
+
10. **Cluster test interpretation** — Clusters show where effects exist, not their spatial/temporal extent (Maris & Oostenveld, 2007)
|
|
162
|
+
|
|
163
|
+
## References
|
|
164
|
+
|
|
165
|
+
- Blankertz, B., et al. (2008). Optimizing spatial filters for robust EEG single-trial analysis. *IEEE Signal Processing Magazine*, 25(1), 41–56.
|
|
166
|
+
- Dale, A. M., et al. (2000). Dynamic statistical parametric mapping. *Neuron*, 26(1), 55–67.
|
|
167
|
+
- Gramfort, A., et al. (2013). MEG and EEG data analysis with MNE-Python. *Frontiers in Neuroscience*, 7, 267.
|
|
168
|
+
- Gramfort, A., et al. (2014). MNE software for processing MEG and EEG data. *NeuroImage*, 86, 446–460.
|
|
169
|
+
- Jas, M., et al. (2018). Autoreject: Automated artifact rejection for MEG and EEG data. *NeuroImage*, 159, 417–429.
|
|
170
|
+
- King, J.-R., & Dehaene, S. (2014). Characterizing the dynamics of mental representations. *Trends in Cognitive Sciences*, 18(4), 203–210.
|
|
171
|
+
- Luck, S. J. (2014). *An Introduction to the Event-Related Potential Technique*. MIT Press.
|
|
172
|
+
- Maris, E., & Oostenveld, R. (2007). Nonparametric statistical testing of EEG- and MEG-data. *Journal of Neuroscience Methods*, 164(1), 177–190.
|
|
173
|
+
- Pascual-Marqui, R. D. (2002). Standardized low-resolution brain electromagnetic tomography. *Methods and Findings in Experimental and Clinical Pharmacology*, 24(Suppl D), 5–12.
|
|
174
|
+
- Tallon-Baudry, C., et al. (1997). Oscillatory gamma-band activity induced by a visual search task. *Journal of Neuroscience*, 17(2), 722–734.
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
# Decoding & MVPA Reference
|
|
2
|
+
|
|
3
|
+
## Table of Contents
|
|
4
|
+
1. [MNE Transformers](#transformers)
|
|
5
|
+
2. [Temporal Decoding](#temporal-decoding)
|
|
6
|
+
3. [Temporal Generalization](#temporal-generalization)
|
|
7
|
+
4. [CSP (Common Spatial Patterns)](#csp)
|
|
8
|
+
5. [SPoC, SSD, Xdawn](#spoc-ssd-xdawn)
|
|
9
|
+
6. [Receptive Field Estimation](#receptive-field)
|
|
10
|
+
7. [Source-Space Decoding](#source-decoding)
|
|
11
|
+
8. [Utility Functions](#utilities)
|
|
12
|
+
|
|
13
|
+
## MNE Transformers (sklearn-compatible)
|
|
14
|
+
|
|
15
|
+
| Transformer | Purpose |
|
|
16
|
+
|-------------|---------|
|
|
17
|
+
| `Scaler(info, scalings='mean')` | Channel-type-aware standardization |
|
|
18
|
+
| `Vectorizer()` | Reshape (n_epochs, n_ch, n_times) → (n_epochs, n_features) |
|
|
19
|
+
| `FilterEstimator(info, l_freq, h_freq)` | Temporal filtering in pipeline |
|
|
20
|
+
| `TemporalFilter(l_freq, h_freq)` | Temporal filtering (no info needed) |
|
|
21
|
+
| `PSDEstimator(sfreq, fmin, fmax)` | PSD features |
|
|
22
|
+
| `TimeFrequency(freqs, sfreq)` | TFR features |
|
|
23
|
+
| `UnsupervisedSpatialFilter(PCA(10))` | Spatial PCA/ICA |
|
|
24
|
+
| `LinearModel(LogisticRegression())` | Wrapper for pattern extraction |
|
|
25
|
+
|
|
26
|
+
## Temporal Decoding
|
|
27
|
+
|
|
28
|
+
Fit a classifier at each time point independently (King & Dehaene, 2014):
|
|
29
|
+
|
|
30
|
+
```python
|
|
31
|
+
from mne.decoding import SlidingEstimator, cross_val_multiscore
|
|
32
|
+
from sklearn.linear_model import LogisticRegression
|
|
33
|
+
from sklearn.pipeline import make_pipeline
|
|
34
|
+
from sklearn.preprocessing import StandardScaler
|
|
35
|
+
|
|
36
|
+
X = epochs.get_data(copy=True) # (n_epochs, n_channels, n_times)
|
|
37
|
+
y = epochs.events[:, -1]
|
|
38
|
+
|
|
39
|
+
clf = make_pipeline(StandardScaler(), LogisticRegression(solver='liblinear'))
|
|
40
|
+
slider = SlidingEstimator(clf, scoring='roc_auc', n_jobs=-1)
|
|
41
|
+
scores = cross_val_multiscore(slider, X, y, cv=5)
|
|
42
|
+
# scores shape: (n_folds, n_times)
|
|
43
|
+
|
|
44
|
+
# Plot
|
|
45
|
+
import matplotlib.pyplot as plt
|
|
46
|
+
fig, ax = plt.subplots()
|
|
47
|
+
ax.plot(epochs.times, scores.mean(axis=0))
|
|
48
|
+
ax.axhline(0.5, color='k', linestyle='--')
|
|
49
|
+
ax.set(xlabel='Time (s)', ylabel='AUC', title='Temporal Decoding')
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Temporal Generalization
|
|
53
|
+
|
|
54
|
+
Train at each time, test at all times — reveals dynamics of neural representations:
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
from mne.decoding import GeneralizingEstimator
|
|
58
|
+
|
|
59
|
+
gen = GeneralizingEstimator(clf, scoring='roc_auc', n_jobs=-1)
|
|
60
|
+
scores = cross_val_multiscore(gen, X, y, cv=5)
|
|
61
|
+
# scores shape: (n_folds, n_train_times, n_test_times)
|
|
62
|
+
|
|
63
|
+
# Plot generalization matrix
|
|
64
|
+
fig, ax = plt.subplots()
|
|
65
|
+
im = ax.imshow(scores.mean(axis=0), origin='lower', cmap='RdBu_r',
|
|
66
|
+
extent=epochs.times[[0, -1, 0, -1]], vmin=0.3, vmax=0.7)
|
|
67
|
+
ax.set(xlabel='Test time (s)', ylabel='Train time (s)')
|
|
68
|
+
ax.axhline(0, color='k'); ax.axvline(0, color='k')
|
|
69
|
+
plt.colorbar(im, ax=ax, label='AUC')
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## CSP
|
|
73
|
+
|
|
74
|
+
Common Spatial Patterns for two-class discrimination (Blankertz et al., 2008):
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
from mne.decoding import CSP
|
|
78
|
+
|
|
79
|
+
csp = CSP(n_components=4, reg=None, log=True, norm_trace=False)
|
|
80
|
+
clf = make_pipeline(csp, LogisticRegression(solver='liblinear'))
|
|
81
|
+
scores = cross_val_multiscore(clf, X, y, cv=5)
|
|
82
|
+
|
|
83
|
+
# Visualize spatial patterns and filters
|
|
84
|
+
csp.fit(X, y)
|
|
85
|
+
csp.plot_patterns(epochs.info) # neurophysiologically interpretable
|
|
86
|
+
csp.plot_filters(epochs.info) # spatial filters applied to data
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## SPoC, SSD, Xdawn
|
|
90
|
+
|
|
91
|
+
### SPoC (Source Power Comodulation)
|
|
92
|
+
For continuous target variables (not classification):
|
|
93
|
+
```python
|
|
94
|
+
from mne.decoding import SPoC
|
|
95
|
+
from sklearn.linear_model import Ridge
|
|
96
|
+
|
|
97
|
+
spoc = SPoC(n_components=2, reg='oas', log=True)
|
|
98
|
+
clf = make_pipeline(spoc, Ridge())
|
|
99
|
+
# Use with continuous y (e.g., reaction time, behavioral score)
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### SSD (Spatio-Spectral Decomposition)
|
|
103
|
+
Maximize signal in target band vs flanking bands:
|
|
104
|
+
```python
|
|
105
|
+
from mne.decoding import SSD
|
|
106
|
+
|
|
107
|
+
ssd = SSD(info, filt_params_signal=dict(l_freq=8, h_freq=12),
|
|
108
|
+
filt_params_noise=dict(l_freq=6, h_freq=14))
|
|
109
|
+
ssd.fit(X)
|
|
110
|
+
X_ssd = ssd.transform(X)
|
|
111
|
+
ssd.plot_patterns(info)
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Xdawn
|
|
115
|
+
Enhance ERP signal for P300/BCI applications:
|
|
116
|
+
```python
|
|
117
|
+
from mne.decoding import XdawnTransformer
|
|
118
|
+
|
|
119
|
+
xdawn = XdawnTransformer(n_components=2)
|
|
120
|
+
clf = make_pipeline(xdawn, Vectorizer(), LogisticRegression())
|
|
121
|
+
scores = cross_val_multiscore(clf, X, y, cv=5)
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Receptive Field Estimation
|
|
125
|
+
|
|
126
|
+
Spectro-temporal receptive field (STRF) analysis:
|
|
127
|
+
|
|
128
|
+
```python
|
|
129
|
+
from mne.decoding import ReceptiveField, TimeDelayingRidge
|
|
130
|
+
|
|
131
|
+
rf = ReceptiveField(
|
|
132
|
+
tmin=-0.1, tmax=0.4, sfreq=100,
|
|
133
|
+
estimator=TimeDelayingRidge(
|
|
134
|
+
tmin=-0.1, tmax=0.4, sfreq=100,
|
|
135
|
+
reg_type='laplacian', alpha=0.1
|
|
136
|
+
)
|
|
137
|
+
)
|
|
138
|
+
rf.fit(X_stimulus, y_response)
|
|
139
|
+
rf.coef_ # receptive field weights
|
|
140
|
+
rf.plot()
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Source-Space Decoding
|
|
144
|
+
|
|
145
|
+
```python
|
|
146
|
+
# Apply inverse to get source data, then decode
|
|
147
|
+
stcs = apply_inverse_epochs(epochs, inv, lambda2, method='dSPM')
|
|
148
|
+
X_source = np.array([stc.data for stc in stcs]) # (n_epochs, n_vertices, n_times)
|
|
149
|
+
|
|
150
|
+
# Feature selection (reduce dimensionality)
|
|
151
|
+
from sklearn.feature_selection import SelectKBest, f_classif
|
|
152
|
+
clf = make_pipeline(
|
|
153
|
+
SelectKBest(f_classif, k=500),
|
|
154
|
+
StandardScaler(),
|
|
155
|
+
LogisticRegression()
|
|
156
|
+
)
|
|
157
|
+
slider = SlidingEstimator(clf, scoring='roc_auc')
|
|
158
|
+
scores = cross_val_multiscore(slider, X_source, y, cv=5)
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## Utility Functions
|
|
162
|
+
|
|
163
|
+
```python
|
|
164
|
+
from mne.decoding import cross_val_multiscore, get_coef, compute_ems
|
|
165
|
+
|
|
166
|
+
# Cross-validation with multiple scores
|
|
167
|
+
scores = cross_val_multiscore(estimator, X, y, cv=5, scoring='roc_auc')
|
|
168
|
+
|
|
169
|
+
# Extract spatial patterns from LinearModel
|
|
170
|
+
from mne.decoding import LinearModel
|
|
171
|
+
model = LinearModel(LogisticRegression())
|
|
172
|
+
model.fit(X_2d, y)
|
|
173
|
+
patterns = get_coef(model, attr='patterns_') # neurophysiological patterns
|
|
174
|
+
filters = get_coef(model, attr='filters_') # spatial filters
|
|
175
|
+
|
|
176
|
+
# Effect-matched spatial filtering
|
|
177
|
+
evoked_ems = compute_ems(epochs, conditions=['left', 'right'])
|
|
178
|
+
```
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# I/O Formats Reference
|
|
2
|
+
|
|
3
|
+
## Table of Contents
|
|
4
|
+
1. [All Supported Readers](#all-supported-readers)
|
|
5
|
+
2. [Auto-Detection](#auto-detection)
|
|
6
|
+
3. [Creating Objects from Arrays](#creating-objects-from-arrays)
|
|
7
|
+
4. [Exporting Data](#exporting-data)
|
|
8
|
+
5. [Creating Info Objects](#creating-info-objects)
|
|
9
|
+
|
|
10
|
+
## All Supported Readers
|
|
11
|
+
|
|
12
|
+
| Function | Format | Extensions |
|
|
13
|
+
|----------|--------|------------|
|
|
14
|
+
| `mne.io.read_raw()` | Auto-detect | any |
|
|
15
|
+
| `mne.io.read_raw_fif()` | Neuromag FIF | .fif |
|
|
16
|
+
| `mne.io.read_raw_edf()` | EDF/EDF+ | .edf |
|
|
17
|
+
| `mne.io.read_raw_bdf()` | BioSemi BDF | .bdf |
|
|
18
|
+
| `mne.io.read_raw_gdf()` | GDF | .gdf |
|
|
19
|
+
| `mne.io.read_raw_eeglab()` | EEGLAB | .set |
|
|
20
|
+
| `mne.io.read_raw_brainvision()` | BrainVision | .vhdr |
|
|
21
|
+
| `mne.io.read_raw_egi()` | EGI NetStation | .mff, .raw |
|
|
22
|
+
| `mne.io.read_raw_cnt()` | Neuroscan CNT | .cnt |
|
|
23
|
+
| `mne.io.read_raw_ctf()` | CTF MEG | .ds |
|
|
24
|
+
| `mne.io.read_raw_kit()` | KIT/Ricoh | .sqd, .con |
|
|
25
|
+
| `mne.io.read_raw_bti()` | BTi/4D | config |
|
|
26
|
+
| `mne.io.read_raw_fieldtrip()` | FieldTrip | .mat |
|
|
27
|
+
| `mne.io.read_raw_nirx()` | NIRx fNIRS | .hdr |
|
|
28
|
+
| `mne.io.read_raw_snirf()` | SNIRF fNIRS | .snirf |
|
|
29
|
+
| `mne.io.read_raw_boxy()` | BOXY fNIRS | .txt |
|
|
30
|
+
| `mne.io.read_raw_hitachi()` | Hitachi fNIRS | .csv |
|
|
31
|
+
| `mne.io.read_raw_eyelink()` | EyeLink | .asc |
|
|
32
|
+
| `mne.io.read_raw_nicolet()` | Nicolet | .data |
|
|
33
|
+
| `mne.io.read_raw_nihon()` | Nihon Kohden | .eeg |
|
|
34
|
+
| `mne.io.read_raw_persyst()` | Persyst | .lay |
|
|
35
|
+
| `mne.io.read_raw_eximia()` | Eximia | .nxe |
|
|
36
|
+
| `mne.io.read_raw_ant()` | ANT Neuro | .cnt |
|
|
37
|
+
| `mne.io.read_raw_curry()` | Neuroscan Curry | .cdt |
|
|
38
|
+
| `mne.io.read_raw_neuralynx()` | Neuralynx | .ncs |
|
|
39
|
+
| `mne.io.read_raw_nsx()` | Blackrock NSx | .ns* |
|
|
40
|
+
| `mne.io.read_raw_nedf()` | NEDF | .nedf |
|
|
41
|
+
| `mne.io.read_raw_fil()` | FIL | .bin |
|
|
42
|
+
| `mne.io.read_raw_artemis123()` | Artemis 123 | .bin |
|
|
43
|
+
|
|
44
|
+
All readers accept `preload=True/False`. Use `preload=True` for interactive analysis; `preload=False` for large files (memory-mapped).
|
|
45
|
+
|
|
46
|
+
## Auto-Detection
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
# MNE can auto-detect format from file extension
|
|
50
|
+
raw = mne.io.read_raw('my_data.edf', preload=True)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Creating Objects from Arrays
|
|
54
|
+
|
|
55
|
+
When you have numpy arrays and want to create MNE objects:
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
import mne
|
|
59
|
+
import numpy as np
|
|
60
|
+
|
|
61
|
+
# Create Info
|
|
62
|
+
info = mne.create_info(
|
|
63
|
+
ch_names=['Fz', 'Cz', 'Pz', 'Oz'],
|
|
64
|
+
sfreq=256.,
|
|
65
|
+
ch_types='eeg'
|
|
66
|
+
)
|
|
67
|
+
info.set_montage('standard_1020')
|
|
68
|
+
|
|
69
|
+
# RawArray — continuous data
|
|
70
|
+
data = np.random.randn(4, 1000) # (n_channels, n_times)
|
|
71
|
+
raw = mne.io.RawArray(data, info)
|
|
72
|
+
|
|
73
|
+
# EpochsArray — segmented data
|
|
74
|
+
epochs_data = np.random.randn(50, 4, 128) # (n_epochs, n_channels, n_times)
|
|
75
|
+
events = np.column_stack([
|
|
76
|
+
np.arange(0, 50 * 128, 128),
|
|
77
|
+
np.zeros(50, dtype=int),
|
|
78
|
+
np.ones(50, dtype=int)
|
|
79
|
+
])
|
|
80
|
+
epochs = mne.EpochsArray(epochs_data, info, events, tmin=-0.2,
|
|
81
|
+
event_id={'stimulus': 1})
|
|
82
|
+
|
|
83
|
+
# EvokedArray — averaged data
|
|
84
|
+
evoked_data = np.random.randn(4, 128) # (n_channels, n_times)
|
|
85
|
+
evoked = mne.EvokedArray(evoked_data, info, tmin=-0.2)
|
|
86
|
+
|
|
87
|
+
# SpectrumArray — power spectrum
|
|
88
|
+
psd_data = np.random.rand(4, 65) # (n_channels, n_freqs)
|
|
89
|
+
freqs = np.arange(0, 65)
|
|
90
|
+
spectrum = mne.time_frequency.SpectrumArray(psd_data, info, freqs)
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Exporting Data
|
|
94
|
+
|
|
95
|
+
```python
|
|
96
|
+
raw.export('output.edf') # to EDF
|
|
97
|
+
raw.export('output.edf', fmt='edf')
|
|
98
|
+
epochs.export('output.set') # to EEGLAB
|
|
99
|
+
raw.export('output.bdf', fmt='bdf') # to BDF
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Creating Info Objects
|
|
103
|
+
|
|
104
|
+
```python
|
|
105
|
+
# Basic
|
|
106
|
+
info = mne.create_info(ch_names=['C3', 'C4'], sfreq=256., ch_types='eeg')
|
|
107
|
+
|
|
108
|
+
# Mixed channel types
|
|
109
|
+
info = mne.create_info(
|
|
110
|
+
ch_names=['EEG1', 'EEG2', 'EOG1', 'ECG1'],
|
|
111
|
+
sfreq=512.,
|
|
112
|
+
ch_types=['eeg', 'eeg', 'eog', 'ecg']
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
# Set montage (electrode positions)
|
|
116
|
+
info.set_montage('standard_1020')
|
|
117
|
+
# Available montages: 'standard_1020', 'standard_1005', 'biosemi64', etc.
|
|
118
|
+
# List all: mne.channels.get_builtin_montages()
|
|
119
|
+
|
|
120
|
+
# JSON serialization (v1.11+)
|
|
121
|
+
json_dict = info.to_json_dict()
|
|
122
|
+
info_restored = mne.Info.from_json_dict(json_dict)
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Reading Other Data Types
|
|
126
|
+
|
|
127
|
+
```python
|
|
128
|
+
# Events
|
|
129
|
+
events = mne.read_events('events.eve')
|
|
130
|
+
events, event_id = mne.events_from_annotations(raw)
|
|
131
|
+
|
|
132
|
+
# Epochs from file
|
|
133
|
+
epochs = mne.read_epochs('saved-epo.fif')
|
|
134
|
+
|
|
135
|
+
# Evoked from file
|
|
136
|
+
evoked_list = mne.read_evokeds('evoked-ave.fif')
|
|
137
|
+
evoked = mne.read_evokeds('evoked-ave.fif', condition='auditory/left')
|
|
138
|
+
|
|
139
|
+
# Forward solution
|
|
140
|
+
fwd = mne.read_forward_solution('sample-fwd.fif')
|
|
141
|
+
|
|
142
|
+
# Inverse operator
|
|
143
|
+
inv = mne.minimum_norm.read_inverse_operator('sample-inv.fif')
|
|
144
|
+
|
|
145
|
+
# Source estimate
|
|
146
|
+
stc = mne.read_source_estimate('sample')
|
|
147
|
+
|
|
148
|
+
# Covariance
|
|
149
|
+
cov = mne.read_cov('sample-cov.fif')
|
|
150
|
+
|
|
151
|
+
# Annotations
|
|
152
|
+
annot = mne.read_annotations('annotations.fif')
|
|
153
|
+
|
|
154
|
+
# Labels (FreeSurfer ROIs)
|
|
155
|
+
label = mne.read_label('lh.V1.label')
|
|
156
|
+
labels = mne.read_labels_from_annot(subject, parc='aparc', subjects_dir=subjects_dir)
|
|
157
|
+
|
|
158
|
+
# Trans (head-MRI transform)
|
|
159
|
+
trans = mne.read_trans('sample-trans.fif')
|
|
160
|
+
```
|