{"id":19252288,"url":"https://github.com/sccn/clean_rawdata","last_synced_at":"2025-04-03T03:10:22.547Z","repository":{"id":40624101,"uuid":"166722878","full_name":"sccn/clean_rawdata","owner":"sccn","description":"Cleaning Raw EEG data","archived":false,"fork":false,"pushed_at":"2025-02-07T16:33:29.000Z","size":796,"stargazers_count":44,"open_issues_count":7,"forks_count":18,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-24T08:42:35.954Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"MATLAB","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sccn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-21T00:01:49.000Z","updated_at":"2025-02-07T16:33:33.000Z","dependencies_parsed_at":"2023-01-31T08:01:18.718Z","dependency_job_id":"f7fc5c5e-2471-41a0-a8be-d5c1ea989578","html_url":"https://github.com/sccn/clean_rawdata","commit_stats":{"total_commits":97,"total_committers":7,"mean_commits":"13.857142857142858","dds":"0.11340206185567014","last_synced_commit":"009ac50f795aa5b3e282edb41974e673ccc27617"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sccn%2Fclean_rawdata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sccn%2Fclean_rawdata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sccn%2Fclean_rawdata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sccn%2Fclean_rawdata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sccn","download_url":"https://codeload.github.com/sccn/clean_rawdata/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246927835,"owners_count":20856198,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T18:26:16.083Z","updated_at":"2025-04-03T03:10:22.525Z","avatar_url":"https://github.com/sccn.png","language":"MATLAB","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Clean_rawdata EEGLAB plug-in\n\nThe Clean Rawdata plug-in (version 2.0) interface has been redesigned and will soon become the default EEGLAB method for removing artifacts from EEG and related data. The plug-in detects and can separate low-frequency drifts, flatline and noisy channels from the data. It can also apply ASR (automated subspace removal) to detect and reject or remove high-amplitude non-brain ('artifact') activity (produced by eye blinks, muscle activity, sensor motion, etc.) by comparing its structure to that of known artifact-free reference data, thereby revealing and recovering (possibly smaller) EEG background activity that lies outside the subspace spanned by the artifact processes.\n\n**Note:** This plug-in uses the Signal Processing toolbox for pre- and post-processing of the data (removing drifts, channels and time windows); the core ASR method (clean_asr) does not require this toolbox but you will need high-pass filtered data if you use it directly.\n\n# This project needs you\n\nWe need community maintain to this project. Please review existing issues and issue pull requests. A section in this documentation with link to all the existing methodological papers is also needed.\n\n# Credit\n\nThis plug-in, clean_rawdata uses methods (e.g., Artifact Subspace \nReconstruction, ASR) by Christian Kothe from the BCILAB Toolbox \n(Kothe \u0026 Makeig, 2013), first wrapped into an EEGLAB plug-in by \nMakoto Miyakoshi and further developed by Arnaud Delorme with \nScott Makeig.\n\nThis plug-in cleans raw EEG data. Methods from the BCILAB toolbox\nare being used (in particular Artifact Subspace Reconstruction)\ndesigned by Christian Kothe.\n\nThese functions were wrapped up into an EEGLAB plug-in by Makoto\nMyakoshi, then later by Arnaud Delorme with input from Scott\nMakeig.\n\nThe private folder contains 3rd party utilities, including:\n- findjobj.m Copyright (C) 2007-2010 Yair M. Altman\n- asr_calibrate.m and asr_process.m\n Copyright (C) 2013 The Regents of the University of California\n Note that this function is not free for commercial use.\n- sperhicalSplineInterpolate.m Copyright (C) 2009 Jason Farquhar\n- oct_fftfilt Copyright (C) 1996, 1997 John W. Eaton\n- utility functions from the BCILAB toolbox Copyright (C) 2010-2014 Christian Kothe\n\nThe folder \"manopt\" contains the Matlab toolbox for optimization on manifolds.\n\n# Graphic interface\n\nBelow we detail the GUI interface. Individual function contain additional help information.\n\n![](gui_interface.png)\n\n## High pass filter the data\n\nCheck checkbox **(1)** if the data have not been high pass filtered yet. If you use this option, the edit box in **(2)** allows setting the transition band for the high-pass filter in Hz. This is formatted as[transition-start, transition-end]. Default is 0.25 to 0.75 Hz.\n\n## Reject bad channels\n\nCheck checkbox **(3)** to reject bad channels. Options **(4)** allows removal of flat channels. The edit box sets the maximum tolerated (non-rejected) flatline duration in seconds. If a channel has a longer flatline than this, it will be considered abnormal and rejected. The default is 5 seconds. Option **(5)** sets the Line Noise criterion: If a channel has more line noise relative to its signal than this value (in standard deviations based on the total channel signal), it is considered abnormal. The default is 4 standard deviations. Option **(6)** sets the minimum channel correlation. If a channel is correlated at less than this value to an estimate based on other nearby channels, it is considered abnormal in the given time window. This method requires that channel locations be available and roughly correct; otherwise a fallback criterion will be used. The default is a correlation of 0.8.\n\n## Artifact Subspace Reconstruction\n\nCheck checkbox **(7)** to use Artifact Subspace Reconstruction (ASR). ASR is described in this [publication](https://www.ncbi.nlm.nih.gov/pubmed/26415149). In edit box **(8)** you may change the standard deviation cutoff for removal of bursts (via ASR). Data portions whose variance is larger than this threshold relative to the calibration data are considered missing data and will be removed. The most aggressive value that can be used without losing much EEG is 3. For new users it is recommended to first visually inspect the difference between the aw and the cleaned data (using eegplot) to get a sense of the content the is removed at various levels of this input variable. Here, a quite conservative value is 20; this is the current default value. Use edit box **(9)** to use Riemannian distance instead of Euclidian distance. This is a beta option as the advantage of this method has not yet been clearly demonstrated. Checkbox **(10)** allows removal instead of correction of artifact-laden portions of data identified by ASR. One of the strength of ASR is its ability to detect stretches of 'bad data' before correcting them. This option allows use of ASR for data-period rejection instead of correction, and is the default for offline data processing. ASR was originally designed as an online data cleaning algorithm, in which case 'bad data' correction may be used.\n\n## Additional removal of 'bad data' periods\n\nCheck checkbox **(11)** to perform additional removal of bad-data periods. Edit box **(12)** sets the maximum percentage of contaminated channels that are tolerated in the final output data for each considered window. Edit box **(13)** sets the noise threshold for labeling a channel as contaminated.\n\n## Display rejected and corrected regions\n\nCheck checkbox **(14)** plots rejection results overlaid on the original data. This option is useful to visually assess the performance of a given ASR method.\n\nAdditional parameters are accessible through the command line interface of the clean_artifacts function.\n\n## Additional documentation\n\nMakoto Miyakoshi wrote a page in the [wiki section](https://github.com/sccn/clean_rawdata/wiki) of this repository discussing ASR.\n\n# Version history\nv0.34 and earlier - original versions\n\nv1.0 - new default values for some of the rejection tools, new GUI\n\nv2.0 - new improved GUI, compatibility with studies\n\nv2.1 - fix issue with 'distance' variable for burst detection\n\nv2.2 - fix history call for pop_clean_rawdata\n\nv2.3 - add maxmem to asr_calibrate to ensure reproducibility of results\n\nv2.4 - fixing issue with running function in parallel for Matlab 2020a\n\nv2.5 - move asr_calibrate out of the private folder so it can be used directly\n\nv2.6 - allowing to exclude channels and a variety of small bug fixes\n\nv2.7 - allowing to fuse channel rejection for datasets with same subject and session (STUDY processing)\n\nv2.8 - better error messages, and fix excluding channels (there was a rare crash)\n\nv2.9 - fix bug when ignoring channels and removing channels at the same time, fix plotting issue with vis_artifact\n\nv2.9.1 - add support for fractional sampling rate; fix too many splits with high sampling frequencies\n\nv2.10 - The code was updated to avoid crashes and fix minor errors related to channel masking, array dimensions, and ignoring channels.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsccn%2Fclean_rawdata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsccn%2Fclean_rawdata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsccn%2Fclean_rawdata/lists"}