Website
eden-kramer-lab / ripple_detection Goto Github PK
View Code? Open in Web Editor NEWTools for identifying sharp wave ripple events using LFPs
License: MIT License
Tools for identifying sharp wave ripple events using LFPs
License: MIT License
maximum threshold ( in units of sd) at which the event would still be detected (ie be above for >15ms or whatever your time threshold was)
Hello,
I wanted to try playing around with my own LFP ephys recordings, but cannot seem to run my lfps array (shape=(7350,)) with the filter_ripple_band(lfps) function to get the filtered_lfps.
The ValueError I get is "The length of the input vector x must be greater than padlen, which is 954." which is traced back to the "filtered_data[~is_nan] = filtfilt(filter_numerator, filter_denominator, data[~is_nan], axis=0)" section of the code.
Let me know if you have any ideas or need any more information!
Dear edeno,
I'm sorry to bother you.
Does this code apply to ripple detection at 80-125Hz?
Looking forward to your reply
Yours,
Xiaoke
Line 89 in ripple_detection/blob/master/ripple_detection/core.py is throwing an error since there are no nans in my lfp data.
def filter_ripple_band(data):
'''Returns a bandpass filtered signal between 150-250 Hz
Parameters
----------
data : array_like, shape (n_time,)
Returns
-------
filtered_data : array_like, shape (n_time,)
'''
filter_numerator, filter_denominator = _get_ripplefilter_kernel()
is_nan = np.any(np.isnan(data), axis=-1)
filtered_data = np.full_like(data, np.nan)
filtered_data[~is_nan] = filtfilt(
filter_numerator, filter_denominator, data[~is_nan], axis=0)
return filtered_data
I suggest the following change:
def filter_ripple_band(data):
'''Returns a bandpass filtered signal between 150-250 Hz
Parameters
----------
data : array_like, shape (n_time,)
Returns
-------
filtered_data : array_like, shape (n_time,)
'''
filter_numerator, filter_denominator = _get_ripplefilter_kernel()
is_nan = np.any(np.isnan(data), axis=-1)
if is_nan==False:
filtered_data = filtfilt(filter_numerator, filter_denominator, data, axis=0)
else:
filtered_data = np.full_like(data, np.nan)
filtered_data[~is_nan] = filtfilt(
filter_numerator, filter_denominator, data[~is_nan], axis=0)
return filtered_data
Where I supply LFP data as a nd array or as a 1d array all the dectors produce the following error: AxisError: axis 1 is out of bounds for array of dimension 1
in line 117 of ripple_detection/ripple_detection/detectors.py, if you can add ripple_amplitude to the ripple_combined variable and then add all three columns in the return function on line 122, that would be great. thanks.
I am working with some raw neuropixels LFP data, its compressed into a .tar but I am not sure how to open it in python.
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.