open-discussion > Brain Connectivity Toolbox - graphy theory measures
Showing 1-4 of 4 posts
Display:
Results per page:
Jan 4, 2022  03:01 PM | Jose Teles
Brain Connectivity Toolbox - graphy theory measures
Dear Sirs,

I am trying to extract graph theory measures using the brain connectivity toolbox (BCT).

I have created the connectivity matrices in ExploreDTI (see image attached with the output of the weighted and binary matrices).

Then I added the files with the CMs and the BCT to Matlab (by going into set path and add folder and save - see attached)

I then used the command window to type the functions in order to get the graph theory measures but I end up getting an error (see below an example where I try to extract efficiency measure from a binary CM):

>> efficiency_bin.m ('06_DWI_FP_MD_C_trafo_Tracts_CSD_binary_PASS')
Unable to resolve the name efficiency_bin.m.

I get the error message "Unable to resolve the name efficiency_bin.m" and I am now stuck.

Can anyone provide input on what can be the reason for this error?

Any help would be deeply appreciated.
Best wishes,
Jose Teles
Attachment: images_gtm.docx
Jan 4, 2022  04:01 PM | Sheng-Yao Huang
RE: Brain Connectivity Toolbox - graphy theory measures
Hi, Jose Teles

You can try to change the name, and don't use the number as the first.

Example: efficiency_bin.m ('DWI_FP_MD_C_trafo_Tracts_CSD_binary_PASS')

Best wishes,

Vic
Jan 5, 2022  02:01 PM | Gyula Gyebnár - Semmelweis University, Medical Imaging Centre, Department of Neuroradiology
RE: Brain Connectivity Toolbox - graphy theory measures
Hi Jose,

There are actualy three problems with the way you tried to call the function.

When calling matlab functions, you generally do not need the file extension. (This is what the error message is about.)

Also the BCT function expects the connectivity matrix itself and not the name of the file that contains it.
(I am guessing from the command you included that what you give the function as the argument is the name of the .mat file).

And there is also a more specific problem with this combination of the toolboxes that you use which will require an additional step.

So try the following:
1. Load the .mat file.
2. If I remember correctly, the connectivity matrices you get from ExploreDTI are stored in single variables named 'CM'.
3. In order for the BCT functions to work with ExploreDTI-s connectivity matrices, you need to zero out the values along the main diagonal (self connections)
4. Pass this processed CM to the BCT function.

In order to avoid mixing up the files, you can always read into a temporary variable (I'm guessing once again that you are going to use the functions on multiple subjects).

For example:
CM_Var = load( '06_DWI_FP_MD_C_trafo_Tracts_CSD_binary_PASS.mat' ); % This will be loaded as a struct, from which you can access the contents of the .mat file)
Connectivity_Matrix_Temp = CM_Var.CM;
Connectivity_Matrix_Temp = Connectivity_Matrix_Temp .* ~eye( size( Connectivity_Matrix_Temp ) );
Result = efficiency_bin( Connectivity_Matrix_Temp );

Hope this works.
Best wishes,
Gyula
Jan 7, 2022  02:01 PM | Jose Teles
RE: Brain Connectivity Toolbox - graphy theory measures
Dear Gyula,

Thank you very much for your time to explaining the error and the solution.

Your solution worked perfectly and I was able to get the efficiency measure. There is also an alternative way to extract this measure using :

>> load( '06_DWI_FP_MD_C_trafo_Tracts_CSD_binary_PASS.mat' )
>> efficiency_bin(CM)


May I ask one theoretical question. How can I be sure if these CMs and directed and/or indirected?
It seems well defined by the output I get from ExploreDTI which CMs are binary or weighted (see image attached) but I can distingush if they are directed or indirected? By default ExploreDTI provides directed or undirected CMs do you know?

Thank you again for your feedback





Originally posted by Gyula Gyebnár:
Hi Jose,

There are actualy three problems with the way you tried to call the function.

When calling matlab functions, you generally do not need the file extension. (This is what the error message is about.)

Also the BCT function expects the connectivity matrix itself and not the name of the file that contains it.
(I am guessing from the command you included that what you give the function as the argument is the name of the .mat file).

And there is also a more specific problem with this combination of the toolboxes that you use which will require an additional step.

So try the following:
1. Load the .mat file.
2. If I remember correctly, the connectivity matrices you get from ExploreDTI are stored in single variables named 'CM'.
3. In order for the BCT functions to work with ExploreDTI-s connectivity matrices, you need to zero out the values along the main diagonal (self connections)
4. Pass this processed CM to the BCT function.

In order to avoid mixing up the files, you can always read into a temporary variable (I'm guessing once again that you are going to use the functions on multiple subjects).

For example:
CM_Var = load( '06_DWI_FP_MD_C_trafo_Tracts_CSD_binary_PASS.mat' ); % This will be loaded as a struct, from which you can access the contents of the .mat file)
Connectivity_Matrix_Temp = CM_Var.CM;
Connectivity_Matrix_Temp = Connectivity_Matrix_Temp .* ~eye( size( Connectivity_Matrix_Temp ) );
Result = efficiency_bin( Connectivity_Matrix_Temp );

Hope this works.
Best wishes,
Gyula
Attachment: images_CMs.png