From 767aea6dcd2c25d9ec88ae67583c2bfe1c06638e Mon Sep 17 00:00:00 2001 From: neukym Date: Sat, 27 Jan 2024 18:02:54 +0000 Subject: [PATCH] fixes MNE warning That goes: All inverse operator files should end with -inv.fif, -inv.fif.gz, _inv.fif or _inv.fif.gz --- invokers/run_gridsearch.py | 2 +- kymata/preproc/hexel_current_estimation.py | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/invokers/run_gridsearch.py b/invokers/run_gridsearch.py index 473f7962..f51df6f3 100644 --- a/invokers/run_gridsearch.py +++ b/invokers/run_gridsearch.py @@ -34,7 +34,7 @@ def main(): parser.add_argument('--ave-mode', type=str, default="ave", help='either ave or add, either average over the list of repetitions or treat them as extra data') parser.add_argument('--inverse-operator-dir', type=str, default=None, help='inverse solution path') - parser.add_argument('--inverse-operator-name', type=str, default="participant_01_ico5-3L-loose02-cps-nodepth-fusion.fif", + parser.add_argument('--inverse-operator-name', type=str, default="participant_01_ico5-3L-loose02-cps-nodepth-fusion-inv.fif", help='inverse solution name') parser.add_argument('--seconds-per-split', type=float, default=0.5, help='seconds in each split of the recording, also maximum range of latencies being checked') diff --git a/kymata/preproc/hexel_current_estimation.py b/kymata/preproc/hexel_current_estimation.py index ebd30a2c..88655fa3 100644 --- a/kymata/preproc/hexel_current_estimation.py +++ b/kymata/preproc/hexel_current_estimation.py @@ -238,9 +238,6 @@ def create_forward_model_and_inverse_solution(data_root_dir, config: dict): loose=0.2, depth=None, use_cps=True - # --diagnoise - # --exclude $path${subjects[m]}/label/Destrieux_Atlas/Unknown-lh.label - # --exclude $path${subjects[m]}/label/Destrieux_Atlas/Unknown-rh.label ) if config['meg'] and config['eeg']: mne.minimum_norm.write_inverse_operator( @@ -248,7 +245,7 @@ def create_forward_model_and_inverse_solution(data_root_dir, config: dict): intrim_preprocessing_directory_name, '4_hexel_current_reconstruction', 'inverse-operators', - participant + '_ico5-3L-loose02-cps-nodepth-300.fif')), + participant + '_ico5-3L-loose02-cps-nodepth-inv.fif')), inverse_operator) elif config['meg']: mne.minimum_norm.write_inverse_operator( @@ -256,7 +253,7 @@ def create_forward_model_and_inverse_solution(data_root_dir, config: dict): intrim_preprocessing_directory_name, '4_hexel_current_reconstruction', 'inverse-operators', - participant + '_ico5-3L-loose02-cps-nodepth-megonly.fif')), + participant + '_ico5-3L-loose02-cps-nodepth-megonly-inv.fif')), inverse_operator) elif config['eeg']: mne.minimum_norm.write_inverse_operator( @@ -264,7 +261,7 @@ def create_forward_model_and_inverse_solution(data_root_dir, config: dict): intrim_preprocessing_directory_name, '4_hexel_current_reconstruction', 'inverse-operators', - participant + '_ico5-3L-loose02-cps-nodepth-eegonly.fif')), + participant + '_ico5-3L-loose02-cps-nodepth-eegonly-inv.fif')), inverse_operator) @@ -322,7 +319,7 @@ def create_hexel_current_files(data_root_dir, config: dict): intrim_preprocessing_directory_name, '4_hexel_current_reconstruction', 'inverse-operators', - participant + '_ico5-3L-loose02-cps-nodepth.fif'))) + participant + '_ico5-3L-loose02-cps-nodepth-inv.fif'))) for input_stream in input_streams: for trial in range(1,number_of_trials+1):