[Mne_analysis] Cropping epoch to pre stimulus event

balandongiv at gmail.com balandongiv at gmail.com
Mon Nov 2 01:43:12 EST 2020
Search archives:

        External Email - Use Caution        

Dear Group,

 

I had epoch a continuous signal into -0.7s and 0.7s relative to the
stimulus. Along the pipeline, there is a step to evaluate only the signal
from -0.7s-0s. I would like to confirm whether epochs.crop() is the right
function for this?

 

The code snippet is as below.

 

sample_data_folder = mne.datasets.sample.data_path()

sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample',

                                    'sample_audvis_raw.fif')

raw = mne.io.read_raw_fif(sample_data_raw_file,
verbose=False,preload=True).crop(tmax=60)

events = mne.find_events(raw, stim_channel='STI 014')

epochs = mne.Epochs(raw, events, tmin=-0.7, tmax=0.7,preload=True)

pre_stim_epochs = epochs.copy().crop(tmin=-0.7, tmax=0, include_tmax=True)

 

 

Thanks for the time entertaining this question

 

Regards

Rpb

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20201102/3ca8e618/attachment.html 


More information about the Mne_analysis mailing list