Data covariance matrix for resting-state EEG

We have resting-state EEG data collected at different timepoints, and are interested in using a beamformer for source estimation. Each data file is a single continuous ~6-minute recording. We want to compute a data covariance matrix, but of course there is no 'baseline' in our data. Is it possible to compute the data covariance matrix with resting-state EEG data in Brainstorm? E.g. could both Baseline and Data be defined as the entire length of the recording?

You can refer to the recommendation:

=> * No noise modeling: Use an identity matrix as noise covariance. This option is useful when no noise recording is available (e.g. ongoing EEG without any baseline of no interest).

The case of EEG

It is less straightforward to estimate sensor noise from EEG data, because the electrodes need to be attached to a conductive medium (i.e. the scalp) to produce signals. Therefore only the last two options shown above in the MEG section are possible in EEG:
resting baseline and pre-stimulation baseline.

EEG noise levels depend on the quality of the electrode connection with the skin. It varies considerably between subjects, and during acquisition. Indeed, the conductive gel/paste/solution used for contact tends to dry up, which affects impedance. The electrode cap/locations can also move slightly, depending on how cooperative the participants. To account for variable noise levels between subjects, it is therefore preferrable to use one channel file per subject, because it allows the definition of one noise covariance entry per participant. In some specific cases, if the quality of the recordings varies a lot over time, it is preferrable to segment long recordings into shorter runs, and obtain different noise covariance matrices for each.

EEG in resting-state conditions

If the target brain activity to your experiment is resting, resting segments cannot be used to obtain noise statistics. For MEG, use empty-room measurements as explained above. For EEG, there are possible options: use sensor variance estimates, or avoid estimating empirical noise statistics.
Option #1: Calculate noise covariance over a long segment of resting recordings, but save only the diagonal elements, i.e. the variance measured at each sensor. This option is available in Brainstorm's advanced options of source computation: select the option "Diagonal noise covariance".
Option #2: Select "No noise modeling" in the contextual menu. This option uses the identity matrix as noise covariance matrix, and therefore assumes equal, unit variance of noise on every sensor. In inverse modeling, this is equivalent to assuming that noise is homoskedastic, and equivalent on all sensors. With this latter option, if data quality is not even on all electrodes, a higher noise level on some sensors may be explained with stronger, spurious source activity.