translationalneuromodeling / tapas

TAPAS - Translational Algorithms for Psychiatry-Advancing Science
https://translationalneuromodeling.github.io/tapas/
GNU General Public License v3.0
216 stars 89 forks source link

respiratory cycle figure from TAPAS #266

Open Ruwanmri opened 4 months ago

Ruwanmri commented 4 months ago

Hi,

As the TAPAS gives valuable output figures for peak detection of the cardiac pulse, I am interested in obtaining a similar figure for the respiratory cycle. Is there a straightforward way to extract this information (A similar figure to cardiac pulses) from TAPAS without modifying the core code significantly?

Thank you.

Best regards, Ruwan

mrikasper commented 4 months ago

Dear Ruwan,

If you select the respiratory volume per time (RVT) model as an output, and then use the original computation method by Rasmus Birn et al. that is based on maxima and minima of the breathing trace (see PhysIO/code/model/tapas_physio_rvt_peaks.m, you might already get what you want. You can try it out by setting

   physio.model.rvt.method = 'peaks'; % the default it now 'hilbert', which is more robust for atypical breathing (yawns etc.), but doesn't use peak detection
   physio.verbose.level = 2; % or higher; to get the peak plots

(see PhysIO/code/tapas_physio_new.m for details or check the help in the batch editor).

If you just need the plot, this will suffice. If you want to extract the peak times, you will have to dig some variables out of tapas_physio_rvt_peaks, e.g,. timeRpulseMax.

Please let me know if this helps!

All the best, Lars

Ruwanmri commented 4 months ago

Hi Lars,

Thank you very much. This was very helpful.

Best regards, Ruwan