# Event-Related Coherence in Visual Cortex and Brain Noise: An MEG Study
## 2 Materials and Methods
### Analysis Pipelines in FieldTrip and Brainstorm
#### 2.4.4 Event-Related Coherence  
Stimulus-induced coherence in the brain was used to estimate activated brain network size and characterize its activation strength. The taken approach was different for each software program. The previous study with the same stimulus [30] found frequency tags at the flickering frequency (6.67 Hz) and its harmonics. The study also revealed that the frequency tags were more pronounced at the second harmonic (13.33 Hz) than at the first harmonic. Therefore, we need to find an index characterizing the spectral power of brain response at the second harmonic. Since the analysis methods and obtained source models are significantly different, we would require appropriate and independent indices for both software programs to estimate event-related coherence (ERC).  
In FieldTrip, we first applied a fourth-order Butterworth 13-14 Hz band-pass filter. The band-pass frequency was determined by the frequency of interest, which in our case was equal to 13.33 Hz (the second harmonic of the flicker frequency). Then, we redefined the 3-s length of every trial within the [0.5, 3.5]-s interval to reduce edge effects due to filtering. Moreover, in this step, we calculated the covariance matrix, necessary when using the sLORETA method. After performing reconstruction of the sources separately for all 3-s B- and F-sub-trials using the sLORETA method, we obtained the power distribution of the activity of the brain sources on the 3D grid with 9025 voxels for every sub-trial.  
In the next step, we averaged the resulting source power distributions and obtained a distribution each for B- and F-condition (\(P_{B}\) and \(P_{F}\)). Such an approach made it possible to reduce the influence of instrumental and brain noise on the results of source reconstruction and, thus, increase the prominence of the event-related pattern of neural activity, compared to source reconstruction based on a single original 120-s trial. After that, we calculated the normalized difference of the source power distributions for F- and B-conditions (so-called baseline correction): \(D=\left(P_{F}-P_{B}\right)/P_{B}\). This procedure was needed to isolate the event-related pattern of source activity. The above steps were repeated for three 120-s F-trials (all subjects had at least three F-trials except \"sub10\"), and the average of the obtained three differences \(D\) was calculated. Finally, the distribution of the averaged difference was interpolated on the used MRI image.  
In Brainstorm, we started by calculating magnitude-squared coherence between the time series of each of the 15,000 brain sources and the reference sinusoidal signal at frequency 2\(f_{m}\) (13.33 Hz), i.e., the second harmonic of the flicker frequency, for both the F-trials (\(C^{F}\)) and the B-trial (\(C^{B}\)). To evaluate the event-related coherence in the brain, we calculated differences between the coherence values of the F-trials and B-trials for cortical sources lying in visual areas \(V_{1}\) and \(V_{2}\) as per the Brodmann atlas, \(ERC=C_{vis}^{F}-C_{vis}^{B}\), and averaged it for each subject.