cmtklib.interfaces.mne module
The MNE module provides Nipype interfaces for MNE tools missing in Nipype or modified.
CreateBEM
Bases: nipype.interfaces.base.core.BaseInterface
Use MNE to create the BEM surfaces.
Examples
>>> from cmtklib.interfaces.mne import CreateBEM >>> create_bem = CreateBEM() >>> create_bem.inputs.subject = 'sub-01' >>> create_bem.inputs.bids_dir = '/path/to/bids_dataset' >>> create_bem.inputs.output_query = {"src": {"suffix": "src", "extension": ["fif"]}} >>> create_bem.inputs.derivative_list = ['cmp-v3.0.3'] >>> create_bem.run()References
https://mne.tools/stable/generated/mne.bem.make_watershed_bem.html
https://mne.tools/stable/generated/mne.write_bem_solution.html
- bids_dira string
Base directory.
- derivative_lista list of items which are any value
List of derivatives to add to the datagrabber.
- output_querya dictionary with keys which are any value and with values which are any value
BIDSDataGrabber output_query.
- subjecta string
Subject.
- derivative_lista list of items which are any value
List of derivatives to add to the datagrabber.
- output_querya dictionary with keys which are any value and with values which are any value
BIDSDataGrabber output_query.
CreateCov
Bases: nipype.interfaces.base.core.BaseInterface
Use MNE to create the noise covariance matrix.
Examples
>>> from cmtklib.interfaces.mne import CreateCov >>> create_cov = CreateCov() >>> create_cov.inputs.epochs_fif_fname = 'sub-01_epo.fif' >>> create_cov.inputs.noise_cov_fname = 'sub-01_noisecov.fif' >>> create_cov.run()References
- epochs_fif_fnamea string or os.PathLike object referring to an existing file
Eeg * epochs in .set format.
- noise_cov_fnamea string or os.PathLike object
Location and name to store noise covariance matrix in fif format.
- has_runa boolean
If true, covariance matrix has been produced.
- noise_cov_fnamea string or os.PathLike object referring to an existing file
Location and name to store noise covariance matrix in fif format.
CreateFwd
Bases: nipype.interfaces.base.core.BaseInterface
Use MNE to calculate the forward solution.
Examples
>>> from cmtklib.interfaces.mne import CreateFwd >>> create_fwd = CreateFwd() >>> create_fwd.inputs.epochs_fif_fname = 'sub-01_epo.fif' >>> create_fwd.inputs.fwd_fname = 'sub-01_fwd.fif' >>> create_fwd.inputs.src = 'sub-01_src.fif' >>> create_fwd.inputs.bem = 'sub-01_bem.fif' >>> create_fwd.inputs.trans_fname = 'sub-01_trans.fif' >>> create_fwd.run()References
- bema list of items which are any value
Boundary surfaces for MNE head model.
- epochs_fif_fnamea string or os.PathLike object
Eeg * epochs in .fif format, containing information about electrode montage.
- srca list of items which are any value
Source space created with MNE.
- fwd_fnamea string or os.PathLike object
Forward solution created with MNE.
- trans_fnamea string or os.PathLike object referring to an existing file
Trans.fif file containing co-registration information (electrodes x MRI).
- has_runa boolean
If true, forward solution has been produced.
CreateSrc
Bases: nipype.interfaces.base.core.BaseInterface
Use MNE to set up bilateral hemisphere surface-based source space with subsampling and write source spaces to a file.
Examples
>>> from cmtklib.interfaces.mne import CreateSrc >>> create_src = CreateSrc() >>> create_src.inputs.subject = 'sub-01' >>> create_src.inputs.bids_dir = '/path/to/bids_dataset' >>> create_src.inputs.output_query = {"src": {"suffix": "src", "extension": ["fif"]}} >>> create_src.inputs.derivative_list = ['cmp-v3.0.3'] >>> create_src.run()References
https://mne.tools/stable/generated/mne.setup_source_space.html
https://mne.tools/stable/generated/mne.write_source_spaces.html
- bids_dira string
Base directory.
- derivative_lista list of items which are any value
List of derivatives to add to the datagrabber.
- output_querya dictionary with keys which are any value and with values which are any value
BIDSDataGrabber output_query.
- subjecta string
Subject.
- derivative_lista list of items which are any value
List of derivatives to add to the datagrabber.
- output_querya dictionary with keys which are any value and with values which are any value
BIDSDataGrabber output_query.
EEGLAB2fif
Bases: nipype.interfaces.base.core.BaseInterface
Use MNE to convert EEG data from EEGlab to MNE format.
Examples
>>> from cmtklib.interfaces.mne import EEGLAB2fif >>> eeglab2fif = EEGLAB2fif() >>> eeglab2fif.inputs.eeg_ts_file = ['sub-01_task-faces_desc-preproc_eeg.set'] >>> eeglab2fif.inputs.behav_file = ['sub-01_task-faces_events.tsv'] >>> eeglab2fif.inputs.epochs_fif_fname = 'sub-01_epo.fif' >>> eeglab2fif.inputs.electrode_positions_file = 'sub-01_eeg.xyz' >>> eeglab2fif.inputs.EEG_params = {"expe_name":"faces", EEG_event_IDs": {"SCRAMBLED":0, "FACES":1}, "start_t":-0.2, "end_t":0.6} >>> eeglab2fif.inputs.output_query = {"src": {"suffix": "src", "extension": ["fif"]}} >>> eeglab2fif.inputs.derivative_list = ['cmp-v3.0.3'] >>> eeglab2fif.run()References
https://mne.tools/stable/generated/mne.read_epochs_eeglab.html
https://mne.tools/stable/generated/mne.channels.make_dig_montage.html
https://mne.tools/stable/generated/mne.Epochs.html?highlight=set_montage#mne.Epochs.set_montage
https://mne.tools/stable/generated/mne.Epochs.html?highlight=set_montage#mne.Epochs.save
- behav_filea list of items which are any value
Epochs metadata in _behav.txt.
- derivative_lista list of items which are any value
List of derivatives to add to the datagrabber.
- eeg_ts_filea list of items which are any value
Eeg * epochs in .set format.
- epochs_fif_fnamea string or os.PathLike object
Eeg * epochs in .fif format.
- output_querya dictionary with keys which are any value and with values which are any value
BIDSDataGrabber output_query.
- EEG_paramsa dictionary with keys which are any value and with values which are any value
Dictionary defining EEG parameters.
- electrode_positions_filea string or os.PathLike object referring to an existing file
Positions of EEG electrodes in a txt file.
- derivative_lista list of items which are any value
List of derivatives to add to the datagrabber.
- epochs_fif_fnamea string or os.PathLike object referring to an existing file
Eeg * epochs in .fif format.
- output_querya dictionary with keys which are any value and with values which are any value
BIDSDataGrabber output_query.
MNEInverseSolution
Bases: nipype.interfaces.base.core.BaseInterface
Use MNE to convert EEG data from EEGlab to MNE format.
Examples
>>> from cmtklib.interfaces.mne import MNEInverseSolution >>> inv_sol = MNEInverseSolution() >>> inv_sol.inputs.subject = 'sub-01' >>> inv_sol.inputs.bids_dir = '/path/to/bids_dataset' >>> inv_sol.inputs.epochs_fif_fname = 'sub-01_epo.fif' >>> inv_sol.inputs.src_file = ['sub-01_src.fif'] >>> inv_sol.inputs.bem_file = ['sub-01_bem.fif'] >>> inv_sol.inputs.cov_has_run = 'True' >>> inv_sol.inputs.noise_cov_fname = 'sub-01_noisecov.fif' >>> inv_sol.inputs.fwd_has_run = 'True' >>> inv_sol.inputs.fwd_fname = 'sub-01_fwd.fif' >>> inv_sol.inputs.inv_fname = 'sub-01_inv.fif' >>> inv_sol.inputs.parcellation = 'lausanne2018.scale1' >>> inv_sol.inputs.roi_ts_file = 'sub-01_atlas-L2018_res-scale1_desc-epo_timeseries.npy' >>> inv_sol.run()References
https://mne.tools/stable/generated/mne.read_forward_solution.html
https://mne.tools/stable/generated/mne.minimum_norm.make_inverse_operator.html
https://mne.tools/stable/generated/mne.minimum_norm.apply_inverse_epochs.html
https://mne.tools/stable/generated/mne.read_labels_from_annot.html
https://mne.tools/stable/generated/mne.extract_label_time_course.html
- bem_filea list of items which are any value
Surfaces for head model.
- bids_dira string
Base directory.
- cov_has_runa boolean
Indicate if covariance matrix has been produced.
- epochs_fif_fnamea string or os.PathLike object referring to an existing file
Eeg * epochs in .fif format.
- fwd_fnamea string or os.PathLike object
Forward solution in fif format.
- inv_fnamea string or os.PathLike object
Inverse operator in fif format.
- noise_cov_fnamea string or os.PathLike object referring to an existing file
Noise covariance matrix in fif format.
- src_filea list of items which are any value
Source space created with MNE.
- subjecta string
Subject.
- fwd_has_runa boolean
Indicate if forward solution has been produced.
- parcellationa string
Parcellation scheme.
- roi_ts_filea string or os.PathLike object
Rois * time series in .npy format.
- fwd_fnamea string or os.PathLike object referring to an existing file
Forward solution in fif format.
- roi_ts_filea string or os.PathLike object referring to an existing file
Rois * time series in .npy format.