Package: meegkit
MEEGkitDenoising tools for M/EEG processing in Python 3.8+.Disclaimer:The project mostly consists of development code, although some modules
and functions are already working. Bugs and performance problems are to be expected, so
use at your own risk. More tests and improvements will be added in the future. Comments
and suggestions are welcome.DocumentationAutomatic documentation isavailable online.This code can also be tested directly from your browser usingBinder, by clicking on the binder badge above.InstallationThis package can be installed easily usingpip:pipinstallmeegkitOr you can clone this repository and run the following commands inside thepython-meegkitdirectory:pipinstall-rrequirements.txt
pipinstall.Note: Use developer mode with the-eflag (pip install -e .) to be able to modify
the sources even after install.Advanced installation instructionsSome ASR variants require additional dependencies such aspymanopt. To install meegkit
with these optional packages, use:pipinstall-e'.[extra]'or:pipinstallmeegkit[extra]Other available options are[docs](which installs dependencies required to build the
documentation), or[tests](which install dependencies to run unit tests).ReferencesIf you use this code, you should cite the relevant methods from the original articles.1. CCA, STAR, SNS, DSS, ZapLine, and Robust DetrendingThis is mostly a translation of Matlab code from theNoiseTools toolboxby Alain de Cheveigné.
It builds on an initial python implementation byPedro Alcocer.Only CCA, SNS, DSS, STAR, ZapLine and robust detrending have been properly tested so far.
TSCPA may give inaccurate results due to insufficient testing (contributions welcome!)[1]deCheveigné,A.(2019).ZapLine:Asimpleandeffectivemethodtoremovepowerlineartifacts.NeuroImage,116356.https://doi.org/10.1016/j.neuroimage.2019.116356[2]deCheveigné,A.etal.(2019).Multiwaycanonicalcorrelationanalysisofbraindata.NeuroImage,186,728–740.https://doi.org/10.1016/j.neuroimage.2018.11.026[3]deCheveigné,A.etal.(2018).Decodingtheauditorybrainwithcanonicalcomponentanalysis.NeuroImage,172,206–216.https://doi.org/10.1016/j.neuroimage.2018.01.033[4]deCheveigné,A.(2016).Sparsetimeartifactremoval.JournalofNeuroscienceMethods,262,14–20.https://doi.org/10.1016/j.jneumeth.2016.01.005[5]deCheveigné,A.,&Parra,L.C.(2014).Jointdecorrelation,aversatiletoolformultichanneldataanalysis.NeuroImage,98,487–505.https://doi.org/10.1016/j.neuroimage.2014.05.068[6]deCheveigné,A.(2012).Quadraticcomponentanalysis.NeuroImage,59(4),3838–3844.https://doi.org/10.1016/j.neuroimage.2011.10.084[7]deCheveigné,A.(2010).Time-shiftdenoisingsourceseparation.JournalofNeuroscienceMethods,189(1),113–120.https://doi.org/10.1016/j.jneumeth.2010.03.002[8]deCheveigné,A.,&Simon,J.Z.(2008a).Denoisingbasedonspatialfiltering.JournalofNeuroscienceMethods,171(2),331–339.https://doi.org/10.1016/j.jneumeth.2008.03.015[9]deCheveigné,A.,&Simon,J.Z.(2008b).Sensornoisesuppression.JournalofNeuroscienceMethods,168(1),195–202.https://doi.org/10.1016/j.jneumeth.2007.09.012[10]deCheveigné,A.,&Simon,J.Z.(2007).Denoisingbasedontime-shiftPCA.JournalofNeuroscienceMethods,165(2),297–305.https://doi.org/10.1016/j.jneumeth.2007.06.0032. Artifact Subspace Reconstruction (ASR)The base code is inspired from the originalEEGLAB inplementation[1], while the Riemannian
variant [2] was adapted from therASR toolboxby
Sarah Blum.[1]Mullen,T.R.,Kothe,C.A.E.,Chi,Y.M.,Ojeda,A.,Kerth,T.,Makeig,S.,etal.(2015).Real-timeneuroimagingandcognitivemonitoringusingwearabledryEEG.IEEETrans.Bio-Med.Eng.62,2553–2567.https://doi.org/10.1109/TBME.2015.2481482[2]Blum,S.,Jacobsen,N.,Bleichner,M.G.,&Debener,S.(2019).ARiemannianmodificationofartifactsubspacereconstructionforEEGartifacthandling.Frontiersinhumanneuroscience,13,141.3. Rhythmic Entrainment Source Separation (RESS)The code is based onMatlab code from Mike X. Cohen[1][1]Cohen,M.X.,&Gulbinaite,R.(2017).Rhythmicentrainmentsourceseparation:Optimizinganalysesofneuralresponsestorhythmicsensorystimulation.Neuroimage,147,43-56.4. Task-Related Component Analysis (TRCA)This code is based on theMatlab implementation from Masaki Nakanishi,
and was adapted to python byGiuseppe Ferraro[1]M.Nakanishi,Y.Wang,X.Chen,Y.-T.Wang,X.Gao,andT.-P.Jung,"Enhancing detection of SSVEPs for a high-speed brain speller using task-relatedcomponent analysis",IEEETrans.Biomed.Eng,65(1):104-112,2018.[2]X.Chen,Y.Wang,S.Gao,T.-P.JungandX.Gao,"Filter bank canonical correlationanalysis for implementing a high-speed SSVEP-based brain-computer interface",J.NeuralEng.,12:046008,2015.[3]X.Chen,Y.Wang,M.Nakanishi,X.Gao,T.-P.Jung,S.Gao,"High-speed spellingwith a noninvasive brain-computer interface",Proc.Int.Natl.Acad.Sci.U.S.A,112(44):E6058-6067,2015.5. Local Outlier Factor (LOF)[1]BreunigM,KriegelHP,NgRT,SanderJ.2000.LOF:identifyingdensity-basedlocaloutliers.SIGMODRec.29,2,93-104.https://doi.org/10.1145/335191.335388[2]KumaravelVP,BuiattiM,PariseE,FarellaE.2022.AdaptableandRobustEEGBadChannelDetectionUsingLocalOutlierFactor(LOF).Sensors(Basel).2022Sep27;22(19):7314.https://doi.org/10.3390/s22197314.