help > knee_pt: y must be at least 3 elements long
Showing 1-2 of 2 posts
Display:
Results per page:
Aug 29, 2018  11:08 AM | Joshua Balsters
knee_pt: y must be at least 3 elements long
Hi 

So here's the message I've been getting for two groups of my multi-site data

Failed 'Voxel-wise HRF deconvolution'
Error using knee_pt (line 129)
knee_pt: y must be at least 3 elements long
In file "/Users/josh/matlab/spm12/toolbox/rsHRF/knee_pt.m" (???), function "knee_pt" at line 129.
In file "/Users/josh/matlab/spm12/toolbox/rsHRF/wgr_rshrf_estimation_canonhrf2dd_par2.m" (v4473), function "wgr_hrf_fit" at line 199.
In file "/Users/josh/matlab/spm12/toolbox/rsHRF/wgr_rshrf_estimation_canonhrf2dd_par2.m" (v4473), function "wgr_hrf_estimation_canon" at line 149.
In file "/Users/josh/matlab/spm12/toolbox/rsHRF/wgr_rshrf_estimation_canonhrf2dd_par2.m" (v4473), function "wgr_rshrf_estimation_canonhrf2dd_par2" at line 38.
In file "/Users/josh/matlab/spm12/toolbox/rsHRF/rsHRF.m" (???), function "rsHRF" at line 180.
In file "/Users/josh/matlab/spm12/toolbox/rsHRF/tbx_cfg_rsHRF.m" (???), function "wgr_vox_ROI_rsHRF" at line 405.

The following modules did not run:
Failed: Voxel-wise HRF deconvolution


A bit of exploration and I think the issue is the TR length which is 3s for these sites. When I go through the code the lag variable for a TR of 3 with default delay variables [4,8] is [1,2], as such the length(lag) is 2 not giving the 3 elements needed for knee_pt. This is my quick assessment of what I think is happening but i'm sure you'll know better. 

Best
Josh
Aug 29, 2018  02:08 PM | daniele marinazzo
RE: knee_pt: y must be at least 3 elements long
Dear Josh

thanks so much for spotting this.
We fixed the knee_pt function such that it now returns the minimum when the input vector has less than three elements, and no longer an error message.

The fix is done in the matlab repo, the python one will be updated very soon (I want to check with the python developer that the pypi package and the docker container are uploaded consistently).

As you can imagine, the estimation (in particular the width and time to peak) will be less accurate for long TRs.
You can also try to increase the lag search interval a bit (both sides of the interval). The [4 8] was actually optimized for short TRs.

thanks again!