Skip to content

Commit

Permalink
Examples update (#297)
Browse files Browse the repository at this point in the history
* Only include generic examples.
* Two different CTF examples.
* Added message/link for oxford-ohba examples.
* Updated readme.
  • Loading branch information
cgohil8 committed May 27, 2024
1 parent 35801b9 commit 252e3e7
Show file tree
Hide file tree
Showing 87 changed files with 700 additions and 4,821 deletions.
6 changes: 3 additions & 3 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Example Scripts
---------------

- See the `oxford` directory for scripts for preprocessing/source reconstructing data collected at OHBA.
- See the `parallelisation` directory for how to parallelise a script in OSL.
- The other directories are scripts for preprocessing/source reconstructing public M/EEG dataset.
This directory contains generic scripts for preprocessing/source reconstructing MEG data collected with different scanners.

For example scripts for various public M/EEG datasets, see https://github.com/OHBA-analysis/OHBA-Examples.
58 changes: 0 additions & 58 deletions examples/camcan/1_preprocess.py

This file was deleted.

105 changes: 0 additions & 105 deletions examples/camcan/2_coregister.py

This file was deleted.

70 changes: 0 additions & 70 deletions examples/camcan/3_source_reconstruct.py

This file was deleted.

43 changes: 0 additions & 43 deletions examples/camcan/4_sign_flip.py

This file was deleted.

11 changes: 0 additions & 11 deletions examples/camcan/5_save_npy.py

This file was deleted.

4 changes: 0 additions & 4 deletions examples/camcan/README.md

This file was deleted.

36 changes: 36 additions & 0 deletions examples/ctf/ctf_with_headshape_pos/1_preprocess.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"""Preprocess CTF data.
"""

# Authors: Chetan Gohil <chetan.gohil@psych.ox.ac.uk>

from osl import preprocessing

# Settings
config = """
preproc:
- filter: {l_freq: 1, h_freq: 125, method: iir, iir_params: {order: 5, ftype: butter}}
- notch_filter: {freqs: 50 100}
- resample: {sfreq: 250}
- bad_segments: {segment_len: 500, picks: mag}
- bad_segments: {segment_len: 500, picks: mag, mode: diff}
- bad_channels: {picks: mag}
- interpolate_bads: {}
"""

# Create a list of paths to files to preprocess
inputs = [
"data/raw/Nottingham/sub-not001/meg/sub-not001_task-resteyesopen_meg.ds",
"data/raw/Nottingham/sub-not002/meg/sub-not002_task-resteyesopen_meg.ds",
]

# Directory to save output to
outdir = "data/preproc"

# Do preprocessing
preprocessing.run_proc_batch(
config,
inputs,
outdir=outdir,
overwrite=True,
)
Loading

0 comments on commit 252e3e7

Please sign in to comment.