Exemple #1
0
def test_RSN_fetch_nodes_and_labels2():
    # Set example inputs
    base_dir = str(Path(__file__).parent / "examples")
    #base_dir = '/Users/rxh180012/PyNets-development/tests/examples'
    parlistfile = base_dir + '/whole_brain_cluster_labels_PCA200.nii.gz'
    atlas_select = 'whole_brain_cluster_labels_PCA200'
    dir_path = base_dir + '/997'
    func_file = dir_path + '/sub-997_ses-01_task-REST_run-01_bold_space-MNI152NLin2009cAsym_preproc_masked.nii.gz'
    ref_txt = None
    parc = False
    use_AAL_naming = True

    start_time = time.time()
    [RSN_label_names, RSN_coords, atlas_name, _, _, par_max, parlistfile,
     _] = nodemaker.fetch_nodes_and_labels(atlas_select, parlistfile, ref_txt,
                                           parc, func_file, use_AAL_naming)
    print("%s%s%s" %
          ('RSN_fetch_nodes_and_labels (Spherical Nodes) --> finished: ',
           str(np.round(time.time() - start_time, 1)), 's'))

    assert parlistfile is not None
    assert par_max is not None
    assert atlas_name is not None
    assert RSN_coords is not None
    assert RSN_label_names is not None
Exemple #2
0
def test_RSN_fetch_nodes_and_labels1():
    # Set example inputs
    base_dir = str(Path(__file__).parent / "examples")
    parlistfile = base_dir + '/whole_brain_cluster_labels_PCA200.nii.gz'
    atlas = 'whole_brain_cluster_labels_PCA200'
    dir_path = base_dir + '/002/fmri'
    func_file = dir_path + '/002.nii.gz'
    ref_txt = None
    parc = True
    use_AAL_naming = True

    start_time = time.time()
    [
        RSN_labels, RSN_coords, atlas_name, _, parcel_list, par_max,
        parlistfile, _
    ] = nodemaker.fetch_nodes_and_labels(atlas, parlistfile, ref_txt, parc,
                                         func_file, use_AAL_naming)
    print("%s%s%s" %
          ('RSN_fetch_nodes_and_labels (Parcel Nodes) --> finished: ',
           str(np.round(time.time() - start_time, 1)), 's'))

    assert parlistfile is not None
    assert par_max is not None
    assert parcel_list is not None
    assert atlas_name is not None
    assert RSN_coords is not None
    assert RSN_labels is not None