def stat_computed_hurst(metric= ['wavelet', 'dfa', 'welch'], regu = ['off', 'tv', 'l2'], INPUT_PATH = '/volatile/hubert/beamer/test_hurst/', OUTPUT_PATH=None): for met in metric: for reg in regu: conn = Hurst_Estimator(metric=met, mask=dataset.mask, regu=reg, n_jobs=5) os.write(1,'load\n') conn.load_map(INPUT_PATH) fc = conn.hurst os.write(1,'stat\n') stat_function_tst(conn, met+' '+reg+' ', OUTPUT_PATH) stat_ttest_function(conn, met+' '+reg+' ', OUTPUT_PATH) plt.show()
def stat(metric='wavelet', regu='off', lbda = 1, OUTPUT_PATH = '/volatile/hubert/beamer/HEES0/'): conn = Hurst_Estimator(metric=metric, lbda = lbda, mask=dataset.mask,smoothing_fwhm=0, regu=regu, n_jobs=5) os.write(1,'load\n') conn.load_map(INPUT_PATH = OUTPUT_PATH, save_file= 'hurstmap_metric_wavelet_regu_tv' +str(lbda)) os.write(1,'stat\n') if regu=='off': OUTPUT_PATH = os.path.join(OUTPUT_PATH, metric) else: OUTPUT_PATH = os.path.join(OUTPUT_PATH, metric, regu) stat_function(conn, prefix = 'lbda' + str(lbda), OUTPUT_PATH=OUTPUT_PATH) return conn
def diff_computed_hurst(metric='wavelet', regu='off', INPUT_PATH = '/volatile/hubert/beamer/test_hurst/', OUTPUT_PATH=''): conn = Hurst_Estimator(metric=metric, mask=dataset.mask, regu=regu, n_jobs=5) os.write(1,'load\n') conn.load_map(INPUT_PATH) fc = conn.hurst os.write(1,'stat\n') tst = ttest_group(['av', 'v'], .05, fc) vmean_avmean = np.mean([fc[i] for i in dataset.group_indices['v']], axis=0) - np.mean([fc[i] for i in dataset.group_indices['av']], axis=0) vmean_avmean[tst == 0] = 0 img = conn.masker.inverse_transform(vmean_avmean) plot_stat_map(img) plt.show()
def stat_computed_hurst(metric=['wavelet', 'dfa', 'welch'], regu=['off', 'tv', 'l2'], INPUT_PATH='/volatile/hubert/beamer/test_hurst/', OUTPUT_PATH=None): for met in metric: for reg in regu: conn = Hurst_Estimator(metric=met, mask=dataset.mask, regu=reg, n_jobs=5) os.write(1, 'load\n') conn.load_map(INPUT_PATH) fc = conn.hurst os.write(1, 'stat\n') stat_function_tst(conn, met + ' ' + reg + ' ', OUTPUT_PATH) stat_ttest_function(conn, met + ' ' + reg + ' ', OUTPUT_PATH) plt.show()
def diff_computed_hurst(metric='wavelet', regu='off', INPUT_PATH='/volatile/hubert/beamer/test_hurst/', OUTPUT_PATH=''): conn = Hurst_Estimator(metric=metric, mask=dataset.mask, regu=regu, n_jobs=5) os.write(1, 'load\n') conn.load_map(INPUT_PATH) fc = conn.hurst os.write(1, 'stat\n') tst = ttest_group(['av', 'v'], .05, fc) vmean_avmean = np.mean( [fc[i] for i in dataset.group_indices['v']], axis=0) - np.mean( [fc[i] for i in dataset.group_indices['av']], axis=0) vmean_avmean[tst == 0] = 0 img = conn.masker.inverse_transform(vmean_avmean) plot_stat_map(img) plt.show()
def comparison(lbdatv = [0.5,1,2,3,4,5,10,15], lbdal2=[5,10,15,20,25,40], OUTPUT_PATH='/volatile/hubert/beamer/HEES0/'): conn = Hurst_Estimator(mask=dataset.mask) for lbda in lbdatv: os.write(1,'tv' +str(lbda)+'\n') conn.load_map(INPUT_PATH = OUTPUT_PATH, save_file= 'hurstmap_metric_wavelet_regu_tv' +str(lbda)) stat_function(conn, prefix = 'lbda' + str(lbda), OUTPUT_PATH=os.path.join(OUTPUT_PATH, 'wavelet', 'tv')) #fc = conn.hurst[0] #fc[fc==0.4] = 0 #img = conn.masker.inverse_transform(fc) #lbda = '_'.join(str(lbda).split('.')) #plot_stat_map(img, output_file=os.path.join(OUTPUT_PATH, 'wavelet', 'tv'+lbda)) for lbda in lbdal2: os.write(1,'l2' +str(lbda)+'\n') conn.load_map(INPUT_PATH = OUTPUT_PATH, save_file= 'hurstmap_metric_wavelet_regu_l2' +str(lbda)) stat_function(conn, prefix = 'lbda' + str(lbda), OUTPUT_PATH=os.path.join(OUTPUT_PATH, 'wavelet', 'l2')) #fc = conn.hurst[0] #fc[fc==0.4] = 0 #img = conn.masker.inverse_transform(fc) #plot_stat_map(img, output_file=os.path.join(OUTPUT_PATH, 'wavelet', 'l2'+str(lbda))) conn.load_map(INPUT_PATH = OUTPUT_PATH, save_file= 'hurstmap_metric_wavelet_regu_off') stat_function(conn, prefix = 'regu_off', OUTPUT_PATH=os.path.join(OUTPUT_PATH, 'wavelet')) #fc = conn.hurst[0] #fc[fc==0.4] = 0 #img = conn.masker.inverse_transform(fc) #plot_stat_map(img, output_file=os.path.join(OUTPUT_PATH, 'wavelet', 'regu_off')) conn.load_map(INPUT_PATH = OUTPUT_PATH, save_file= 'hurstmap_metric_wavelet_regu_off_presmooth6') stat_function(conn, prefix = 'presmooth', OUTPUT_PATH=os.path.join(OUTPUT_PATH, 'wavelet')) #fc = conn.hurst[0] #img = conn.masker.inverse_transform(fc) #plot_stat_map(img, output_file=os.path.join(OUTPUT_PATH, 'wavelet', 'presmooth')) plt.show()