def create_bs_imgs(ts_data, block_size, clust_mask_corr_img): import nibabel as nib from nilearn.masking import unmask from pynets.fmri.estimation import timeseries_bootstrap boot_series = timeseries_bootstrap( ts_data.func, block_size)[0].astype('float32') return unmask(boot_series, clust_mask_corr_img)
def test_timeseries_bootstrap(): """Test bootstrapping a sample of time series.""" tseries = np.random.rand(100, 10) bseries = timeseries_bootstrap(tseries, 5) assert np.shape(bseries[0]) == np.shape(tseries) assert len(bseries[1]) == len(tseries)