I am a newbie to EEG signals and also MNE.I have BrainVision resting state EEG which has only annotations. I was only able to read raw file and create events using mne.events_from_annotations, could anyone be kind enough to help me with the following question
1.Should I do preprocessing on the epochs/events .If yes how do I do it ?
2. How can I crop the raw file for only one annotation ie. if annotation description is like {‘Comment/no USB Connection to actiCAP’, ‘New Segment/’, ‘Stimulus/S 1’, ‘Stimulus/S2’, ‘Stimulus/S3’}
Then I would like to crop the raw file for all occurrence of a particular annotations and save it as a raw file
Hi @Joseph45, welcome to MNE discourse!
1.Should I do preprocessing on the epochs/events .If yes how do I do it ?
I’m not sure if I understood your question - are you asking whether you should perform on raw or the epoched data? Things like resampling and filtering (at least highpass) should be done on the raw signal. Other steps like interpolation, marking/rejecting bad parts/epochs or ICA can be done either way (on raw or epochs).
- How can I crop the raw file for only one annotation ie. if annotation description is like {‘Comment/no USB Connection to actiCAP’, ‘New Segment/’, ‘Stimulus/S 1’, ‘Stimulus/S2’, ‘Stimulus/S3’}
Then I would like to crop the raw file for all occurrence of a particular annotations and save it as a raw file
I would need some clarification here as well to be able to help. Do you want to crop the raw data to remove all signal before the onset of a particular annotation and after onset + duration of some other annotation?
Thank you for the quick response, @mmagnuski .
For the first question,it clarifies my doubt.
For the second question,I meant how to crop the data from onset of a particular annotation + duration of that annotation and in the end my newely cropped raw file should have only event/annotations
Stimulus S2
and in the end I would like to have two newely cropped raw files,one containing only Stimulus/S1 and another containing Stimulus/S2
The occurrence is similar to this
Do you maybe mean epoching, not cropping? With epoching you would get as many small segments as you have events of given type(s) (you’ve created the events from annotations). With cropping you could get one big segment starting at the first first Stimulus 1 and ending at the last Stimulus 1 (+ duration for example). Maybe it will be easier for me understand what you need to do if you described what you want to do with the data afterwards.
Yes,I would like to crop one big segment of starting and ending of all Stimulus S200 and it’s duration (which is a concatenation of all Stimulus 200,beginning,ending and duration). I want to work only on Stimulus S200 data.
I want to work only on Stimulus S200 data.
But your Stimulus 200 and 210 events are alternating, if you crop one big chunk you will still have time regions covered by Stimulus 210, not only Stimulus 200. That’s why I suggested epoching (which cuts out small portions of the data with respect to given events).
Could you write what you intend to do with the data (what do you want to calculate and compare for example) - it will be easier to help you this way.
I want to crop Stimulus S200 (Eyes Closed) and do the pre-processing as I am planning to run classification algorithm on it .A small code snippet will help me do it faster.
Thank You.
Ok, so you have rest data - then I assume that you don’t have one event per rest block, but you send the event every N seconds (every one or two probably) while the rest block goes on. In such case you could epoch with respect to Stimulus S200, setting tmin=0
and tmax
would have to be equal to the distance between the Stimulus S200 events when they are sent continuously in one rest block. Then you would have epochs containing only eyes closed data. Before epoching, make sure you apply any filters (especailly high-pass) that are necessary for your preprocessing.
Thank You so much,I got it sorry,
for the late response.