Example #1
0
def volume_based_var(atlas_type, volume_type, atlas_main_folder,
                     subj_main_folder):

    file_name = f'{volume_type}_by_' + atlas_type
    atlas_labels, mni_atlas_file_name, idx = atlas_and_idx(
        atlas_type, atlas_main_folder)
    vol_mat = all_subj_add_vals(file_name, atlas_labels, subj_main_folder, idx)
    subj_idx = subj_2_include(subj_main_folder, file_name)

    return vol_mat, mni_atlas_file_name, idx, subj_idx
Example #2
0
import glob,os
from reading_from_xls.read_details_from_subject_table import *
from network_analysis.nodes_network_properties import *
from calc_corr_statistics.pearson_r_calc import *
from parcellation.group_weight import atlas_and_idx, weight_atlas_by_add, save_as_nii


if __name__ == "__main__":
    main_subj_folders = r'C:\Users\Admin\Desktop\Language'
    atlas_main_folder = r'C:\Users\Admin\my_scripts\aal\yeo'
    atlas_type = 'yeo7_200'
    atlas_labels, mni_atlas_file_name, idx = atlas_and_idx(atlas_type, atlas_main_folder)

    table1 = SubjTable(r'C:\Users\Admin\Desktop\Language\Subject list - Language.xlsx', 'Sheet1')
    eff_num_dict = {}
    eff_add_dict = {}
    wos1 = []
    lws = []
    n_subj= 0

    for sub in glob.glob(f'{main_subj_folders}{os.sep}*{os.sep}'):
        sn = sub.split(os.sep)[-2]
        num_mat_name = sub + 'non-weighted_wholebrain_5d_labmask_yeo7_200_nonnorm.npy'
        if os.path.exists(num_mat_name):
            n_subj+=1
            num_mat = np.load(num_mat_name)
            eff_num = (get_local_efficiency(cm=num_mat))
            eff_num_dict = merge_dict(eff_num_dict, eff_num)

            add_mat_name = sub + 'weighted_wholebrain_5d_labmask_yeo7_200_nonnorm.npy'
            add_mat = np.load(add_mat_name)
Example #3
0
import glob, os
from reading_from_xls.read_details_from_subject_table import *
from calc_corr_statistics.pearson_r_calc import *
from parcellation.group_weight import atlas_and_idx, weight_atlas_by_add, save_as_nii
from network_analysis.specific_functional_yeo_network import network_id_list
from network_analysis.edge_betweeness_centrality_mat import mat_ebc

if __name__ == "__main__":
    main_subj_folders = r'C:\Users\Admin\Desktop\Language'
    atlas_main_folder = r'C:\Users\Admin\my_scripts\aal\yeo'
    atlas_type = 'yeo7_200'
    #id1 = network_id_list(network_type='salventattn')-1
    #id2 = network_id_list(network_type='default')-1
    #idx = id1+id2
    atlas_labels, mni_atlas_label, idx = atlas_and_idx(atlas_type,
                                                       atlas_main_folder)

    table1 = SubjTable(
        r'C:\Users\Admin\Desktop\Language\Subject list - Language.xlsx',
        'Sheet1')
    wos1 = []
    lws = []
    n_subj = 0
    ebc_num = np.zeros((len(idx), len(idx), 1))
    ebc_add = np.zeros((len(idx), len(idx), 1))

    for sub in glob.glob(f'{main_subj_folders}{os.sep}*{os.sep}'):
        sn = sub.split(os.sep)[-2]
        num_mat_name = sub + 'non-weighted_wholebrain_5d_labmask_yeo7_200_nonnorm.npy'
        if os.path.exists(num_mat_name):
            n_subj += 1