Skip to content

Commit

Permalink
fixes MNE warning
Browse files Browse the repository at this point in the history
That goes: All inverse operator files should end with -inv.fif, -inv.fif.gz, _inv.fif or _inv.fif.gz
  • Loading branch information
neukym committed Jan 27, 2024
1 parent 6efa83b commit 767aea6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion invokers/run_gridsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
11 changes: 4 additions & 7 deletions kymata/preproc/hexel_current_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,33 +238,30 @@ 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(
str(Path(
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(
str(Path(
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(
str(Path(
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)


Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 767aea6

Please sign in to comment.