Giter VIP home page Giter VIP logo

cvd_pupillometry's Introduction

PyPlr

Contributor Covenant DOI PyPI version PyPi license

orange-eye

PyPlr is a Python library for researching the pupillary light reflex with the Pupil Core eye tracking platform. Features include:

  • User-friendly and feature-rich interfaces to Pupil Core (Pupil Labs GmbH, Berlin, Germany), Spectra Tune Lab (STLAB: LEDMOTIVE Technologies, LLC, Barcelona, Spain) light engine and Ocean Optics (Ocean Insight Inc., Oxford, UK) spectrometers
  • Flexible support for alternative stimulus delivery and measurement systems
  • Scripting tools to facilitate stimulus design, optimisation and delivery, communication with respect to timing, and extraction, cleaning, and analysis of pupil data

The code is here: https://github.com/PyPlr/cvd_pupillometry

The documentation is here: https://pyplr.github.io/cvd_pupillometry/index.html

cvd_pupillometry's People

Contributors

dependabot[bot] avatar jtmbeta avatar spitschan avatar willpatera avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

cvd_pupillometry's Issues

Variable event duration in pyplr.utils

Hello,
I am carrying our research on light direction and pupil size and find the pyplr software here very useful, thank you. It would be useful if within the 'utils' module there is an option for the 'duration' to be linked to a duration column in the 'events' dataframe so that the function applies to variable event durations. It seems that this option was planned. I am also looking into introducing this into the function.
Best
Simone

ValueError plr.parameters()


ValueError Traceback (most recent call last)
Input In [20], in <cell line: 1>()
----> 1 params = plr.parameters()
2 params

File ~\anaconda3\lib\site-packages\pyplr\plr.py:255, in PLR.parameters(self)
228 def parameters(self) -> pd.DataFrame:
229 """Collapse a PLR into descriptive parameters.
230
231 Parameters
(...)
243 DataFrame containins the params.
244 """
246 params = {
247 'Baseline': self.baseline(),
248 'Latency_a': self.latency_to_constriction_a(),
249 'Latency_b': self.latency_to_constriction_b(),
250 'T2MaxVel': self.time_to_max_velocity(),
251 'T2MaxCon': self.time_to_max_constriction(),
252 'T2Rec75pc': self.time_to_75pc_recovery(),
253 'PeakCon': self.peak_constriction(),
254 'ConAmplitude': self.constriction_amplitude(),
--> 255 'VelConMax': self.max_constriction_velocity(),
256 'VelConAve': self.average_constriction_velocity(),
257 'AccConMax': self.max_constriction_acceleration(),
258 'ConTime': self.constriction_time(),
259 'VelRedAve': self.average_redilation_velocity(),
260 'VelRedMax': self.max_redilation_velocity(),
261 'AccRedMax': self.max_redilation_acceleration()
262 }
263 return pd.DataFrame.from_dict(
264 params, orient='index', columns=['value'])

File ~\anaconda3\lib\site-packages\pyplr\plr.py:175, in PLR.max_constriction_velocity(self)
173 vel = self.velocity_profile()
174 pidx = self.peak_constriction_idx()
--> 175 return np.max(abs(vel[self.onset_idx:pidx]))

File <array_function internals>:5, in amax(*args, **kwargs)

File ~\anaconda3\lib\site-packages\numpy\core\fromnumeric.py:2754, in amax(a, axis, out, keepdims, initial, where)
2638 @array_function_dispatch(_amax_dispatcher)
2639 def amax(a, axis=None, out=None, keepdims=np._NoValue, initial=np._NoValue,
2640 where=np._NoValue):
2641 """
2642 Return the maximum of an array or maximum along an axis.
2643
(...)
2752 5
2753 """
-> 2754 return _wrapreduction(a, np.maximum, 'max', axis, None, out,
2755 keepdims=keepdims, initial=initial, where=where)

File ~\anaconda3\lib\site-packages\numpy\core\fromnumeric.py:86, in _wrapreduction(obj, ufunc, method, axis, dtype, out, **kwargs)
83 else:
84 return reduction(axis=axis, out=out, **passkwargs)
---> 86 return ufunc.reduce(obj, axis, dtype, out, **passkwargs)

ValueError: zero-size array to reduction operation maximum which has no identity

Unable to load file

Hi, I am trying to follow your Analysis of pupil data example: https://pyplr.github.io/cvd_pupillometry/04d_analysis.html but I am getting an error as I have renamed my pupil_positions.csv file with a prefix to differentiate the multiple subjects. I am stuck at this script with KeyError. Is there any way to change the data_dir so that it captures the renamed file? Thanks

Load pupil data

samples = utils.load_pupil(
s['data_dir'], eye_id='best', cols=use_cols)
samples

Linear Interpolation incorrect

Hello,

im trying to preprocess my pupillary light reflex data. While doing that the linear interpolation makes strange dips that make my data useless. This is the code im using and the plot it creates:

Code
Plot

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.