Skip to content

Commit

Permalink
Updated oxford examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
cgohil8 committed Mar 14, 2024
1 parent c89699a commit c651ba6
Show file tree
Hide file tree
Showing 18 changed files with 64 additions and 66 deletions.
6 changes: 3 additions & 3 deletions examples/oxford/automated_ica_pipeline/1_maxfilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

# Setup paths to raw (pre-maxfiltered) fif files
input_files = [
"path/to/file1.fif",
"path/to/file2.fif",
"data/raw/file1.fif",
"data/raw/file2.fif",
]

# Directory to save the maxfiltered data to
output_directory = "output/maxfilter"
output_directory = "data/maxfilter"

# Run MaxFiltering
#
Expand Down
18 changes: 9 additions & 9 deletions examples/oxford/automated_ica_pipeline/2_preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from osl import preprocessing, utils

# Files and directories
raw_file = "output/maxfilter/{subject}_tsss.fif" # {subject} will be replace by the name for the subject
preproc_dir = "output/preproc" # output directory containing the preprocess files
raw_file = "data/maxfilter/{subject}_tsss.fif" # {subject} will be replace by the name for the subject
preproc_dir = "data/preproc" # output directory containing the preprocess files

subjects = ["sub-001", "sub-002"]

Expand All @@ -21,13 +21,13 @@
- filter: {l_freq: 0.5, 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, significance_level: 0.1}
- bad_segments: {segment_len: 500, picks: grad, significance_level: 0.1}
- bad_segments: {segment_len: 500, picks: mag, mode: diff, significance_level: 0.1}
- bad_segments: {segment_len: 500, picks: grad, mode: diff, significance_level: 0.1}
- bad_channels: {picks: mag, significance_level: 0.1}
- bad_channels: {picks: grad, significance_level: 0.1}
- ica_raw: {picks: meg, n_components: 64}
- bad_segments: {segment_len: 500, picks: mag}
- bad_segments: {segment_len: 500, picks: grad}
- bad_segments: {segment_len: 500, picks: mag, mode: diff}
- bad_segments: {segment_len: 500, picks: grad, mode: diff}
- bad_channels: {picks: mag}
- bad_channels: {picks: grad}
- ica_raw: {picks: meg, n_components: 40}
- ica_autoreject: {picks: meg, ecgmethod: correlation, eogthreshold: auto}
- interpolate_bads: {}
"""
Expand Down
4 changes: 2 additions & 2 deletions examples/oxford/automated_ica_pipeline/3_coregister.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
from osl import source_recon, utils

# Directories
preproc_dir = "/output/preproc"
preproc_dir = "data/preproc"
anat_dir = "path/to/smri/dir"
coreg_dir = "output/coreg"
coreg_dir = "data/coreg"
fsl_dir = "/opt/ohba/fsl/6.0.5" # this is where FSL is installed on hbaws

# Files ({subject} will be replaced by the name for the subject)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
from osl import source_recon, utils

# Directories
preproc_dir = "output/preproc"
coreg_dir = "output/coreg"
src_dir = "output/src"
preproc_dir = "data/preproc"
coreg_dir = "data/coreg"
src_dir = "data/src"
fsl_dir = "/opt/ohba/fsl/6.0.5" # this is where FSL is installed on hbaws

# Files
Expand All @@ -33,7 +33,7 @@
freq_range: [1, 45]
chantypes: [mag, grad]
rank: {meg: 60}
parcellation_file: fmri_d100_parcellation_with_PCC_reduced_2mm_ss5mm_ds8mm.nii.gz
parcellation_file: Glasser52_binary_space-MNI152NLin6_res-8x8x8.nii.gz
method: spatial_basis
orthogonalisation: symmetric
"""
Expand Down
2 changes: 1 addition & 1 deletion examples/oxford/automated_ica_pipeline/5_sign_flip.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from osl.source_recon import find_template_subject, run_src_batch, setup_fsl

# Directories
src_dir = "output/src"
src_dir = "data/src"
fsl_dir = "/opt/ohba/fsl/6.0.5" # this is where FSL is installed on hbaws

if __name__ == "__main__":
Expand Down
6 changes: 3 additions & 3 deletions examples/oxford/manual_ica_pipeline/1_maxfilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

# Setup paths to raw (pre-maxfiltered) fif files
input_files = [
"path/to/file1.fif",
"path/to/file2.fif",
"data/raw/file1.fif",
"data/raw/file2.fif",
]

# Directory to save the maxfiltered data to
output_directory = "output/maxfilter"
output_directory = "data/maxfilter"

# Run MaxFiltering
#
Expand Down
18 changes: 9 additions & 9 deletions examples/oxford/manual_ica_pipeline/2_preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from osl import preprocessing, utils

# Files and directories
raw_file = "output/maxfilter/{subject}_tsss.fif" # {subject} will be replace by the name for the subject
preproc_dir = "output/preproc" # output directory containing the preprocess files
raw_file = "data/maxfilter/{subject}_tsss.fif" # {subject} will be replace by the name for the subject
preproc_dir = "data/preproc" # output directory containing the preprocess files

subjects = ["sub-001", "sub-002"]

Expand All @@ -21,13 +21,13 @@
- filter: {l_freq: 0.5, 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, significance_level: 0.1}
- bad_segments: {segment_len: 500, picks: grad, significance_level: 0.1}
- bad_segments: {segment_len: 500, picks: mag, mode: diff, significance_level: 0.1}
- bad_segments: {segment_len: 500, picks: grad, mode: diff, significance_level: 0.1}
- bad_channels: {picks: mag, significance_level: 0.1}
- bad_channels: {picks: grad, significance_level: 0.1}
- ica_raw: {picks: meg, n_components: 64}
- bad_segments: {segment_len: 500, picks: mag}
- bad_segments: {segment_len: 500, picks: grad}
- bad_segments: {segment_len: 500, picks: mag, mode: diff}
- bad_segments: {segment_len: 500, picks: grad, mode: diff}
- bad_channels: {picks: mag}
- bad_channels: {picks: grad}
- ica_raw: {picks: meg, n_components: 40}
- ica_autoreject: {apply: False}
- interpolate_bads: {}
"""
Expand Down
4 changes: 2 additions & 2 deletions examples/oxford/manual_ica_pipeline/3_manual_ica.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ def plot_psd(raw, save_dir):
#%% Setup paths

# Directories
preproc_dir = "output/preproc"
output_dir = "output/preproc_ica"
preproc_dir = "data/preproc"
output_dir = "data/preproc_ica"

# Subjects
subjects = ["sub-001", "sub-002"]
Expand Down
6 changes: 3 additions & 3 deletions examples/oxford/manual_ica_pipeline/4_coregister.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
from osl import source_recon, utils

# Directories
preproc_dir = "/output/preproc_ica"
anat_dir = "path/to/smri/dir"
coreg_dir = "output/coreg"
preproc_dir = "data/preproc_ica"
anat_dir = "data/smri"
coreg_dir = "data/coreg"
fsl_dir = "/opt/ohba/fsl/6.0.5" # this is where FSL is installed on hbaws

# Files ({subject} will be replaced by the name for the subject)
Expand Down
8 changes: 4 additions & 4 deletions examples/oxford/manual_ica_pipeline/5_source_reconstruct.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
from osl import source_recon, utils

# Directories
preproc_dir = "output/preproc_ica"
coreg_dir = "output/coreg"
src_dir = "output/src"
preproc_dir = "data/preproc_ica"
coreg_dir = "data/coreg"
src_dir = "data/src"
fsl_dir = "/opt/ohba/fsl/6.0.5" # this is where FSL is installed on hbaws

# Files
Expand All @@ -31,7 +31,7 @@
freq_range: [1, 45]
chantypes: [mag, grad]
rank: {meg: 60}
parcellation_file: fmri_d100_parcellation_with_PCC_reduced_2mm_ss5mm_ds8mm.nii.gz
parcellation_file: Glasser52_binary_space-MNI152NLin6_res-8x8x8.nii.gz
method: spatial_basis
orthogonalisation: symmetric
"""
Expand Down
2 changes: 1 addition & 1 deletion examples/oxford/manual_ica_pipeline/6_sign_flip.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from osl.source_recon import find_template_subject, run_src_batch, setup_fsl

# Directories
src_dir = "output/src"
src_dir = "data/src"
fsl_dir = "/opt/ohba/fsl/6.0.5" # this is where FSL is installed on hbaws

if __name__ == "__main__":
Expand Down
4 changes: 2 additions & 2 deletions examples/oxford/maxfilter/maxfilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

# Setup paths to raw (pre-maxfiltered) fif files
input_files = [
"/ohba/pi/knobre/datasets/covid/rawbids/sub-004/meg/sub-004_task-restEO.fif",
"data/raw/file1.fif",
]

# Directory to save the maxfiltered data to
output_directory = "/ohba/pi/knobre/cgohil/covid/maxfilter"
output_directory = "data/maxfilter"

# Run MaxFiltering
run_maxfilter_batch(
Expand Down
6 changes: 3 additions & 3 deletions examples/oxford/ssp_pipeline/1_maxfilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

# Setup paths to raw (pre-maxfiltered) fif files
input_files = [
"path/to/file1.fif",
"path/to/file2.fif",
"data/raw/file1.fif",
"data/raw/file2.fif",
]

# Directory to save the maxfiltered data to
output_directory = "output/maxfilter"
output_directory = "data/maxfilter"

# Run MaxFiltering
#
Expand Down
18 changes: 8 additions & 10 deletions examples/oxford/ssp_pipeline/2_preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from osl import preprocessing, utils

# Files and directories
raw_file = "output/maxfilter/{subject}_tsss.fif" # {subject} will be replace by the name for the subject
preproc_dir = "output/preproc" # output directory containing the preprocess files
raw_file = "data/maxfilter/{subject}_tsss.fif" # {subject} will be replace by the name for the subject
preproc_dir = "data/preproc" # output directory containing the preprocess files

subjects = ["sub-001", "sub-002"]

Expand All @@ -21,14 +21,12 @@
- filter: {l_freq: 0.5, 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, significance_level: 0.1}
- bad_segments: {segment_len: 500, picks: grad, significance_level: 0.1}
- bad_segments: {segment_len: 500, picks: mag, mode: diff, significance_level: 0.1}
- bad_segments: {segment_len: 500, picks: grad, mode: diff, significance_level: 0.1}
- bad_channels: {picks: mag, significance_level: 0.1}
- bad_channels: {picks: grad, significance_level: 0.1}
- ica_raw: {picks: meg, n_components: 64}
- ica_autoreject: {apply: False}
- bad_segments: {segment_len: 500, picks: mag}
- bad_segments: {segment_len: 500, picks: grad}
- bad_segments: {segment_len: 500, picks: mag, mode: diff}
- bad_segments: {segment_len: 500, picks: grad, mode: diff}
- bad_channels: {picks: mag}
- bad_channels: {picks: grad}
- interpolate_bads: {}
"""

Expand Down
6 changes: 3 additions & 3 deletions examples/oxford/ssp_pipeline/3_ssp_denoise.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@


# Directories
preproc_dir = "output/preproc"
ssp_preproc_dir = "output/preproc_ssp"
report_dir = "output/preproc_ssp/report"
preproc_dir = "data/preproc"
ssp_preproc_dir = "data/preproc_ssp"
report_dir = "data/preproc_ssp/report"

os.makedirs(ssp_preproc_dir, exist_ok=True)
os.makedirs(report_dir, exist_ok=True)
Expand Down
4 changes: 2 additions & 2 deletions examples/oxford/ssp_pipeline/4_coregister.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
from osl import source_recon, utils

# Directories
preproc_dir = "output/preproc_ssp"
preproc_dir = "data/preproc_ssp"
anat_dir = "path/to/smri/dir"
coreg_dir = "output/coreg"
coreg_dir = "data/coreg"
fsl_dir = "/opt/ohba/fsl/6.0.5" # this is where FSL is installed on hbaws

# Files ({subject} will be replaced by the name for the subject)
Expand Down
8 changes: 4 additions & 4 deletions examples/oxford/ssp_pipeline/5_source_reconstruct.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
from osl import source_recon, utils

# Directories
preproc_dir = "output/preproc_ssp"
coreg_dir = "output/coreg"
src_dir = "output/src"
preproc_dir = "data/preproc_ssp"
coreg_dir = "data/coreg"
src_dir = "data/src"
fsl_dir = "/opt/ohba/fsl/6.0.5" # this is where FSL is installed on hbaws

# Files
Expand All @@ -31,7 +31,7 @@
freq_range: [1, 45]
chantypes: [mag, grad]
rank: {meg: 60}
parcellation_file: fmri_d100_parcellation_with_PCC_reduced_2mm_ss5mm_ds8mm.nii.gz
parcellation_file: Glasser52_binary_space-MNI152NLin6_res-8x8x8.nii.gz
method: spatial_basis
orthogonalisation: symmetric
"""
Expand Down
2 changes: 1 addition & 1 deletion examples/oxford/ssp_pipeline/6_sign_flip.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from osl.source_recon import find_template_subject, run_src_batch, setup_fsl

# Directories
src_dir = "output/src"
src_dir = "data/src"
fsl_dir = "/opt/ohba/fsl/6.0.5" # this is where FSL is installed on hbaws

if __name__ == "__main__":
Expand Down

0 comments on commit c651ba6

Please sign in to comment.