This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function cent = centrality_wani(A, varargin) | |
% function cent = centrality_wani(A, varargin) | |
% | |
% feature: This function calculate four different centrality measures, | |
% including degree, eigenvector, harmonics, and betweenness | |
% centrality measures. This only works for undirected/unweighted | |
% graph for now. | |
% | |
% input: A adjacency matrix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% make a mask for MPFC | |
cl = region(which('atlas_labels_combined.img'), 'unique_mask_values'); %anat_lbpa_thal.img'); %% 'lpba40.spm5.avg152T1.label.nii'); | |
cluster_orthviews(cl, 'unique'); | |
clout = []; | |
% choose MPFC clusters | |
[clout,cl] = cluster_graphic_select(cl,clout); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
datdir = '/Users/clinpsywoo/Documents/2011-2016yr/2014-2015(4th_GS)/Network_modeling/Problem_sets/FB100 dataset/facebook100'; | |
datfiles = filenames(fullfile(datdir, '*mat'), 'absolute'); | |
for i = 1:numel(datfiles) | |
fprintf('\nWorking on %02d/%02d...\t', i, numel(datfiles)); | |
tic; | |
load(datfiles{i}); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
datdir = '/Users/clinpsywoo/Documents/2011-2016yr/2014-2015(4th_GS)/Network_modeling/Problem_sets/FB100 dataset/facebook100'; | |
datfiles = filenames(fullfile(datdir, '*mat'), 'absolute'); | |
for i = 1:numel(datfiles) | |
fprintf('\nWorking on %02d/%02d...\t', i, numel(datfiles)); | |
tic; | |
load(datfiles{i}); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import listdir | |
from os.path import isfile, join | |
import multiprocessing | |
import networkx as nx | |
from sklearn.utils.graph import single_source_shortest_path_length as sssp | |
fb_folder = "just8" | |
def func_sssp(component): |
NewerOlder