@@ -1084,6 +1084,8 @@ def is_outlier(points, thresh=3.5):
1084
1084
def cosine_filter (data , timestep , period_cut , remove_mean = True , axis = - 1 ):
1085
1085
datashape = data .shape
1086
1086
timepoints = datashape [axis ]
1087
+ if datashape [0 ] == 0 :
1088
+ return data , np .array ([])
1087
1089
1088
1090
data = data .reshape ((- 1 , timepoints ))
1089
1091
@@ -1115,6 +1117,8 @@ def regress_poly(degree, data, remove_mean=True, axis=-1):
1115
1117
1116
1118
datashape = data .shape
1117
1119
timepoints = datashape [axis ]
1120
+ if datashape [0 ] == 0 :
1121
+ return data , np .array ([])
1118
1122
1119
1123
# Rearrange all voxel-wise time-series in rows
1120
1124
data = data .reshape ((- 1 , timepoints ))
@@ -1261,7 +1265,7 @@ def compute_noise_components(imgseries, mask_images, components_criterion=0.5,
1261
1265
components_criterion = - 1
1262
1266
mask_names = mask_names or range (len (mask_images ))
1263
1267
for name , img in zip (mask_names , mask_images ):
1264
- mask = img .get_data ().astype (np .bool )
1268
+ mask = nb . squeeze_image ( img ) .get_data ().astype (np .bool )
1265
1269
if imgseries .shape [:3 ] != mask .shape :
1266
1270
raise ValueError (
1267
1271
'Inputs for CompCor, timeseries and mask, do not have '
0 commit comments