[FieldTrip] ft_rejectartifact

Herring, J.D. (Jim) j.herring at fcdonders.ru.nl
Thu Oct 3 11:24:08 CEST 2013


Dear Keith, What ft_rejectartifact does when rejecting trials completely is check the cfg.trl matrix (which contains the first, last, and offset sample with respect to the original data) for occurences of the artifact that you want to reject. If an artifact is present, it removes the line from this matrix. Then the artifact free data is read-in from disk or from memory. Basically line 491 checks whether cfg.trl is empty as that would indicate that no trials are left after rejection. Am I correct in assuming you are running ft_rejectartifact on each trial separately? If so, you could also run it on the entire dataset before going through your loop with the option cfg.artfctdef.feedback = 'yes'; .Doing this will remove the trials containing jump artifacts while preserving the other trials and it will give you feedback on which trials were removed. Best, Jim ----- Oorspronkelijk bericht -----
> Van: "Keith McConnell" <Keith.McConnell at cchmc.org>
> Aan: fieldtrip at science.ru.nl
> Verzonden: Woensdag 2 oktober 2013 18:46:17
> Onderwerp: [FieldTrip] ft_rejectartifact
> Hello,
> I have an experiment for which I have an extended stimulus for a very
> few number of trials (20). I would like to build a for loop to create
> TF plots for each trial individually.
> There are jump artifacts in the data.
> When a trial is rejected due to jump artifact my loop crashes:
> Error using ft_rejectartifact (line 491)
> No trials left after artifact rejection.
> I would like to create an if/then statement that will identify that
> the individual trial was rejected and return to running the for loop.
> I cannot find the flag that is generated that tells me that there are
> no trials left.
> Can someone help?
> Thanks,
> Keith
> Keith McConnell, M.S.
> 513.636.0739 (desk)
> 513.504.9907 (cell)
> Division of Pulmonary Medicine
> Cincinnati Children's Hospital Medical Center
> Cincinnati, OH 45229
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
-- Jim Herring, MSc. Neuronal Oscillations Group Centre for Cognitive Neuroimaging Donders Institute for Brain, Cognition and Behaviour Radboud University Nijmegen 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20131003/c924c760/attachment-0002.html>


More information about the fieldtrip mailing list