我有一个4d的.mat文件,它为一个以1.5、2和3 3hz进行扫描的fMRI文件提供了X、Y、Z和T。我想对较低采样率的图像进行插值,以便它们都在3hz。我试过在scipy中使用interpn,但我不明白它的理由。其尺寸为80x64x33xn,具体取决于采样率。
发布于 2017-01-20 13:15:34
由于您只对时间轴进行插值,因此使用interp1d可能会更好。假设您的4d数据是D格式的,并且您的各种时间网格是T15、T2和T3,那么应该非常简单
from scipy.interpolate import interp1d
# next line assumes interpolation along the last dimension of D
# if your data are arranged differently, use axis kwarg
f = interp1d(T15, D)
Dprime = f(T3)其中Dprime是上采样数据。
https://stackoverflow.com/questions/41754456
复制相似问题