科研 Skill
神经记录文件格式转换
neuro-file-formats
Opens, inspects and converts neural recording files from EEG, MEG, intracranial and fNIRS acquisition systems. Use when a reader errors or units, rates or events look wrong.
SKILL.md
Neural file formats: open, verify, convert
Most "the analysis is wrong" problems start at loading: values in the wrong unit, a sidecar file missing, events read from the wrong channel, mixed sampling rates silently resampled. Load with the right reader, then verify before any analysis.
1. Pick the reader
Identify the system from the extension and the files next to it, then use
references/formats.md (system by system: reader, required companion
files, units, known traps). Defaults:
| Data | First choice | Fallback |
|---|---|---|
| Scalp EEG, MEG, clinical EEG, fNIRS | MNE-Python: mne.io.read_raw(path) picks the reader from the extension | the specific mne.io.read_raw_*, then Neo, then the vendor converter |
| Intracranial and animal electrophysiology (spikes, LFP) | SpikeInterface read_* extractors or Neo neo.io.*IO / neo.rawio.*RawIO | MNE (read_raw_nsx, read_raw_neuralynx read continuous data only) |
| XDF from LabRecorder / LSL | pyxdf.load_xdf(path, synchronize_clocks=True, dejitter_timestamps=True) | build mne.io.RawArray per stream after alignment |
| BIDS dataset | mne_bids.read_raw_bids(BIDSPath(...)) | read the underlying file directly |
| NWB file | pynwb.NWBHDF5IO(path, "r"); for conversion use NeuroConv | neo.io.NWBIO |
MATLAB .mat | scipy.io.loadmat (v7 and older) | v7.3 files are HDF5: h5py or pymatreader |
| MATLAB toolboxes | EEGLAB pop_loadset, plugins (bva-io, BIOSIG, MFF), FieldTrip ft_read_header / ft_read_data / ft_read_event | Brainstorm "Review raw file" with the right file type |
Install only what the reader needs. Readers that need extra packages:
read_raw_ant (antio), read_raw_mef (pymef), read_raw_curry
(curryreader, MNE 1.11+), read_raw_neuralynx (neo), XDF (pyxdf), BIDS
(mne-bids), exports (pybv, eeglabio, edfio).
2. Verify before analysing
Run scripts/inspect_recording.py <file> (MNE-readable formats), or check
by hand:
- Sampling rate matches the acquisition settings and the
documentation. EDF/BDF with channels at different rates are upsampled
to the highest rate by MNE: check
raw.info["sfreq"]against the file header. - Channels: count, names, types (EEG, EOG, ECG, EMG, stim, misc). Set types explicitly; readers guess EEG for unknown labels.
- Units: MNE stores volts. Scalp EEG should sit at roughly tens of
microvolts (median absolute value 1e-6 to 1e-4 V). Values near 1 to
100 "volts" mean microvolts were read as volts; values near 1e-12
mean the reverse. Fix with
raw.apply_function(lambda x: x * 1e-6)on the affected picks, or the reader'sunitsargument (EDF/BDF). - Events: number per code matches the protocol. Events may live on a
stim channel (
mne.find_events), in annotations (mne.events_from_annotations), or in a separate file. Event samples fromfind_eventsincluderaw.first_samp; subtract it before indexingraw.get_data()directly. - Time: duration,
meas_date, discontinuities (EDF+D, clinical recordings paused and resumed, Neuralynx gaps). Check forBAD_ACQ_SKIPoredgeannotations. - Montage: electrode positions attached (
raw.get_montage()), or set one withraw.set_montage(...)matching the cap actually used. - Visual check: plot ten seconds and the PSD. A line-noise peak at 50 or 60 Hz confirms the time axis; its frequency also tells you the country of recording.
- Cross-check one channel against the vendor viewer (or EDFbrowser) at one time point when anything looks off.
3. Convert and export
- Analysis copy: save as FIF (
raw.save("x_raw.fif")); files over 2 GB are split automatically intox_raw-1.fifand so on, keep them together. - Exchange:
mne.export.export_raw(fname, raw, fmt="brainvision" | "edf" | "eeglab"). EDF stores 16-bit integers with a per-channel physical range, so large offsets or wide ranges lose resolution or clip; check the exported range. Annotations requiremeas_dateto matchannotations.orig_time. An EDF round trip also loses channel types (EOG and ECG come back as EEG) and electrode positions, and a missingmeas_datecomes back as 1 January 1985: reset types and montage after reading, and do not trust that date. - Sharing: convert to BIDS (
mne_bids.write_raw_bids) or NWB (NeuroConv). Hand the conversion details to a BIDS or NWB skill if one is installed. - Never overwrite the original. Record the reader, its version and every unit or channel-type change.
Output
A short load report: file, reader and version, sampling rate, channels by type, units check, events per code, duration and gaps, montage, and any corrections applied.
示例提示词
帮我把这份BrainVision的EEG原始文件转换成能被MNE读取的格式。
所属插件
安装该插件会一并获得同领域的 45 个 Skill / MCP。
同插件的其他科研 Skill
- Allen脑区本体查询Looks up Allen Institute brain region names, acronyms and atlas hierarchy, and picks a BrainGlobe reference atlas. Use when matching region labels across datasets or papers.
- 动物行为姿态追踪Tracks animal pose and behavior from video with DeepLabCut or SLEAP, and extracts kinematic and behavioral event features. Use for markerless tracking or scoring behavior.
- BIDS神经影像数据管理Converts raw EEG or fMRI data to BIDS, validates with bids-validator, and queries or manages datasets with pybids and datalad. Use when organizing or sharing neuroimaging data.
- Brian2脉冲神经网络仿真Simulates LIF, AdEx and Hodgkin-Huxley spiking neuron networks in Brian2, including STDP plasticity and recurrent dynamics. Use when building a spiking network model.
- 钙成像数据分析Processes two-photon or widefield calcium imaging with Suite2p or CaImAn, from motion correction through ROI extraction to dF/F and spike deconvolution. Use for calcium imaging movies.
- 功能连接组图论分析Computes functional connectivity matrices and graph-theory metrics such as modularity and path length from ROI time series. Use when analyzing brain network topology.
- MNE脑电脑磁分析Runs an MNE-Python EEG or MEG pipeline covering preprocessing, ICA cleanup, ERP and time-frequency analysis, and source localization. Use to analyze raw EEG/MEG recordings end to end.
- 神经解码无泄漏评估Guides leakage-free cross-validation of neural decoders, including subject grouping, nested CV, chance levels and confound checks. Use when training or reporting a BCI classifier.
- 电极通道映射校验Checks that EEG, ECoG or probe channel labels and positions match physiology using correlation-distance consistency. Use when montage labels may be swapped or bridged.
- 聚类置换统计检验Explains how to set up and correctly interpret cluster-based permutation tests and TFCE for ERP or time-frequency data. Use to avoid onset or localization overclaims.
- 神经连接性分析核查Guides choice of leakage-robust connectivity measures such as wPLI, imaginary coherency and AEC, with confound controls. Use when reviewing or planning a connectivity analysis.
- 神经数据集陷阱审查Checklist for auditing neural datasets before training: rate and channel consistency, duplicate subjects, label mapping. Use before modeling on a public or lab dataset.
- 神经数据档案库导航Lists neural data archives such as OpenNeuro, DANDI, PhysioNet and MOABB by paradigm, with access tiers and download guidance. Use when finding a dataset for a research question.
- DBS植入物传感数据分析Loads, time-aligns and analyzes sensing data from DBS and bidirectional implants such as Percept and Summit RC+S. Use with implant LFP exports, packet loss or aDBS biomarkers.
- 神经解码器嵌入式移植Ports a neural signal-processing or BCI decoder from Python or MATLAB to fixed-point embedded C on a microcontroller. Use when moving a decoder onto implant or headstage firmware.
- 神经设备法规合规映射Maps a neurotech device to the regulatory standards and testing it needs and builds a requirements-to-risk traceability matrix. Use when planning verification or a design review.
- EEG预处理流程审查Designs or audits an EEG or MEG preprocessing pipeline in MNE-Python, EEGLAB, FieldTrip or Brainstorm. Use when choosing or reviewing filter, ICA or epoching settings.
- 神经电极电化学表征Characterizes neural electrodes electrochemically via impedance spectroscopy, cyclic voltammetry and charge-injection limits. Use when comparing electrode coatings or charge capacity.
- 神经信号基础模型评估Fairly evaluates pretrained EEG or iEEG foundation models against classical baselines with matched data and splits. Use when fine-tuning or linear-probing a pretrained model.
- 神经记录前端电路设计Designs or reviews analog front ends for neural recording headstages, covering noise budget, CMRR and ADC resolution. Use when choosing an amplifier or debugging a noisy front end.
- 脑机解码器长期稳定性Evaluates intracortical BCI decoders across days using zero-shot and few-shot regimes to quantify drift and recalibration cost. Use to assess decoder stability over sessions.
- 植入设备功耗热预算Budgets power, data rate and tissue heating for implanted or wireless neural interfaces against thermal screening limits. Use when sizing a high-channel-count implant design.
- NeuroKit2生理信号处理Processes physiological biosignals such as ECG, EEG, EDA, RSP, EMG and EOG with NeuroKit2, including HRV and complexity metrics. Use for psychophysiology or multi-modal signal analysis.
- NeuroMorpho神经元形态检索Finds and compares digital neuron reconstructions on NeuroMorpho.Org by region, cell type or species and reads their morphometry. Use when real neuron morphologies are needed.
常见问题
神经记录文件格式转换能做什么?
Opens, inspects and converts neural recording files from EEG, MEG, intracranial and fNIRS acquisition systems. Use when a reader errors or units, rates or events look wrong。
如何安装神经记录文件格式转换?
在科搭 Codar 左侧点击「插件」,在「组件」页签搜索「神经记录文件格式转换」并安装;在 Claude Code 或 Codex 中可以发送本页的安装提示词,或下载 Skill 包后解压到 ~/.claude/skills 或 ~/.codex/skills。
神经记录文件格式转换需要哪些权限?
该科研 Skill没有声明额外权限;执行具体操作时仍由 Agent 按自身规则请求确认。
神经记录文件格式转换经过官方审核吗?
是。SpeedSkills 收录的每个版本都会记录内容摘要与权限声明,当前版本已通过安全审核。