We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 66652a8 commit aed10c8Copy full SHA for aed10c8
nipype/algorithms/confounds.py
@@ -1048,7 +1048,8 @@ def _cosine_drift(period_cut, frametimes):
1048
hfcut = 1./ period_cut # input parameter is the period
1049
1050
dt = frametimes[1] - frametimes[0] # frametimes.max() should be (len_tim-1)*dt
1051
- order = int(np.floor(2*len_tim*hfcut*dt)) # s.t. hfcut = 1/(2*dt) yields len_tim
+ # If series is too short, return constant regressor
1052
+ order = max(int(np.floor(2*len_tim*hfcut*dt)), 1) # s.t. hfcut = 1/(2*dt) yields len_tim
1053
cdrift = np.zeros((len_tim, order))
1054
nfct = np.sqrt(2.0/len_tim)
1055
0 commit comments