help > the setting of connectivity matrix
Showing 1-8 of 8 posts
Display:
Results per page:
May 24, 2015  02:05 AM | John Lai
the setting of connectivity matrix
Dear Dr. Zalesky and all experts in NBS:
 
I am Dr. Lai from Taiwan. Recently I try to use your NBS connectome software, I find it is very interesting.
 
However, I probably have 2 questions about the design matrix and connectivity matrix in my study.
 
(1) For example, I have 52 patients and 40 controls, which are already included in the designMatrix4.mat file (92 x2) (Please see the attached). In addition, I have the connectivity matrix derived by the GRENTA toolbox (subject01.txt, 90x90, Please also see the attached). The coordinates uses the AAL 90 coordinates. However, I can not run the results by the NBS like your demo data. Can you suggest how to overcome the problems?
 
(2) In addition, I noted you merged all the matrix files into a the "matrixes.mat" file in your demo data. Can I ask how to merge?
 
Thank you for your kind help.
Sincerely yours
Dr. Lai
May 24, 2015  01:05 PM | Andrew Zalesky
RE: the setting of connectivity matrix
Hi Dr Lai,

The data you have provided all looks fine - no problems that I can see. There is no need to merge the matrix files in one mat file. It should be ok the provide a txt file for each subject. Are you sure you have 92 txt files in the directory where subject01.txt is stored?

What is the error that you get when trying to run?

If you are still having problems, perhaps send me data for 10 subjects only and the correponding design matric for these 10 subjects.

Andrew



 
I am Dr. Lai from Taiwan. Recently I try to use your NBS connectome software, I find it is very interesting.
 
However, I probably have 2 questions about the design matrix and connectivity matrix in my study.
 
(1) For example, I have 52 patients and 40 controls, which are already included in the designMatrix4.mat file (92 x2) (Please see the attached). In addition, I have the connectivity matrix derived by the GRENTA toolbox (subject01.txt, 90x90, Please also see the attached). The coordinates uses the AAL 90 coordinates. However, I can not run the results by the NBS like your demo data. Can you suggest how to overcome the problems?
 
(2) In addition, I noted you merged all the matrix files into a the "matrixes.mat" file in your demo data. Can I ask how to merge?
 
Thank you for your kind help.
Sincerely yours
Dr. Lai[/quote]
May 24, 2015  02:05 PM | John Lai
RE: the setting of connectivity matrix
Dear Dr. Zalesky:

Thank you for your kind suggestion.

It works now.

Can I ask what files of NBS results can be the input of BrainNet Viewer?

How do I save the result files of NBS and what files can be used as the node and edge files for the input of BrainNet Viewer?

Thank you for your kind help.

Best

Dr. Lai
May 25, 2015  07:05 AM | Andrew Zalesky
RE: the setting of connectivity matrix
Hi Dr Lai,

The NBS software will not output a file that can be directly loaded into Brain Net Viewer.

However, you should be able to generate a file for BNV with some simple Matlab manipulations.

Please take a look at the Reference Manual (on NITRC for download) for more details.

Andrew

Originally posted by John Lai:
Dear Dr. Zalesky:

Thank you for your kind suggestion.

It works now.

Can I ask what files of NBS results can be the input of BrainNet Viewer?

How do I save the result files of NBS and what files can be used as the node and edge files for the input of BrainNet Viewer?

Thank you for your kind help.

Best

Dr. Lai
May 25, 2015  08:05 AM | John Lai
RE: the setting of connectivity matrix
Dear Dr. Zalesky and all NBS experts:

Thank you for your suggestion. 

I tried the command from reference manual. However, I got the following error messages.

global nbs; [i,j]=find(nbs.NBS.con_mat{1}); for n=1:length(i)
i_lab=nbs.NBS.node_label{i(n)};
j_lab=nbs.NBS.node_label{j(n)};
stat=nbs.NBS.test_stat(i(n),j(n));
fprintf('%s to %s. Test stat: %0.2f\n',i_lab,j_lab,stat);
end
??? fprintf('%s to %s. Test stat: %0.2f\n',i_lab,j_lab,stat);
|
Error: The input character is not valid in MATLAB statements or expressions.

>> i=1; %Specify node 1 here
j=2; %Specify node 2 here
global nbs; N=nbs.STATS.N; ind_upper=find(triu(ones(N,N),1));
cross_ref=zeros(N,N); cross_ref(ind_upper)=1:length(ind_upper);
cross_ref=cross_ref+cross_ref'; ind=cross_ref(i,j);
fprintf('%0.2f\n',nbs.GLM.y(:,ind));
??? cross_ref=cross_ref+cross_ref'; ind=cross_ref(i,j);
|
Error: The input character is not valid in MATLAB statements or expressions.

Any suggestion for this kind of error message?

Thank you for your kind help.

Best

Dr. Lai
May 25, 2015  09:05 AM | Andrew Zalesky
RE: the setting of connectivity matrix
You need to type these commands in the Matlab window with your keyboard, not copy and paste from the pdf document.

When you copy and paste from the pdf document, the apostrophe character ( ' ) does not work correctly.



Originally posted by John Lai:
Dear Dr. Zalesky and all NBS experts:

Thank you for your suggestion. 

I tried the command from reference manual. However, I got the following error messages.

global nbs; [i,j]=find(nbs.NBS.con_mat{1}); for n=1:length(i)
i_lab=nbs.NBS.node_label{i(n)};
j_lab=nbs.NBS.node_label{j(n)};
stat=nbs.NBS.test_stat(i(n),j(n));
fprintf('%s to %s. Test stat: %0.2f\n',i_lab,j_lab,stat);
end
??? fprintf('%s to %s. Test stat: %0.2f\n',i_lab,j_lab,stat);
|
Error: The input character is not valid in MATLAB statements or expressions.

>> i=1; %Specify node 1 here
j=2; %Specify node 2 here
global nbs; N=nbs.STATS.N; ind_upper=find(triu(ones(N,N),1));
cross_ref=zeros(N,N); cross_ref(ind_upper)=1:length(ind_upper);
cross_ref=cross_ref+cross_ref'; ind=cross_ref(i,j);
fprintf('%0.2f\n',nbs.GLM.y(:,ind));
??? cross_ref=cross_ref+cross_ref'; ind=cross_ref(i,j);
|
Error: The input character is not valid in MATLAB statements or expressions.

Any suggestion for this kind of error message?

Thank you for your kind help.

Best

Dr. Lai
May 28, 2015  07:05 AM | John Lai
RE: the setting of connectivity matrix
Dear Dr. Zalesky and all NBS experts:

Thank you for your instructions. It works after manual typing.

However, can I ask how should I obtain the node and edge files from the NBS?

Because the BrainNet Viewer needs the above files, but the reference manual seems without such information.

Thank you for your kind help.

Best

Dr. Lai
May 29, 2015  12:05 AM | Andrew Zalesky
RE: the setting of connectivity matrix
Hi Dr Lai,

The nodes and edges are stored in the Matlab variables called: nbs.NBS

You might need to manipulate the format of these variables slightly to suit the format required by BrainNetViewer. In other words, you cannot directly input nbs.NBS into the BrainNet.

This might require some basic Matlab programming skills.

Alternatively, you might want to use the image provided by the NBS software.

Andrew


Originally posted by John Lai:
Dear Dr. Zalesky and all NBS experts:

Thank you for your instructions. It works after manual typing.

However, can I ask how should I obtain the node and edge files from the NBS?

Because the BrainNet Viewer needs the above files, but the reference manual seems without such information.

Thank you for your kind help.

Best

Dr. Lai