Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

baseline correction on data recorded by Pupil Core device

edited March 2021 in DataMatrix

I am very new to Series and DataMatrix and I am just starting to learn how to apply preprocessing methods to my pupil size data recorded by the Pupil Core device.

The device gives out pupil size measures in the form of .csv files.

I need to know how to prepare (parse?) my data so that I can apply all the functions to it, such as srs.baseline, smooth, blinkreconstruct, etc.

A gist containing an example of my data is here:

pupil_positions.csv is my main data, in which pupil size in under the column: diameter_3d

I would appreciate some guidance on how to do the baseline correction as the first step.


  • Hi @Zahra ,

    In principle, the pupil data is directly plottable as the diameter_3d column, as you already pointed out. (see below).

    But the real question is: how is the data segmented, that is, I assume that the pupil_positions.csv file corresponds to different trials (?) and that the information about which trial begins where, and which condition each trial is in, is included in annotations.csv . So the first step is conceptual, rather than technical: What kind of data is this? Exactly how is the data structured? Exactly how do you want to analyze the data and what kind of measures do you want to extract?

    Do you see what I mean? Once you have a clear picture of that, you can start thinking about how to implement the analysis.

    — Sebastiaan

    Buy Me A Coffee

  • Hi @sebastiaan

    Thanks a lot for your swift response!

    Of course, I see what you mean, and I do have trials and sequences in my data. I just added a sample script to the gist, where I plot each trial and its sequences.

    Basically in this recording, I am looking at how changes in stimuli duration, size, contrast and frequency affect the pupil dilation. So, what I want to extract is pupil size (its peaks and the speed of its changes)

    Now, at the level of preprocessing, I am trying to figure out how to do baseline correction. I have to do that at the beginning of each trial.

    I hope my explanation is clear.

  • Hi @Zahra ,

    You're parsing the data in a way that doesn't fit with the DataMatrix style of representing continuous data as SeriesColumn objects. This means that you cannot easily use the data-processing functions (including baseline() ) from the datamatrix.series module.

    However, doing baseline correction is simple enough to implement it yourself. Say that df corresponds to a DataFrame that contains data for a single trial, and that df.diameter_3d is the pupil-size column. And now say that you want to use the first 10 samples of this trial as the baseline. Then you can simply do this as follows:

    df.diameter_3d -= df.diameter_3d[:10].mean()

    — Sebastiaan

    Buy Me A Coffee

  • Thanks @sebastiaan ,

    I applied this to each of my trials and it works.

    I have already detected and rejected blinks in my data. Now, I need to compensate for the rejected data. Do you suggest to do something like blinkreconstruct(), or to interpolate()?

    And how do you think it would be applicable to the structure of my data?

    - Zahra

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games