Giter Site home page Giter Site logo

ripple_detection's Introduction

Eden-Kramer-Lab

Website

ripple_detection's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ripple_detection's Issues

Add ripple size metric

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)

Issue with filter_ripple_band padlen

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!

80-125Hz ripple detection

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

filter_ripple_band assumes there are nans in lfp array and throws an error if there aren't any.

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

add ripple amplitude to output table

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.