示例#1
0
def test_plot_all_nonet_no_mask():
    # Set example inputs
    base_dir = str(Path(__file__).parent / "examples")
    #base_dir = '/Users/rxh180012/PyNets-development/tests/examples'
    dir_path = base_dir + '/997'
    network = None
    ID = '997'
    thr = 0.95
    node_size = 2
    smooth = 2
    conn_model = 'sps'
    parlistfile = None
    atlas_select = 'whole_brain_cluster_labels_PCA200'
    mask = None
    prune = 1
    conn_matrix = np.genfromtxt(
        dir_path +
        '/whole_brain_cluster_labels_PCA200/997_Default_est_sps_0.94.txt')
    edge_threshold = '99%'
    labels_file_path = dir_path + '/whole_brain_cluster_labels_PCA200/Default_func_labelnames_wb.pkl'
    labels_file = open(labels_file_path, 'rb')
    label_names = pickle.load(labels_file)
    coord_file_path = dir_path + '/whole_brain_cluster_labels_PCA200/Default_func_coords_wb.pkl'
    coord_file = open(coord_file_path, 'rb')
    coords = pickle.load(coord_file)

    start_time = time.time()
    #coords already a list
    plotting.plot_all(conn_matrix, conn_model, atlas_select, dir_path, ID,
                      network, label_names, mask, coords, edge_threshold, thr,
                      node_size, smooth, prune, parlistfile)
    print("%s%s%s" % ('plot_all --> finished: ',
                      str(np.round(time.time() - start_time, 1)), 's'))
示例#2
0
def test_plot_all_nonet_with_mask():
    ##Set example inputs##
    base_dir = str(Path(__file__).parent / "examples")
    #base_dir = '/Users/PSYC-dap3463/Applications/PyNets/tests/examples'
    dir_path = base_dir + '/997'
    network = None
    ID = '997'
    thr = 0.95
    node_size = 2
    conn_model = 'sps'
    atlas_select = 'whole_brain_cluster_labels_PCA200'
    mask = None
    conn_matrix = np.genfromtxt(
        dir_path + '/whole_brain_cluster_labels_PCA200/997_est_sps_0.94.txt')
    edge_threshold = '99%'
    labels_file_path = dir_path + '/whole_brain_cluster_labels_PCA200/WB_func_labelnames_wb.pkl'
    labels_file = open(labels_file_path, 'rb')
    label_names = pickle.load(labels_file)
    coord_file_path = dir_path + '/whole_brain_cluster_labels_PCA200/WB_func_coords_wb.pkl'
    coord_file = open(coord_file_path, 'rb')
    coords = pickle.load(coord_file)

    plotting.plot_all(conn_matrix, conn_model, atlas_select, dir_path, ID,
                      network, label_names, mask, coords, edge_threshold, thr,
                      node_size)