Physiological peak data in BIDS

Hi All,
I am BIDSifying a dataset that contains PPG, respiratory and ECG data. In addition to the continuous recording files, there are files containing detected peaks, i.e. scanner-side identification of heart beats and breath cycle peaks. Is there currently a recommended way of storing these in BIDS?


What’s the format for PPG?

I’m attaching example files here. PPGData is a continuous recording and PPGTrig is one of the peak files I was asking about. I can get more info about the acquisition if that would be helpful. (Note: I added the .txt extension so neurostars would allow me to upload)PPGData_epiRT_rs_02212020-07_49_35.txt (454.9 KB) PPGTrig_epiRT_rs_02212020-07_49_35.txt (7.5 KB)

Okay, so it looks like PPGData is a standard time series and PPGTrig is indices. I can see a couple of options that would probably work with existing BIDS.


import numpy as np
import pandas as pd
cont = np.genfromtxt(PPGData_epiRT_rs_02212020-07_49_35.txt)
peaks = np.gentfromtxt(PPGTrig_epiRT_rs_02212020-07_49_35.txt, dtype=int)
  1. Encode the indices as a indicator series:

    out = np.zeros(cont.shape, dtype=np.uint8)
    out[peaks] = 1

    This could be just another column in your physio.tsv.gz, and is probably the simplest.

  2. Encode as events:

    out = pd.DataFrame({'onsets': peaks * sampling rate, 
                        'durations': np.zeros(len(peaks))})

    These could be appended to an events.tsv, but you would need to make sure that they are appropriately labeled with some kind of event type, and have n/a for any other columns that might already be there.

  3. Encode as a list in the JSON metadata for the PPGData column.

Thanks! Do you think it’s worth adding something to BIDS at some point specifically for these types of files? Or do you think the options you proposed are good enough long term?

Update to others reading this: @effigies and I discussed this with our lab and the consensus was that #1 is a good solution and there’s probably no need to make any changes to BIDS regarding this issue.

I like both option 1 and 2, but can imagine that something will need to come up for on eye tracking as well (for saccades and blinks, which are often detected in real time). Perhaps you can check there.