Brain Net Viewer

From CCN Wiki
Revision as of 16:31, 3 March 2020 by Chris (talk | contribs) (→‎Generating Node and Edge Files)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Brain Net Viewer is a handy visualization program for spatially rendering brain networks. The latest version can always be found here, and the most recent version (as of September, 2018) can be found in BrainNetViewer_20171031.zip in the UBFS/Software folder.

Installation

  • Either download from the nitrc.org website or copy the .zip file from UBFS.
  • Unzip the archive and move the unzipped folder to your MATLAB home folder.

Running Brain Net Viewer

If the BrainNetViewer directory is in your MATLAB path, you can launch the program from within MATLAB:

>> addpath(genpath('~/Documents/MATLAB/BrainNetViewer')); %You can add this line to your startup.m file!
>> BrainNet

Nodes

Nodes are read from a tab-delimited ASCII text file with a '.node' file extension (there is nothing else remarkable about these files). These files must have 6 columns, though the files do not use column headers:

X (double)     Y (double)     Z (double)     ColorIndex (double)     Size (double)     Label (char)

e.g.:

-54     -61     7     1     0.5     l.IFG
-58     -50     20    1     0.8     -

Notably, the label column cannot be left blank. If there is no appropriate label, use a hyphen character, as in the second row of the example above.

Connections

Connections are between nodes and recorded in an adjacency matrix. If there are N nodes, the adjacency matrix must be N x N.

Generating Node and Edge Files

The Scripts/Matlab/ folder on ubfs contains a Matlab script, coordsToBrainMap for parsing a table of coordinates and lables of edges and generating corresponding .edge and .node files. As it stands, the script takes as a single parameter the name of a tab-delimited file. The file contents are expected to be organized as follows:

Xa (double)   Ya (double)   Za (double)   Label_a (string)   Xb (double)   Yb (double)   Zb (double)   Label_b (string)   weight (double)

e.g.:

-36	 -66	 -10	 Fusiform.L	44	-75	-11	Occipital.Inf.R	8.49
-42	- 58	 -13	 Fusiform.L	-30	-82	-8	Occipital.Inf.L	        3.78

If you're wondering why the labels are delimited with dots instead of the underscores that FreeSurfer label files typically use, it appears that BrainNet Viewer uses the underscore character to indicate that the following character is a subscript, and that makes the labels look a little goofy.