# Evoked Response Comparison MNE vs Brainstorm

**URL:** <https://mne.discourse.group/t/evoked-response-comparison-mne-vs-brainstorm/4590>\
**Category:** Support & Discussions\
**Tags:** preprocessing, meg, ssp\
**Created:** [March 21, 2022, 5:10pm UTC](https://mne.discourse.group/t/evoked-response-comparison-mne-vs-brainstorm/4590 "2022-03-21T17:10:07Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Subrat\_Bastola](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/subrat_bastola/32/1190_2.png) [@Subrat\_Bastola](https://mne.discourse.group/u/Subrat_Bastola)\
**Post date:** [March 21, 2022, 5:10pm UTC](https://mne.discourse.group/t/evoked-response-comparison-mne-vs-brainstorm/4590/1 "2022-03-21T17:10:07Z")

</div>

@mmagnuski @agramfort

Attached below are the evoked responses that I obtained using MNE and Brainstorm for the same activity(the same run). I followed the same process of preprocessing with both the softwares ( Bandpass: 1-100, notch at: 60, 120,180,240), later SSP for eye blinks and heartbeat artifacts. As we can see the evoked response obtained from brainstorm is sharper and the magnitude in fT is also larger. What could have caused the evoked response to be different across both the softwares considering that I followed mostly the same process ( only dc offset missing in MNE, couldn’t find that function). Did I do something wrong when preprocessing with MNE or is there an inherent difference in how these algorithm work?

MNE figure:

 ![image](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/3/3d9753be12ca9183461c0be7a483b030fd006901.jpeg)

Brainstorm figure:

 ![image](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/e/eeba0730f0dbe7bb86e21466329aed6dd5624554.png)

---

<div class="post-metadata">

**Author:** ![mmagnuski](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/mmagnuski/32/153_2.png) [@mmagnuski](https://mne.discourse.group/u/mmagnuski)\
**Post date:** [March 21, 2022, 6:26pm UTC](https://mne.discourse.group/t/evoked-response-comparison-mne-vs-brainstorm/4590/2 "2022-03-21T18:26:49Z")

</div>

The default filter settings for mne and brainstorm can be different, for example. To see exactly where the differences start to appear I would compare the results after each step you conduct. So first compare how the signal looks after filtering depending on the software used. To simplify you could try looking just at a single sensor and for example create a figure where post-filter signal for this sensor is displayed with color differentiating the software package.

---

<div class="post-metadata">

**Author:** ![agramfort](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@agramfort](https://mne.discourse.group/u/agramfort)\
**Post date:** [March 21, 2022, 8:14pm UTC](https://mne.discourse.group/t/evoked-response-comparison-mne-vs-brainstorm/4590/3 "2022-03-21T20:14:33Z")

</div>

I would also check that you averaged the same number of epochs after potential drops  
and that the SSP topography is very similar

Alex

---

<div class="post-metadata">

**Author:** ![Subrat\_Bastola](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/subrat_bastola/32/1190_2.png) [@Subrat\_Bastola](https://mne.discourse.group/u/Subrat_Bastola)\
**Post date:** [March 21, 2022, 8:29pm UTC](https://mne.discourse.group/t/evoked-response-comparison-mne-vs-brainstorm/4590/4 "2022-03-21T20:29:58Z")

</div>

@agramfort Hi Alex, when I apply SSP with MNE, I can see that it rejects more number of epochs than what I obtain with brainstorm. Eg: compute\_proj\_ecg rejects 37epochs with MNE where as the bad epochs are only 12 in brainstorm. Is there a way that I can reduce the number of epochs rejected? or prevent compute\_proj\_ecg from rejecting epochs automatically,so that I can reject them manually instead?

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [March 23, 2022, 9:23pm UTC](https://mne.discourse.group/t/evoked-response-comparison-mne-vs-brainstorm/4590/6 "2022-03-23T21:23:46Z")

</div>

Hello @Subrat_Bastola

> [@Subrat\_Bastola](#):
>
> Eg: compute\_proj\_ecg rejects 37epochs with MNE where as the bad epochs are only 12 in brainstorm.

`compute_proj_ecg()` has some default rejection thresholds set:

```python
reject={'grad': 2e-10, 'mag': 3e-12}

```

That means that any epochs around the ECG events in which gradiometers or magnetometers exceed these values will be removed before calculating the SSP vector(s).

You could try to use bigger values here to reduce the number of rejected epochs.

I would also suggest you compare the number of detected ECG events between MNE and Brainstorm (although I’m not sure if Brainstorm provides this info?)

Best wishes,  
Richard

---

<div class="post-metadata">

**Author:** ![Subrat\_Bastola](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/subrat_bastola/32/1190_2.png) [@Subrat\_Bastola](https://mne.discourse.group/u/Subrat_Bastola)\
**Post date:** [March 23, 2022, 9:50pm UTC](https://mne.discourse.group/t/evoked-response-comparison-mne-vs-brainstorm/4590/7 "2022-03-23T21:50:10Z")

</div>

@richard hi, is there a dc offset filter in MNE? If yes, could you tell me the function to use it?

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [March 23, 2022, 10:25pm UTC](https://mne.discourse.group/t/evoked-response-comparison-mne-vs-brainstorm/4590/8 "2022-03-23T22:25:08Z")

</div>

You can apply a high-pass filter, e.g. with 0.1 Hz lower frequency.

---

<div class="post-metadata">

**Author:** ![Subrat\_Bastola](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/subrat_bastola/32/1190_2.png) [@Subrat\_Bastola](https://mne.discourse.group/u/Subrat_Bastola)\
**Post date:** [March 25, 2022, 3:35pm UTC](https://mne.discourse.group/t/evoked-response-comparison-mne-vs-brainstorm/4590/9 "2022-03-25T15:35:55Z")

</div>

Hi @richard, @mmagnuski , thank you for your responses. I have one more question. How can i Merge the Gradiometer and Magnetometer time series figure to one figure?

And also, Is there a way that I can apply filters for visualization purpose, only on raw data to mark bad segments in the data, which I can then later undo/ remove ?? Or once a filter has been applied it’s effect can’t be reversed?

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [March 27, 2022, 4:53pm UTC](https://mne.discourse.group/t/evoked-response-comparison-mne-vs-brainstorm/4590/10 "2022-03-27T16:53:40Z")

</div>

> [@Subrat\_Bastola](#):
>
> How can i Merge the Gradiometer and Magnetometer time series figure to one figure?

Could you please explain what you mean by that? You should get a single figure with two subplots (one for grad and one for mag) by default.

> [@Subrat\_Bastola](#):
>
> Is there a way that I can apply filters for visualization purpose

Yes, [`Raw.plot()`](https://mne.tools/stable/generated/mne.io.Raw.html#mne.io.Raw.plot) accepts `highpass` and `lowpass` parameters exactly for this purpose.

As a side note, please try to create a new posting for new questions – makes things easier to navigate and more discoverable for other users! Thank you!

---

<div class="post-metadata">

**Author:** ![Subrat\_Bastola](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/subrat_bastola/32/1190_2.png) [@Subrat\_Bastola](https://mne.discourse.group/u/Subrat_Bastola)\
**Post date:** [March 28, 2022, 9:05pm UTC](https://mne.discourse.group/t/evoked-response-comparison-mne-vs-brainstorm/4590/11 "2022-03-28T21:05:26Z")

</div>

![image](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/f/f26985c1359c70e99034695992cd2139d3ec15cf.jpeg)

@richard@mmagnuski I mean, is there a way I can get a single MEG evoked response figure just like the one shown with brainstorm instead of separate Gradiometer and Magnetometer subplots?

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [March 29, 2022, 3:59am UTC](https://mne.discourse.group/t/evoked-response-comparison-mne-vs-brainstorm/4590/12 "2022-03-29T03:59:54Z")

</div>

No, you cannot simply merge the two as these are two different sensor types that produce signals of different units and in different orders of magnitude. I’m not sure what Brainstorm is displaying. What’s the scale and unit of the Brainstorm figure? It appears these parts of the y axis are cut off from the figure you shared?

---

<div class="post-metadata">

**Author:** ![Subrat\_Bastola](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/subrat_bastola/32/1190_2.png) [@Subrat\_Bastola](https://mne.discourse.group/u/Subrat_Bastola)\
**Post date:** [March 29, 2022, 4:12am UTC](https://mne.discourse.group/t/evoked-response-comparison-mne-vs-brainstorm/4590/13 "2022-03-29T04:12:39Z")

</div>

![image](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/a/a4931c57880d663803a4216bb51161fb8cd978cd.png)

Hi Richard, the units are in fT for brainstorm

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [March 29, 2022, 4:16am UTC](https://mne.discourse.group/t/evoked-response-comparison-mne-vs-brainstorm/4590/14 "2022-03-29T04:16:08Z")

</div>

Then this indicates that in this figure, Brainstorm is only displaying magnetometer data… Gradiometers have the unit fT/cm (or something of that kind … field strength per distance).
