@@ -337,6 +337,9 @@ class CompCorInputSpec(BaseInterfaceInputSpec):
337
337
False , usedefault = True ,
338
338
desc = 'Use cosine basis to remove low-frequency trends pre-component '
339
339
'extraction' )
340
+ high_pass_cutoff = traits .Float (
341
+ 128 , usedefault = True , requires = ['high_pass_filter' ],
342
+ desc = 'Cutoff (in seconds) for high-pass filter' )
340
343
repetition_time = traits .Float (
341
344
desc = 'Repetition time (TR) of series - derived from image header if '
342
345
'unspecified' )
@@ -835,14 +838,14 @@ def is_outlier(points, thresh=3.5):
835
838
return timepoints_to_discard
836
839
837
840
838
- def cosine_filter (data , timestep , remove_mean = False , axis = - 1 ):
841
+ def cosine_filter (data , timestep , period_cut , remove_mean = False , axis = - 1 ):
839
842
datashape = data .shape
840
843
timepoints = datashape [axis ]
841
844
842
845
data = data .reshape ((- 1 , timepoints ))
843
846
844
847
frametimes = timestep * np .arange (timepoints )
845
- X = _full_rank (_cosine_drift (128 , frametimes ))[0 ]
848
+ X = _full_rank (_cosine_drift (period_cut , frametimes ))[0 ]
846
849
non_constant_regressors = X [:, :- 1 ]
847
850
848
851
betas = np .linalg .lstsq (X , data .T )[0 ]
@@ -984,7 +987,7 @@ def compute_noise_components(imgseries, mask_images, degree, num_components,
984
987
# If degree == 0, remove mean in same pass
985
988
voxel_timecourses , hpf_basis = cosine_filter (
986
989
voxel_timecourses , repetition_time ,
987
- remove_mean = (degree == 0 ))
990
+ self . inputs . high_pass_cutoff , remove_mean = (degree == 0 ))
988
991
989
992
# from paper:
990
993
# "The constant and linear trends of the columns in the matrix M were
0 commit comments