craddm / eegutils Goto Github PK
View Code? Open in Web Editor NEWAn R package for processing and plotting of electroencephalography (EEG) data
Home Page: https://craddm.github.io/eegUtils
License: Other
An R package for processing and plotting of electroencephalography (EEG) data
Home Page: https://craddm.github.io/eegUtils
License: Other
look into workaround for reading HDF5 files
... doesn't always reconstruct data correctly
Fails when unequal number of epochs.
Does not check order of epochs across objects, which causes problems with averaged eeg_tfr objects.
Need to implement much more detailed checking of objects since eeg_tfr uses matrices internally
Hi,
I was trying to select another color for 6 electrodes in 10-20 system; however, r only changes the color for 3 of them. I'm pretty sure it's a minor issue, but since I was not able to solve it, I came here to ask you guys.
`data(eegcoord)
myelectrodes <- rep("light blue",87)
enames <- rownames(eegcoord)
myelectrodes[enames=="A1"] <- "red"
myelectrodes[enames=="A2"] <- "red"
myelectrodes[enames=="C4"] <- "red"
myelectrodes[enames=="F7"] <- "red"
myelectrodes[enames=="O1"] <- "red"
myelectrodes[enames=="O2"] <- "red"
eegcap(electrodes = "10-20", col.point = myelectrodes)`
select()
, filter()
, mutate
, and rename
compute_tfr()
and check how plot_tfr()
can handle themThere are functions for calculating various channel and epoch statistics but nothing currently to help visualize them
edfReader seems to be slow considering the size of the files being loaded; replace with custom routines?
Epoching data sometimes causes problems when requested time limits don't hit zero at a given sampling rate. E.g. epoch limits of -.3, .75 fail at 256 Hz.
Topoplots are a great feature of eegUtils, but forcing them to look nice on a 5x5cm figure is a pain (requires hacks using ggplot_build() / ggplot_gtable()). It would be great if topoplot had an optional argument with a scaling factor and have all line weights in contours be based on this factor.
Allow facetting for erp_raster
Can you add S2B1.bdf
to the package if it's to be used for vignettes/readme?
Would this library support wave files for single channels like BackyardBrains SpikerShield?
https://backyardbrains.com/products/heartandbrainspikershieldbundle
If not, is there any way to transform this kind of input into an accepted data format?
erp_scalp should use chan_info structure when it's available, instead of always trying to overwrite the montage. Needs a broader rework to ensure proper use of canvas space etc.
Hi,
Any plans on implementing a function for a plot that shows a topographic arrangement of ERPs? I've been working on one here, and can send in a pull request if it's a feature you'd like to add to eegUtils.
Here's sample output from the function on my dev branch:
erp_scalp(data, color = "group")
The number of FFT points needs to be validated; some combinations of data and FFT points create artefacts.
Just went to install the package by copy/pasting the code from the README.md and got the error Error: 'install_packages' is not an exported object from 'namespace:devtools'
. It was easy to fix by replacing the install_packages
with install_github
, but I figured you might want to know so you can update the README with the proper command. Thanks for creating/maintaining the package!
returns signals as data.table
Need to rewrite the code to be more efficient with many epochs
Some functions return data frames, others return tibbles
e.g. rm_baseline()
progress bars would be great to have!
progressr
package may be useful for this in cases where the future
package is used.
when using method = "gam" with geom_topo(), interp_limit = "scalp" sets the the head limits incorrectly (way inside head radius)
Noticed with normal data.frame, not eeg_data class - seems to ignore grouping by epoch sometimes, thus baseline corrects with the average across all epochs instead of the average from each epoch.
edit - seems to be an awkward interaction with data that's already grouped on input.
Now that BIDS-EEG is being formalized, time to start making my data structures more compatible
improve memory handling etc
Dear Matt,
The test-ICA.R tests are failing on OSX.
── 1. Failure: topoplots for ICA work (@test-ICA.R#14) ───────────────────────
Figures don't match: topographical-plot-for-sobi.svg
── 2. Failure: ICA timecourses work (@test-ICA.R#26) ─────────────────────────
Figures don't match: timecourse-over-one-component.svg
── 3. Failure: component removal works (@test-ICA.R#39) ──────────────────────
Figures don't match: removed-one-component.svg
── 4. Failure: component removal works (@test-ICA.R#41) ──────────────────────
Figures don't match: reconstruct-all.svg
Any idea what is causing this?
Thanks!
the new filtering method currently ignores epoch boundaries, which can result in minor edge artefacts.
notch filtering currently returns only NA on some data
I am having trouble with topoplot()
when using electrode locations provided in the eegkit R package (data(eegcoord, package = "eegkit")
). I assume those locations are fairly standard.
Here's the result when I use those locations, with data d
:
topoplot(d)
I have fixed these issues and made topoplot()
load these locations by default if locations are not passed in data. Resulting figure is here (I've added a few options e.g. argument for contours):
topoplot(d, rmax = 10, chan_marker = "name", contour=F)
The fixes can be found here: https://github.com/mvuorre/eegUtils. I haven't submitted a pull request because I'm not sure if you'd want to use these electrode locations as default (or if the changes are good overall.) Let me know if you'd like me to submit it, though.
Thanks for the great function(s)!
I'm working on this, it seems fine so far. I'll do a pull request soon.
Allow specification of custom titles?
Hi,
I've just tried to install eegUtils via RStudio (R version 3.6.1) and I got this error:
Error: Failed to install 'eegUtils' from GitHub:
(converted from warning) unable to access index for repository https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6:
cannot open URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/PACKAGES'
I suspect it might be related to the fact that I'm currently using macOS Catalina, since I didn't encounter any error in the past when using eegUtils. What do you think?
Many thanks for your time.
Alberto
make sure when epochs are kept that epoch number is numeric and and any epoch labels are included
Dear Matt,
Love the package. Any interest in submitting to Neuroconductor? It's a general medical image analysis repo of R packages (similar to Bioconductor), and I think eegUtils would work well. We have ports for FSL and neuroimaging things but nothing really for EEG.
eeg_FASTER and interp_elecs don't correctly handle channels that are either not in the channel info at all, or have elements missing (e.g. co-ordinates are NA)
Currently messy as it's a mixture of multiple co-ordinate systems, because the structure mimics EEGLAB's.
I imported many edf files without problems using import_raw, but noticed that some files produced an error.
I realized that these files contain annotations. The error does not occur when the code in import_raw:
data <- edfReader::readEdfSignals(edfReader::readEdfHeader(file_name))
is replaced by
data <- edfReader::readEdfSignals(edfReader::readEdfHeader(file_name), signals = "Ordinary")
I work in a lab that has custom caps and electrode locations. Is it possible to define/enter custom electrode locations so that topoplot() can display maps properly?
Currently import_raw() only handles BDF/EDF files, thanks to the edfReader package. I'd like to extend support to other file formats, such as those from EGI or Neuroscan systems.
when using eeg_filter() on non-raw data (e.g., for plotting) it would be handy to manipulate (or at least deactivate) the demeaning feature of the function.
In a concrete case: when lp-filtering epoched data for plotting, epochs with high amplitude slow negative potentials (lasting for the bigger part of the epoch) were "pushed upwards", i.e. baseline signal was constant above x-axis. For such a case, it would be good to be able to either deactivate the demeaning or have a parameter that is forwarded to rm_baseline() to specify the baseline time window (i.e., time_lim).
Hi,
It seems that the vignette by @erzk is not available
#8
And in the website, only data structure is available in the articles menu
https://craddm.github.io/eegUtils/articles/data_structures.html
but I found eegUtils-intro.html buried in the git
psd sometimes errors with n_fft = 512
Getting warnings when running electrode_locations
:
The `x` argument of `as_tibble.matrix()` must have column names if `.name_repair` is omitted as of tibble 2.0.0.
Using compatibility `.name_repair`.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.