RetroTS.py problem using Phillips SCANPHYSLOG

Hello AFNI team,

I have a problem concerning the use of RetroTS.py:
I managed to convert SCANPHYSLOG data (from Phillips) in BIDS using:
https://github.com/lukassnoek/scanphyslog2bids
If anyone knows a better way?

I tried to run the command:


/abin/RetroTS.py -phys_file SCANPHYSLOG20210420091530.tsv.gz \
-v 1 -n 600 -prefix physio_regressors.1D -phys_json SCANPHYSLOG20210420091530.json

my .json looks like:


{
    "SamplingFrequency": 496,
    "StartTime": -78.74798387096774,
    "Columns": [
        "cardiac",
        "respiratory",
        "trigger"
    ]
}

SCANPHYSLOG20210420091530.tsv.gz looks like:


1	-1921	0
1	-1921	0
1	-1921	0
1	-1921	0
1	-1921	0
1	-1921	0
1	-1921	0
1	-1921	0
1	-1921	0
1	-1921	0
1	-1921	0
1	-1921	0
1	-1921	0
1	-1921	0
1	-1921	0
1	-1921	0
1	-1921	0
1	-1921	0
1	-1921	0
1	-1921	0
1	-1921	0
1	-1921	0
1	-1921	0
1	-1921	0
1	-1921	0
1	-1921	0
1	-1921	0
1	-1921	0
1	-1921	0
1	-1921	0
1	-1864	0
1	-1864	0
1	-1864	0
1	-1864	0
1	-1864	0
1	-1864	0
1	-1864	0
1	-1864	0
1	-1864	0
1	-1864	0
1	-1921	0
1	-1921	0
1	-1921	0

....

cardiac is not varying since I do not have the data (so it stayed 1)
respiratory is varying
I have got 600 triggers (1) that do correspond to the 600 volumes (or slices)
When running the command I have got:


pause
[]
Traceback (most recent call last):
  File "/home/cgarin/abin/RetroTS.py", line 647, in <module>
    phys_json=opt_dict["-phys_json"]
  File "/home/cgarin/abin/RetroTS.py", line 245, in retro_ts
    cardiac_peak, error = peak_finder(cardiac_info, v=phys_dat[k])
  File "/home/cgarin/abin/lib_RetroTS/PeakFinder.py", line 521, in peak_finder
    bounds_error=False,
  File "/home/cgarin/anaconda3/lib/python3.7/site-packages/scipy/interpolate/interpolate.py", line 468, in __init__
    self._y = self._reshape_yi(self.y)
  File "/home/cgarin/anaconda3/lib/python3.7/site-packages/scipy/interpolate/polyint.py", line 111, in _reshape_yi
    return yi.reshape((yi.shape[0], -1))
ValueError: cannot reshape array of size 0 into shape (0,newaxis)

Any idea of what is going on?

Thank you very much for your help!!
Clem

My first guess would be that you’ve specified -n as 600, which is actually the number of slices within a TR. Try changing that to the number of slices in each volume. I suspect that since you aren’t sampling at sub-TR frequency another error might pop up. But we can start there.

Hello,

Thank you, I was not sure about this. I replaced it but it did not change anything on the error message.

Thank you for your help!
Clément

Hello,
Still stuck with that problem.
Any idea of what I could do to fix it?
Thanks!

Hello,

Sent you a PM with upload instructions. Or you can email it to me: peter (dot) molfese (at) NIH (dot) GOV

-PM

Hi Clem,

Thanks for the sample data that Peter and I could look at.

The program seemed to expect the json files would match what one wanted to compute, and it is now updated to actually apply -cardiac_out (and -repiration_out) in the case of json files. That update should be available now if you would like to try it.

So try adding “-cardiac_out 0” to your current command.

There may be other aspects to deal with, depending on how you plan to use this.

Thanks!

  • rick