This is a draft of a future Brainlife App that resamples MEG signals using the MNE functions:
mne.io.Raw.resample or
mne.Epochs.resample.
- Resample MEG signals
- Input file is:
- a MEG file in
.fifformat, - an optional fine calibration file in
.dat, - an optional crosstalk compensation file in
.fif, - an optional head position file in
.pos, - an optional destination file in
.fif, - an optional events file in
.tsv, - an optional channels file in
.tsv.
- a MEG file in
- Input parameters are:
- param_epoched_data:
bool, if True, the data to be resampled is epoched, else it is continuous. - param_sfreq:
float, new sample rate to use. - param_npad:
intorstr, amount to pad the start and end of the data. Default is 'auto'. - param_window:
str, frequency-domain window to use in resampling. Default isboxcar. - param_stim_picks:
list of intorNone, stim channels. Default isNone. - param_n_jobs:
intorstr, number of jobs to run in parallel. Can be 'cuda' if cupy is installed properly. Default is 1. - param_raw_pad:
str, the type of padding to use for raw data. Default is 'reflect_limited'. - param_epoch_pad:
str, the type of padding to use for epoched data. Default is 'edge'. - param_save_jointly_resampled_events:
bool, if True, save the events file resampled jointly with the data. Default is True. - param_pick_type:
strorNone, select meg or eeg channels. IfNoneall channels are selected. Default isNone.
- param_epoched_data:
This list along with the parameters' default values correspond to the 0.22.0 version of MNE Python.
- Ouput files are:
- a
.fifMEG file after resampling, - an optional
.tsvevents file with the resampled events.
- a
brainlife.io is publicly funded and for the sustainability of the project it is helpful to Acknowledge the use of the platform. We kindly ask that you acknowledge the funding below in your code and publications. Copy and past the following lines into your repository when using this code.
- Avesani, P., McPherson, B., Hayashi, S. et al. The open diffusion data derivatives, brain data upcycling via integrated publishing of derivatives and reproducible open cloud services. Sci Data 6, 69 (2019). https://doi.org/10.1038/s41597-019-0073-y
- Appelhoff, S., Sanderson, M., Brooks, T., Vliet, M., Quentin, R., Holdgraf, C., Chaumon, M., Mikulan, E., Tavabi, K., Höchenberger, R., Welke, D., Brunner, C., Rockhill, A., Larson, E., Gramfort, A., & Jas, M. MNE-BIDS: Organizing electrophysiological data into the BIDS format and facilitating their analysis. Journal of Open Source Software, 4:1896 (2019). https://doi.org/10.21105/joss.01896
This App has not yet been registered in Brainlife.io.
- git clone this repo
- Inside the cloned directory, create
config.jsonwith the same keys as inconfig.json.examplebut with paths to your input files and values of the input parameters. For instance:
{
"fif": "rest1-raw.fif"
}- Launch the App by executing
main
./mainThe output files are a MEG file in .fif format and an optional .tsv events file.