cvnlab / GLMsingle

A toolbox for accurate single-trial estimates in fMRI time-series data
BSD 3-Clause "New" or "Revised" License
98 stars 42 forks source link

Interpolation issue in utils.cmapturbo and fix using numpy #137

Closed lukekorthals closed 3 months ago

lukekorthals commented 3 months ago

Bug

Line 41 leads to ValueError: A value in x_new is above the interpolation range. with some value being a few decimals above the upper bound of 255.

for p in range(nchan):
      f.append(interp1d(range(ncols), cols[:,p].T)(xx))

Solution

Using numpy fixed it for me

f.append(np.interp(xx, range(ncols), cols[:,p].T)) 
kendrickkay commented 3 months ago

Thanks @lukekorthals . @iancharest or @jacob-prince can you review and commit?