[FieldTrip] ft_rejectartifact

McConnell, Keith Keith.McConnell at cchmc.org
Thu Oct 3 13:24:05 CEST 2013


Thanks Jim.  You're correct, I was trying to run ft_rejectartifact on each trial individually.  Your strategy seems like a much more workable solution.  Thanks.

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

From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Herring, J.D. (Jim)
Sent: Thursday, October 03, 2013 5:24 AM
To: FieldTrip discussion list
Subject: Re: [FieldTrip] ft_rejectartifact

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

________________________________
Van: "Keith McConnell" <Keith.McConnell at cchmc.org<mailto:Keith.McConnell at cchmc.org>>
Aan: fieldtrip at science.ru.nl<mailto: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<mailto: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/eba467a7/attachment-0002.html>


More information about the fieldtrip mailing list