Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting respiration amplitudes separately (one by one) #934

Open
melisasaygin opened this issue Nov 27, 2023 · 3 comments
Open

Getting respiration amplitudes separately (one by one) #934

melisasaygin opened this issue Nov 27, 2023 · 3 comments
Labels
wontfix This will not be worked on

Comments

@melisasaygin
Copy link

Question and context
I do have my rsp processed dataframe with RSP_Clean, RSP_Peaks etc. I added my task labels as a new column to it and I calculate per task respiratory features (images below). The thing is I also need to calculate standard deviations of the respiratory amplitudes as well as the inspiratory durations, expiratory durations, insp-exp duration ratios. So I need the per breath amplitudes and time durations. How can I obtain that? Is there an easy/straightforward way to do so? I want my different features to be consistent so I would prefer somehow adjusting something with the function definitions/returns and getting these directly from neurokit. I tried the rsp_amplitude function but it gives a value per row which is not what I want. For instance, if there are three breath cycles within a task, I want to get each ones amplitude, insp time, exp time, separately. I also need the expiratory amplitude per breath (I saw that one of the methods to get out the volume is an average between the insp and exp volumes so hopefully that can be adjusted to get out those values).

image

image
image

@DominiqueMakowski
Copy link
Member

You can filter the dataframe to keep the values of RSP_Amplitude etc. at peaks (for instance when RSP_Peak == 1). this will give you the amplitude at the peak or trough of each cycle

@melisasaygin
Copy link
Author

I did that both for the inspiratory and expiratory amplitudes separately. Let's say there are 4 full breath cycles within a segment. I then average the amplitudes at peaks to get the mean amplitude over time, but it is slightly different than what Mean_RSP_Amplitude from intervalrelated function gives me. I could not find exactly where Mean_RSP_Amplitude feature is being calculated (the code for this). I was wondering if it, instead of taking the average of amplitudes at the peaks (given that the previous trough of the first peak is also within the segment) takes average of the amplitude column values over the segment (which would not be just a mean of the inspiratory volumes but would be weighted by the duration of breathing cycles). Which way is being used to come up with this feature? Also, I saw in some script of neurokit2 that the Phase is being used rather than the peak ==1 and trough ==1 identifiers. Does that make a difference too?

Copy link

stale bot commented Mar 17, 2024

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the wontfix This will not be worked on label Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants