[FieldTrip] Discrepancy between FieldTrip and SPM artefact rejection functions (thresholding)

Cihan Dogan CDogan1994 at hotmail.co.uk
Fri Aug 6 00:26:27 CEST 2021


Dear Fieldtrip Experts,

Recently I have been in the process of moving my pre-processing pipeline from SPM to Fieldtrip. Originally, I started my analysis in SPM, then moved over to Fieldtrip, however, I was using functions provided by FieldTrip to convert the SPM data straight to FieldTrip removing the need for me to reprocess my data.

I decided to move this pre-processing over to FieldTrip rather than relying on two analysis programs. I am facing an issue whereby a large difference exists for the number of trials rejected using FieldTrips 'ft_artifact_threshold' versus SPM which I do not understand given my parameters for pre-processing are the same, and thresholding is a relatively simple process.

I could understand slight differences, but not this large. To double check I also reprocessed my files in SPM since it had been a while (no change).I linked below an example of how many trials get rejected for six participants (I have a dataset of 40). As seen, the discrepancy is quite large in some cases, for example participant 23.

I hope I am making a silly mistake somewhere and missing a setting, hopefully an expert can spot it!

Thanks in advance,
Cihan
FieldTrip Configuration Summary:
Preprocessing:
cfg = []
cfg.demean = 'yes';
cfg.baselinewindow  = [-0.2, 0];

cfg.lpfilter = 'yes';
cfg.hpfilter = 'yes';
cfg.lpfreq = 30;
cfg.hpfreq = 0.1
cfg.lpfiltord = 5;
cfg.hpfiltord = 5;

Artefact Rejection:

Thresholding -100 to 100 uV

cfg = [];
cfg.continious = 'no';
cfg.artfctdef.threshold.min = -100;
cfg.artfctdef.threshold.max = 100;
cfg.artfctdef.threshold.channel = get_eeg_channels(data);
cfg.artfctdef.threshold.bpfilter = 'no';
[cfg, artifact] = ft_artifact_threshold(cfg, data);

cfg = [];
cfg.artfctdef.reject = 'complete';
cfg.artfctdef.zvalue.artifact = artifact; % this doesn't make a difference given we only have 1 set of artifacts
postprocessed = ft_rejectartifact(cfg, data);


SPM Configuration Summary:
Filtering 0.1 30 Hz
matlabbatch{1}.spm.meeg.preproc.filter.type = 'butterworth';
matlabbatch{1}.spm.meeg.preproc.filter.band = 'bandpass';
matlabbatch{1}.spm.meeg.preproc.filter.freq = [0.1 30];
matlabbatch{1}.spm.meeg.preproc.filter.dir = 'twopass';
matlabbatch{1}.spm.meeg.preproc.filter.order = 5;

baseline -200 to 0 ms

matlabbatch{1}.spm.meeg.preproc.bc.timewin = [-200 0];

Thresholding -100 to 100 uV

matlabbatch{1}.spm.meeg.preproc.artefact.mode = 'reject';
matlabbatch{1}.spm.meeg.preproc.artefact.badchanthresh = 0.5;
matlabbatch{1}.spm.meeg.preproc.artefact.append = true;
matlabbatch{1}.spm.meeg.preproc.artefact.methods.channels{1}.type = 'EEG';
matlabbatch{1}.spm.meeg.preproc.artefact.methods.fun.threshchan.threshold = 100;
matlabbatch{1}.spm.meeg.preproc.artefact.methods.fun.threshchan.excwin = 1000;

6 Participant Example

Participant
SPM Reject
FieldTrip Reject
23
221
141
24
257
295
25
260
227
26
80
55
27
284
271
28
178
164
39
159
128


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20210805/ca44518c/attachment.htm>


More information about the fieldtrip mailing list