Brain Connectivity Toolbox requires 'self-self' connections along the main diagonal to be zero

13 views
Skip to first unread message

Chris Whelan

unread,
Dec 11, 2014, 4:11:57 PM12/11/14
to E_...@googlegroups.com
Hi all,

I was wondering whether anyone here has used connectivity matrices generated in ExploreDTI in software pacakges like the Brain Connectivity Toolbox (BCT)? 

Crucially, BCT requires 'self-self' connections along the main diagonal to be zero. I noticed that ExploreDTI does not set these values to zero. BCT also has a hard time recognizing 'NaN' values in the connectivity matrices, so most of these need to be converted to zero.

How has anyone on this message board got on with BCT?

Thanks,

Chris 

Mohammad Hadi Aarabi

unread,
Dec 13, 2014, 9:38:04 AM12/13/14
to E_...@googlegroups.com
Dear Chris,

You can use CM(isnan(CM))=0 to solve your problem. 

Best,

Mohammad

Mohammad Hadi Aarabi

unread,
Dec 13, 2014, 9:40:09 AM12/13/14
to E_...@googlegroups.com
Also you can use this code to save your mat file to txt file :

CM(isnan(CM))=0; fid = fopen('subject01.txt','wt'); for i=1:size(CM,1) fprintf(fid,'%12.6f\t' , CM(i,:)); if i < 90 fprintf(fid, '\n'); end end fclose(fid);

Chris Whelan

unread,
Dec 16, 2014, 4:03:59 PM12/16/14
to E_...@googlegroups.com
Thank you, Mohammad! Do you have any idea how the main diagonal can also be set to zero? This appears to be a requirement of the Brain Connectivity Toolbox. 

Best,

Chris 

Shaofeng Duan

unread,
Dec 16, 2014, 10:03:55 PM12/16/14
to E_...@googlegroups.com
CM(isnan(CM)) = 0;
CM_temp = triu(CM,1); % 'doc triu' for help
CM = CM_temp + CM_temp';

在 2014年12月17日星期三UTC+8上午5时03分59秒,Chris Whelan写道:
Reply all
Reply to author
Forward
0 new messages