File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,24 @@ def two_gamma(timepoints):
72
72
73
73
return hrf
74
74
75
+ def size (x ,length ):
76
+ '''
77
+ Parameters
78
+ ----------
79
+ x : floating point array of unknown dimension
80
+ length: integer
81
+
82
+ Returns
83
+ -------
84
+ out : integer array with 'length' elements
85
+ size in each of 'length' dimensions
86
+ '''
87
+
88
+ out = np .ones (length )
89
+ dims = x .ndim
90
+ out [:dims ] = x .shape
91
+
92
+ return out .astype (int )
75
93
76
94
def regress (Y , X , l = 0. ):
77
95
'''
@@ -136,7 +154,6 @@ def correct_autocorr(X, W):
136
154
X_corrected: floating point array (2D)
137
155
timecourses corrected for autocorrelation
138
156
'''
139
-
140
157
rows , cols = size (X , 2 )
141
158
X = np .reshape (X , (rows , cols ))
142
159
X_corrected = np .zeros ((rows , cols ))
You can’t perform that action at this time.
0 commit comments