likeajumprope/tapas

Export preprocessed traces and derived measures (HRV, RVT) at original sampling rate, preferably as BIDS

mrikasper opened this issue · 3 comments

Create a function to write out continuous physiological recordings physio.ons_secs.[t,c,r,svolpulse] according to BIDS in a function, e.g., code/readin/tapas_physio_write_physlogfiles_BIDS.m

{
   "SamplingFrequency": 100.0,
   "StartTime": -22.345,
    "Columns": ["cardiac", "respiratory", "trigger"],
   "cardiac": {
       "LongName": "ECG channel 1",
       "Description": "Converted Siemens_Tics (VD/VE) *_PULS.log file, cropped and synchronized to scanner and other physiology by TAPAS PhysIO Toolbox v7.2.3",
       "Units": "mV"
   }
 "trigger": {
       "LongName": "Scan Volume Trigger",
       "Description": "Converted Siemens_Tics (VD/VE) *_Info.log file, corrected (for double triggers) and merged by TAPAS PhysIO Toolbox v7.2.3",
       "Units": "1"
   }
}
  • Question: where is output file(s) saved?
    • make it user input parameter, e.g., directly in parameter structure for saving: physio.BIDS_out file
    • Define new parameter(s) in tapas_physio_new, and call in example script
    • or standard prefix as in BIDS, derived from other file/folder names? e.g., as sub-01_task-visual_run-1_physio.{json,tsv.gz}

Correspondence of BIDS columns to ons_secs fields:

  • trigger = ons_secs.svolpulse (is a time vector, has to be transformed into the right row of the .tsv file)
    • exists only after step 2 in main, tapas_physio_create_scan_timing
    • conversion from time in svolpulse to row in .tsv file via find(ons_secs.svolpulse(iVolume)==ons_secs.t) or similar
  • cardiac = ons_secs.c
    • exists after step 1 in main tapas_physio_read_physlogfiles
  • respiratory = ons_secs.r

@mrikasper where can I find the sampling frequency? Is it physio.log_files.sampling_interval? Also I am committing into the branch created from the issue, if you want to have a look

Related to this common user request, it would be great to also allow for the extraction of derived physiological measures (RVT, HRV) at the initial sampling frequency

  • At the moment, this is only possible after the resampling to the volume onsets of the fMRI time series
  • The output should ultimately be BIDS, but a first step would be to provide the traces themselves at raw resolution in the physio.mat file