Hi all,

I am using in a bash terminal to turn respiratory and cardiac tsv.gz files into regressors for 1st level analysis.
I kept getting this error and any suggestion is greatly appreciated!
-phys_file sub-test_ses-test_task-reward_recording-cardiac_physio.tsv.gz
-phys_json sub-test_ses-test_task-reward_recording-cardiac_physio.json
-v 2
-n 72
-prefix physio_card_regressors.1D

Traceback (most recent call last):
File “/Users/xiy/abin/”, line 687, in
File “/Users/xiy/abin/”, line 279, in retro_ts
cardiac_peak, error = peak_finder(cardiac_info,v=phys_dat[k])
File “/Users/xiy/abin/lib_RetroTS/”, line 517, in peak_finder
r[“p_trace_r”] = interp1d(
File “/Users/xiy/opt/anaconda3/lib/python3.8/site-packages/scipy/interpolate/”, line 467, in init
self._y = self._reshape_yi(self.y)
File “/Users/xiy/opt/anaconda3/lib/python3.8/site-packages/scipy/interpolate/”, line 110, in _reshape_yi
** return yi.reshape((yi.shape[0], -1))**
ValueError: cannot reshape array of size 0 into shape (0,newaxis)

I am following the suggestions from this post:
Same error with respiratory files. Specifying p instead of json file yielded the same error.
Upon inspection, physio files look normal (two columns: timepoints, amplitude).
Please find the linked de-identified physio and json files for error replication.
Thank you all!

Looks like you have some NAN values in your physio file. Interpolating those took care of the first issue for me. But another error is caused due to having a trigger column but no cardiac column in your json/tsv.gz files.

Hi Peter,

Thank you so much for pointing out the problems!
Following your suggestions, I generated one respiratory 1D regressor.
-r sub-test_ses-test_task-reward_recording-respiratory_physio_intp.tsv
-phys_json sub-test_ses-test_task-reward_recording-respiratory_physio.json
-v 2
-p 50
-n 72
-respiration_out 1 -cardiac_out 0
-prefix physio_resp_regressors.1D

One regressor for the cardiac data.
-c sub-test_ses-test_task-reward_recording-cardiac_physio_intp.tsv
-phys_json sub-test_ses-test_task-reward_recording-cardiac_physio.json
-v 2
-p 250
-n 72
-prefix physio_card_regressors.1D
-respiration_out 0
-cardiac_out 1
-rvt_out 0

Do the 1D regressors under Corrected files look normal to you?
Thank you so much. :slight_smile: