{"id":19252280,"url":"https://github.com/sccn/trimoutlier","last_synced_at":"2025-04-21T13:30:46.620Z","repository":{"id":150759897,"uuid":"327718561","full_name":"sccn/trimOutlier","owner":"sccn","description":null,"archived":false,"fork":false,"pushed_at":"2024-07-25T21:44:28.000Z","size":632,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-01T13:38:06.433Z","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":null,"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":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-07T20:32:11.000Z","updated_at":"2024-07-25T21:44:31.000Z","dependencies_parsed_at":"2024-07-26T00:12:59.911Z","dependency_job_id":null,"html_url":"https://github.com/sccn/trimOutlier","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sccn%2FtrimOutlier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sccn%2FtrimOutlier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sccn%2FtrimOutlier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sccn%2FtrimOutlier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sccn","download_url":"https://codeload.github.com/sccn/trimOutlier/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250064541,"owners_count":21368922,"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:13.764Z","updated_at":"2025-04-21T13:30:45.878Z","avatar_url":"https://github.com/sccn.png","language":"MATLAB","funding_links":[],"categories":[],"sub_categories":[],"readme":"What is *trimOutlier*?\n-------------------------------------------------\n\n-   **Powerful data surveyability**: It is probably the only tool, as\n    far as I know, that allows to check ALL the channels and ALL the\n    data points in one window. One can perform visual sanity check for\n    outliers and data stationarity at a glance. It saves you from\n    eyeballing hundreds of pages of raw EEG data.\n-   **Simple data cleaning**: If you find a problem in your channels or\n    time-series waveforms, you can seamlessly perform an essential-level\n    data cleaning by chopping off bad channels/datapoints. Unlike\n    [*clean_rawdata*()](https://sccn.ucsd.edu/wiki/Artifact_Subspace_Reconstruction_(ASR)),\n    *trimOutlier*() does not add anything to data. Hence recommended for\n    purists and skeptics of any automated data cleaning/correction\n    algorithm. For example, if your cleaning strategy is a classical\n    'rejected trials EEG exceeds +/- 200 uV', then *trimOutlier*() does\n    the job for you. When called from GUI, it provides interactive and\n    intuitive user environment with which one can determine rejection\n    criteria based on feedback from cut-and-try processes.\n\nWhere is the rejection log stored?\n-------------------------------------------------------\n\nIt keeps a log in EEG.etc.trimOutlier.cleanChannelMask \\[nbchan x 1\nlogical\\] for channel rejection and EEG.etc.trimOutlier.cleanChannelMask\n\\[data_length x 1 logical\\] for data point rejection.\n\nTutorial\n--------\n\nThis tutorial assumes the user understands the basic steps of loading\ndata into EEGLAB. For more information, visit the [EEGLAB\ntutorial](http://sccn.ucsd.edu/wiki/EEGLAB_Wiki#EEGLAB_Tutorial).\n\nTo begin, load a continuous (un-epoched) data set and start the plugin\nunder “Tools” of the EEGLAB window. Several figures and charts will pop\nup along with a prompt to clean the data.\n\n![400px\\|Figure 1. trimOutlier initialized](images/To1.png)\n\nThe top left scalp map shows the topography of channel SD during all\nrecording time, and the top right one shows the same image but after\nremoving the channels with top 25% highest SD. By comparing these two\nscalp maps, you can see the scalp distribution of high amplitudes that\nis usually associated with artifacts.\n\n(05/14/2024 Updated)\nSince 2019, the SD bar graph shows error bars that indicates 1 SD.\nThe SD of SD is calculated by dividing the data into 100 bins with\nequal length with trimming, then calculate SD for each bin. My calculating\nthe mean and SD across the 100 SDs, you can get mean and SD of channel SD\nvalues. This approach helps distinguish the following two cases:\n(1) High-variance state is stationary (i.e. better to reject the channel;\nin this case, the error bar is short); (2) High-variance state is transiend\n(i.e. better to retain the channel; the error bar is long).\n\n![400px\\|Figure S1. Updated display](images/additional.jpg)\n\nBefore continuing by clicking “Yes,” be sure to study the graphs to\nestimate threshold values. There is no need to worry about finding the\nperfect threshold values on the first try however; again, an advantage\nto this plugin is the interactive nature of the process.\n\nThe first input for filtering is the channel standard deviation upper\nbound. For the example data set, we chose an upper bound of 200 MICROV\nbased on the “Standard deviation of all channels” graph. After clicking\n“Ok,” the plugin generates a graph of channel standard deviation data\nbefore and after rejection, and also displays the number of rejected\nchannels and asks for confirmation (names of channels removed will be\ndisplayed during final step). New upper bound values may be chosen if\nthe number of rejected channels is too high; for our experiment, we were\ncomfortable with rejecting up to 10% of our channels.\n\n![400px\\|Figure 2. Channel standard deviation upper\nbound](images/T02.png)\n\nIf you have multiple subjects in your experiment you may wish to\ndetermine a threshold common to all subjects. One way to do this is by\nfinding the standard deviation of the EEG data for each channel of each\nsubject and sorting the values, then examining the plot of all the\nsubject’s sorted data.\n\nClick “Ok” again to confirm upper bound channel removal. A similar\nprocess occurs for rejection based on lower bound. Enter a lower bound\nvalue, click “Ok,” inspect the result, and alter the value or confirm by\nclicking “Ok” again. While the upper bound is meant to take care of\n“crazy” channels, the lower bound addresses “dead” channels. Therefore,\nit is best to avoid using 0 as the lower bound. 2 MICROV is a good\nvalue.\n\n![400px\\|Figure 3. Channel rejection based on standard deviation for both\nupper and lower bound](images/T03.png)\n\nThe next step is to reject data points. The colour key is the same as\nthe first image: black represents mean, red is +/- 2SD, and blue is the\nenvelope. Here we use a threshold value of 300 MICROV and a point spread\nwidth of 1ms. Click “Ok,” and examine the “After datapoint rejection”\ngraph. Different values may be used for threshold and point spread width\nif the rejection is not satisfactory. Finalize the process by\nconfirming.\n\n![400px\\|Figure 4. Datapoint rejection based on input threhsold and point\nspread width](images/T04.png) ![325px\\|Figure 5. Before and\nafter of datapoint rejection](images/T05.png)\n\nAuthors: Clement Lee and Makoto Miyakoshi. SCCN, INC, UCSD\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsccn%2Ftrimoutlier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsccn%2Ftrimoutlier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsccn%2Ftrimoutlier/lists"}