My question regards inverse_target and whether the pipeline is able to apply the inverse operator to resting state, given that in the documentation it says:
βCurrently, the only supported target is 'evoked'"
Sorry, I misunderstood your question, and you are absolutely right that the docs state it only accepts an evoked data object. Disclaimer: I never worked with the MNE-BIDS pipeline. A relatively easy but hacky way could be to epoch your resting state data (e.g. create one big epoch), average, and you have an evoked data object that you can apply the inverse operator on. There are configurations in the epoching step that address the epoching of resting state data, so this might be the intended way.
Another option is to apply your inverse solution to the raw data (preprocessed but not epoched) using MNEβs apply_inverse_raw. This is, however, outside of the MNE BIDS pipeline.
Hope this was more helpful,
I also pinged the MNE BIDS developer; I might have overlooked something in the BIDS pipeline.
thanks again. As you said, that could actually be the intended way!
Effectively the pipeline forces me to epoch the data even in the absence of events (somewhere I remember reading it was a design decision for ICA if Iβm not wrong).
So maybe the inverse_target = [βevokedβ] takes into account also this case (βevokedβ to me referred more strictly to an event-related paradigm, thatβs why my doubt).
I fix some other issues than try this way. Anyway plan B will definitely be doing it outside the pipeline as you suggested.
ββββββββββ¬ source/_05_make_inverse βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β09:53:09β β sub-063 ses-01 A critical error occurred. The error message was: missing in_files["evoked"] = /home/leozm/CRNL_projects/MNEBIDS_mimosa_criticality/data/sample_for_Leonardo/BIDS/derivatives/mne-bids-pipeline/sub-063/ses-01/meg/sub-063_ses-01_task-rest_ave.fif
Aborting pipeline run. The traceback is:
File "/home/leozm/CRNL_projects/envs/MNEBIDS_mimosa_env/lib/python3.10/site-packages/mne_bids_pipeline/_run.py", line 55, in __mne_bids_pipeline_failsafe_wrapper__
out = memory.cache(func)(*args, **kwargs)
File "/home/leozm/CRNL_projects/envs/MNEBIDS_mimosa_env/lib/python3.10/site-packages/mne_bids_pipeline/_run.py", line 179, in wrapper
hashes.append(hash_(k, v))
File "/home/leozm/CRNL_projects/envs/MNEBIDS_mimosa_env/lib/python3.10/site-packages/mne_bids_pipeline/_run.py", line 456, in _path_to_str_hash
assert v.exists(), f'missing {kind}_files["{k}"] = {v}'
Previously also in the source/_04_make_forward step the pipeline tried to retrieve the *task-rest_ave.fif file (which is never created). I could correct for it by setting
which is the input file of the noise covariance estimation.
I feel the only way is to set inverse_targets = [] and then use the inverse operator outside the pipeline.
Anyway, setting inverse_targets = [], the *task-rest_inv.fif file is created, but another error is then thrown
β10:40:03β β sub-063 ses-01 A critical error occurred. The error message was: 'NoneType' object has no attribute 'copy'
Aborting pipeline run. The traceback is:
File "/home/leozm/CRNL_projects/envs/MNEBIDS_mimosa_env/lib/python3.10/site-packages/mne_bids_pipeline/steps/source/_05_make_inverse.py", line 110, in run_inverse
conditions = _all_conditions(cfg=cfg)
File "/home/leozm/CRNL_projects/envs/MNEBIDS_mimosa_env/lib/python3.10/site-packages/mne_bids_pipeline/_report.py", line 545, in _all_conditions
conditions = cfg.conditions.copy()
within the MNE-BIDS-Pipeline, currently the only way to apply inverse is to apply it to evokeds, so you would need to either (1) create one big epoch and average it, or (2) create equally spaced events, epoch, and average the epochs.
You might also need to designate the ER file as a task="rest" condition rather than emptyroom, not sure.