cliarg_rest = sys.argv[2:] # list of all subjects as numpy array subject_list = np.array(cliarg_rest) # e.g. /ptmp/sbayrak/hcp/* cnt_files = 4 N_user = None N = len(subject_list) for i in range(0, N): subject = subject_list[i] print "do loop %d/%d, %s" % (i+1, N, subject) # load time-series matrix of the subject K = hcp_util.t_series(subject, cnt_files=cnt_files, N_cnt=N_user) # get upper-triangular of correlation matrix of time-series as 1D array K = hcp_util.corrcoef_upper(K) print "corrcoef data shape: ", K.shape # Fisher r to z transform on the correlation upper triangular K = fisher_r2z(K) # sum all Fisher transformed 1D arrays if i == 0: SUM = K else: SUM = ne.evaluate('SUM + K') del K
if args.nuser != None: N_cnt = args.nuser ## end parse command line arguments # you may override this to make testing faster cnt_files = 4 N = len(subject_list) for i in range(0, N): subject = subject_list[i] print "do loop %d/%d, %s" % (i+1, N, subject) # load time-series matrix of the subject K = hcp_util.t_series(subject, cnt_files=cnt_files, N_first=N_first, N_cnt=N_cnt) print K.shape # get upper-triangular of correlation matrix of time-series as 1D array K = hcp_util.corrcoef_upper(K) print "corrcoef data upper triangular shape: ", K.shape ten_percent = 0.1 if args.histogram == "all": # get histogram of upper-triangual array dbins = 0.01 bins = np.arange(-1, 1+dbins, dbins) x, bins = np.histogram(K, bins) # find out threshold value for top 10 percent back_sum = 0 for idx in range(x.shape[0]-1, -1, -1):