This is a collaborative space. In order to contribute, send an email to maximilien.chaumon@icm-institute.org
On any page, type the letter L on your keyboard to add a "Label" to the page, which will make search easier.
tSSS buffer length duration and low-freq high-amplitude artifacts
In 2013, Antoine Ducorps noticed, and discussed with @GEORGE Nathalie , about raw data containing step-like artifacts after applying tSSS.
A discussion with Samu Taulu author of the tSSS algorithm, and of Maxfilter(R), from Elekta.
Le 7 janv. 2013
…
I was recently informed by Ilpo Tertsonen, who visited your site in December, that you are experiencing some problems with our MaxFilter software. If I understood correctly, you had (at least) the following issues:1. Raw data contain step-like artifacts at the borders of the tSSS windows
2. There is still some significant residual interference in the data after applying basic SSS
Regarding item 1 above, unfortunately, in the current implementation of tSSS utilizing consequtive non-overlapping time windows for temporal analysis, the window borders often tend to have this step-like artifact. For the time being, an easy way to alleviate this problem is to significantly prolong the tSSS window length to, for example, >30 seconds, which would greatly reduce the occurrence of these artifacts. Have you tried this?
Regarding item 2, I would like to know what the interference reduction factor provided by SSS is. Could you please give me an estimate of this. This is an important piece of information because it would tell us whether the so-called fine calibration information is up to date or not. If SSS suppresses external interference by a factor of 100 or more, then I would consider the fine calibration to be correct. If the factor is poorer, the we have to check whether there is a problem with the calibration.
We focus here on point 1.
Antoine replies
08 January 2013
…
Concerning tSSS, we are effectively concerned by the discontinuities implied by the use of tSSS. Even with longer buffers, we cannot afford these discontinuities:
- neither in resting state recordings where time-frequency and coherence analyses are relevant and much disturbed by those steps
- neither in stimulation driven recordings, where discontinuities will randomly occur with respect to the stimulation events, themselves randomized in time.
For the later case, an "easy" fix that we suggested to Lauri 2 years ago would be to have the tSSS buffers also synchronized with the stimulation events, in order to keep the discontinuities outside of the interval of interest.
However this raises some difficulties, since the ISI (Inter Stimulus Interval) can be widely variable, and I guess tSSS needs a minimum time length to properly detect correlations between internal and external harmonics.
Samu replies
Thank you very much for the clarifications. This is good feedback, and your idea of synchronizing the tSSS buffers sounds interesting although it may be challenging to apply on data with widely varying ISI, as you mentioned.
One more thing about the tSSS window lenght: Ultimately, it might be best to use just a single tSSS window the length of which would be the length of the whole recording. This would remove the problem of discontinuities. Naturally, this is limited by the computer memory and so far, if I remember correctly, we have not tried tSSS with longer windows than two minutes. Maybe we should investigate here what the upper limit for the window length is for the current computers.
Antoine:
After discussions with Nathalie George yesterday, we also went to the conclusion that a tSSS of the whole buffer would be OK, since we are trying to remove very slow components, present all the time.
This is why we are typically using st 2000 in Maxfilter command lines, and st_duration=raw.times[-1] when calling mne.maxwell_filter.
Related discussion on MNE forum: https://mne.discourse.group/t/maxfilter-broadband-artifact/6717/6
I try to recap for the record what I've been looking at here:
I start with very large artifacts on the raw data at some channels. These are due to metallic parts present in the face of rare patients whose data we would like to keep as much as possible.
The raw file looks like this (with only ssp projectors on):
mne.preprocessing.maxwell_filter(raw, st_duration=10)
mne.preprocessing.maxwell_filter(raw, st_duration=raw.times[-1])
Now looking at spectra and topos shows the following (HFO = 250-500Hz):
My impression is that the strong low freq artifacts in the raw data are "spread" through all bands, even where they are not present originally: Orange lines (right temporal) rise across the spectrum in tsss
files compared to orig
. The artifact is present with st_duration=10
as well as with st_duration=times[-1]
.
I recall observing similar behavior with ICA "spreading" strong artifacts when removing components.
Trying to set st_correlation=0.95
to reject more components --> worse if anything.
st_correlation=0.99
Now only SSS:
To me discarding components with tsss injects this noise across frequencies. I don't know the "mechanics" of that, but it is something not unheard of in linear source separation methods when unmixing, discarding, remixing signals.
Code to generate those panels:
fig, axes = plt.subplot_mosaic('''''''''
AABCD
AAEFG
HHIJK
HHLMN
OOPQR
OOSTU
''''''''',figsize=(14, 10))
sp = {}
sp['orig'] = raws['orig'].compute_psd(picks = 'mag')
sp['orig'].plot(axes = axes['A'],xscale='log')
axes['A'].set_title('orig')
sp['orig'].plot_topomap(axes = [axes['B'],axes['C'],axes['D'],axes['E'],axes['F'], axes['G']],
show=False,
bands={'delta':[1,4], 'theta':[4,8], 'alpha':[8,12], 'beta':[12,30], 'gamma':[30,80], 'HFO':[250,500]})
sp['tsss_10'] = raws['tsss_10'].compute_psd(picks = 'mag')
sp['tsss_10'].plot(axes=axes['H'],xscale='log')
axes['H'].set_title('tsss_10')
sp['tsss_10'].plot_topomap(axes=[axes['I'],axes['J'],axes['K'],axes['L'], axes['M'], axes['N']],
show=False,
bands={'delta':[1,4], 'theta':[4,8], 'alpha':[8,12], 'beta':[12,30], 'gamma':[30,80], 'HFO':[250,500]})
sp['tsss_full'] = raws['tsss_full'].compute_psd(picks = 'mag')
sp['tsss_full'].plot(axes=axes['O'],xscale='log')
axes['O'].set_title('tsss_full')
sp['tsss_full'].plot_topomap(axes=[axes['P'],axes['Q'],axes['R'],axes['S'], axes['T'], axes['U']],
show=False,
bands={'delta':[1,4], 'theta':[4,8], 'alpha':[8,12], 'beta':[12,30], 'gamma':[30,80], 'HFO':[250,500]})