Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
cubeFUN committed May 22, 2019
1 parent c81ffdf commit 2b1d06c
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions Network_Construction/Step2_Computer_Features.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,26 @@
addpath('../statistical analysis')
T = load('./graphWithROIs_p.mat');

graphWithROIs = T.res;
graphWithROIs = T.dataset.graphWithROIs;
nPetROIs=length(graphWithROIs);

features=zeros(nPetROIs,32);
%calculate features
%min&max spanning tree
%%
%{
fprintf('----------1+2----------');
for k=1:nPetROIs
fprintf('Processing %d th records, waiting...\n',k);
% max 最大生成树 会和当前case的pixel数目多少有关(通常成正比
% 比如第一个case ROI区域边长为57,第三个case边长为654
% 对应两者的feature也是相差一个数量级的关系
% max 最大生成树 会和当前case的pixel数目多少有关(通常成正比
% 比如第一个case ROI区域边长为57,第三个case边长为654
% 对应两者的feature也是相差一个数量级的关系
grapht=-graphWithROIs{k};
graph_sparse=sparse(grapht);
[tree,pred]=graphminspantree(graph_sparse,'Method', 'Kruskal');
features(k,1)=-sum(sum(tree)) / size(graphWithROIs{k},1);
%min 最小生成树
%min 最小生成树
grapht=graphWithROIs{k};
graph_sparse=sparse(grapht);
[tree,~]=graphminspantree(graph_sparse,'Method', 'Kruskal');
Expand Down Expand Up @@ -164,11 +165,11 @@
% efficiency=efficiency/((nNodes*nNodes-nNodes)/2);
% features(k,12)=efficiency;
% end

%}
%max, min and average betweenness
%end
% 中介中心性指的是一个结点担任其它两个结点之间最短路的桥梁的次数
% 这个要超级久的 还没跑 晚上跑吧
% 中介中心性指的是一个结点担任其它两个结点之间最短路的桥梁的次数
% 这个要超级久的 还没跑 晚上跑吧
disp('13 14 15 max, min and average betweenness');
for k=1:nPetROIs
fprintf('Processing %d th records, waiting...\n',k);
Expand All @@ -182,7 +183,7 @@
%disp('first loop');
for j=1:nNodes
if dist(i,j)==0 && i~=j
% 不连通就记为正无穷
% 不连通就记为正无穷
dist(i,j)=inf;
end
if i==j || dist(i,j)~=0
Expand All @@ -192,8 +193,8 @@
end
for t=1:nNodes
t
% 寻找时候可以通过第三点来找到更短的路径
% path记录的是所经过的中间点(如果没有的话就用终点代替
% 寻找时候可以通过第三点来找到更短的路径
% path记录的是所经过的中间点(如果没有的话就用终点代替
for i=1:nNodes
for j=1:nNodes
if dist(i,t)+dist(t,j) < dist(i,j)
Expand Down Expand Up @@ -318,12 +319,12 @@
% for k=1:nPetROIs
% fprintf('Processing %d th records, waiting...\n',k);
% PetROI=imageWithROIs{k};
% % 如果已知的已经是除以体重以后的SUV了,那么这里就直接features(k,23) = SUV就好了
% % 如果已知的已经是除以体重以后的SUV了,那么这里就直接features(k,23) = SUV就好了
% features(k,24)=SUVmean(k,1);
% end
% save ./Data_1108/features_24.mat features -v7.3

%% 增加MIT提取network feature的代码
%% 增加MIT提取network feature的代码

%edge number
disp('25 edge numbers');
Expand Down Expand Up @@ -377,7 +378,7 @@
end

%% too slow, avoid
% % 没算完!!!太慢了!!!
% % 没算完!!!太慢了!!!
disp('31 diameter of the graph');
for k=1:nPetROIs
fprintf('Processing %d th records, waiting...\n',k);
Expand Down

0 comments on commit 2b1d06c

Please sign in to comment.