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

Post-hoc manual peak selection error #85

Closed neuralego closed 4 years ago

neuralego commented 4 years ago

Dear experts,

Thank you again for implementing this useful and clear toolbox.

I have recorderd physio data with the pulse oximeter of a fMRI Siemens scanner (vendor Siemens_Tics) and I have directly insert the files in the PhysIO script, but I have some doubts regarding some very high and low peaks of the green line that could negatively influence the peak detection.

Here the data line (these peaks however do not exceed the default thresfold)

image

What can they be (scanner drift or hand movements?) and do I need to filter the data before insert them in the PhysIO script (in order to detect the peaks)? And in case which filter would you suggest me?

Moreover, since for my study I need to compare the number of heartbeats counted by the subjects to those recorded, I need the best quality of peaks detection and be sure all the peaks are correctly detected. For this reason I put a more conservative thresholds (e.g, 20 or 40 %) in order to do the post-hoc manual peak selection and it works. But when I've finished to 'set the triggers', an error appeared and no 'posthoc_cpulse.mat' is saved. Could you help me to resolve this problem?

image

I also would like to know, when I am performing the manual peak selection, if the peaks without the emply circle at the top (those indicated with the blu arrows) are those not detected, or just not counted for other reasons.

image

I profoundly trust your automatic peak detection, but I can not explain t myself why here some data are not marked with the 'cardiac pulse (heartbeat) marker (N = 682)' and some other yes. image

image

Also here it is clear that some light red lines are not marked, so is it the normal peak detection process?

image

I apologies for the long issue and for all my doubts. I just need the maximum quality of heartbeat detection for my study and the main problem I think is with the error during the post-hoc manual peak selection.

I woul be deeply grateful if you cound help me with this problems and give me an opinion about my data (I have attached the file with the script and data from one subject)

Here the file: physio_data.zip

Thanks you in advance,

Alessio

mrikasper commented 4 years ago

Dear Alessio,

thank you for the detailed description and the example dataset. Let's unpack this:

  1. There was indeed a small bug concerning figure handling for the manual peak selection, sorry for that! I fixed it now and will update the TAPAS development branch later today.
  2. The outlier "spikes" are not related to scanner drift, and most of them not related to hand movement. What I see is that the heart rate is rather high in this subject, so the default maximum heart rate setting of 90 beats per minute precludes the detection of peaks closer together. I ran your batch while setting

physio.preproc.cardiac.initial_cpulse_select.max_heart_rate_bpm = 120;

which significantly reduced the number of spikes and avoided skipping every 2nd peak.

Before: image

After: image

There are still some spikes remaining that you should correct manually (not sure whether an adjustment of the filtering would help, because it's very abrupt amplitude changes of the PPU signal).

Example amplitude changes: image

I hope that helps!

All the best, Lars