meg-skill

Processes MEG data for preprocessing, time-frequency analysis, source localization, and connectivity analysis.

89|5|Updated Mar 25, 2026
One-click install
npx skills add https://github.com/CUHK-AIM-Group/NeuroDiscovery --skill meg-skill-cuhk-aim-group
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: meg-skill
Source: https://github.com/CUHK-AIM-Group/NeuroDiscovery/tree/main/skills/meg-skill
Command: npx skills add https://github.com/CUHK-AIM-Group/NeuroDiscovery --skill meg-skill-cuhk-aim-group

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires numpy, mne, nibabel, and includes scripts (resource) components.

What problem does it solve? Analyzing magnetoencephalography (MEG) data requires coordinating many specialized steps—filtering, artifact removal, epoching, time-frequency analysis, and source localization—across multiple file formats and tools. This Skill orchestrates that entire pipeline through MNE-Python so researchers get reproducible, well-organized outputs without writing boilerplate code. ## Core Features & Use Cases - Full MEG preprocessing pipeline: Maxwell filtering (SSS), band-pass and notch filtering, ICA-based artifact removal, epoching, and evoked response computation for Elekta (.fif), CTF (.ds), and KIT (.con) systems. - Time-frequency analysis: Morlet wavelet and multitaper spectral analysis producing power and inter-trial coherence (ITC) maps via the bundled scripts/time_frequency.py. - Source localization & connectivity: Forward/inverse modeling (MNE, dSPM, sLORETA, LCMV beamformer) with FreeSurfer integration, plus sensor- and source-level connectivity (coherence, PLV, dPLI). - Use Case: A researcher with Cam-CAN MEG recordings asks to clean the data, remove cardiac artifacts, and compute alpha-band power over time—this Skill plans the steps, confirms with the user, and delegates execution to MNE-Python, saving results in a structured meg_output/ directory. ## Quick Start Ask the agent to preprocess my MEG recording at data/sub-01_meg.fif and run a Morlet time-frequency analysis from 1 to 100 Hz with baseline correction.

Frequently Asked Questions about meg-skill

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run time-frequency analysis on MEG data with MNE-Python?

Load your epoched .fif data and run the bundled time_frequency.py script with the morlet or multitaper method, specifying frequency range and baseline window. It outputs power and inter-trial coherence maps in NIfTI, NumPy, or FIF format.

What MEG file formats does MNE-Python support?

MNE-Python reads Elekta/Neuromag .fif files via mne.io.read_raw_fif, CTF .ds directories via read_raw_ctf, and KIT/Yokogawa .con files via read_raw_kit. BIDS-formatted MEG data is also supported through standard readers.

Does MEG source localization require a structural MRI?

Yes, source localization requires a co-registered T1w structural MRI and FreeSurfer cortical reconstruction to build the forward model. Sensor positions from head position indicator coils or digitized head shapes must also be available.

Can Maxwell filtering be applied to CTF or KIT MEG systems?

No, Maxwell filtering (signal-space separation) is specific to Elekta/Neuromag systems. CTF and KIT systems use different noise-reduction approaches, such as synthetic gradient balancing or reference-channel regression.

Why does ICA artifact removal fail on my MEG data?

ICA component detection fails when ECG or EOG reference channels are missing or noisy, preventing correlation-based artifact identification. Ensure ECG/EOG channels are recorded or use surrogate detection methods before running ICA.