/**
\page org_mitk_diffusionimagingapp_perspectives_connectomics The Connectomics Perspective

\imageMacro{connectomics_perspective.png,"Icon of the Connectomics Perspective",2.00}

The connectomics perspective is a collection of views which provide functionality for the work with brain connectivity networks. Currently there exist the following views:

\subpage org_mitk_views_connectomicsdata provides network generation either from data or synthetically.

\subpage org_mitk_views_connectomicsnetworkoperations provides functionalies to operate and process on networks and other data.

\subpage org_mitk_views_connectomicsstatistics provides statistical measures for networks.

\subpage org_mitk_views_randomparcellationview provides a method to randomly parcellate a segmentation using different criteria

\section org_mitk_diffusionimagingapp_perspectives_connectomicsNetworkRenderingCustomization Network Rendering Customization

The rendering of the connectomics networks can be customized by changing the associated properties using the property list. A selection of possible options are:

<ul>
  <li> Connectomics.Rendering.Edges.Filtering - Only render edges above a certain threshold
  <li> Connectomics.Rendering.Edges.Gradient.Parameter - Color the edges according to certain parameters
  <li> Connectomics.Rendering.Edges.Radius.Parameter - Change the radius of the edges according to certain parameters
  <li> Connectomics.Rendering.Nodes.Filtering - Only render nodes above a certain threshold
  <li> Connectomics.Rendering.Nodes.Gradient.Parameter - Color the nodes according to certain parameters
  <li> Connectomics.Rendering.Nodes.Radius.Parameter - Change the radius of the nodes according to certain parameters
  <li> Connectomics.Rendering.Scheme - Switch between the MITK rendering scheme using above properties and the very fast, but less customizable rendering scheme for VTK graphs
</ul>

\section org_mitk_diffusionimagingapp_perspectives_connectomicsTrouble Troubleshooting

No known problems.

<B>All other problems.</B><BR>
Please report to the MITK mailing list.
See http://www.mitk.org/wiki/Mailinglist on how to do this.

*/

/**
\page org_mitk_views_connectomicsdata The Connectomics Network Data View

\imageMacro{QmitkConnectomicsDataViewIcon_48.png,"Icon of the Connectomics Network Data View",2.00}

This view can be used to create a network from a parcellation and a fiber image as well as to create synthetic networks.

\imageMacro{dataview.png,"The user interface",4.85}

To create a network select first a parcellation of the brain (e.g. as provided by <a href="http://surfer.nmr.mgh.harvard.edu/">freesurfer</a>  ) by CTRL+Leftclick and secondly a fiber image ( as created using a tractography view). Then click on the "Create Network" button.

<ul>
 <li> "Use label of end position of fibers" will create a network containing a node for every label a fiber ends in
 <li> "Extrapolate label" will avoid creating nodes using FreeSurfer white matter labels and instead extrapolate in which grey matter label the fiber would end
</ul>

Additionally you have the option to create artificial networks, for testing purposes. Currently choices are:
<ul>
  <li> A regular lattice, where each node is placed in a cubic pattern and only connected to its neighbours
  <li> A heterogenic sphere, where one node is placed in the center and connected to all nodes on the shell
  <li> A random network, where nodes are randomly placed on a spherical shell and randomly connected
</ul>

*/

/**
\page org_mitk_views_connectomicsnetworkoperations The Connectomics Network Operations View

\imageMacro{QmitkConnectomicsNetworkOperationsViewIcon_48.png,"Icon of the Connectomics Network Operations View",2.00}

This view can be used modify networks and related data.

\imageMacro{operationsview.png,"The user interface",4.61}

Select a parcellation and press "Convert to RGBA" to create a RGBA image. By doing this conversion it is much easier to discern the different parcels. Furthermore MITK supports 3D visualization of an RGBA image.

Select a network and press "Create Connectivity Matrix Image" to create a 2D image of the connectivity matrix. By default the weight of a connection is used as grey value. Using the "Rescale" option will rescale the weights so highest one is 255. Using the "Binary" option will result in a binary connectivity matrix.

*/


/**
\page org_mitk_views_connectomicsstatistics The Connectomics Statistics View

\imageMacro{QmitkConnectomicsStatisticsViewIcon_48.png,"Icon of the Connectomics Statistics View",2.00}

This view can be used to show statistical analysis of a network.

\imageMacro{statisticsview.png,"The user interface",6.58}

To calculate network statistics select a network in the datamanager. At this time the following statistics are calculated for the entire network:

<ul>
  <li> The number of vertices in the network
  <li> The number of edges in the network
  <li> The number of edges which have the same vertex as beginning and end point
  <li> The average degree of the nodes in the network
  <li> The connection density the network (the number of edges divided by the number of possible edges)
  <li> The unweighted efficiency of the network ( 1 divided by average path length, this is zero for disconnected graphs)
  <li> The global clustering
</ul>

Furthermore some statistics are calculated on a per node basis and displayed as histograms:

<ul>
  <li> The degree of each node
  <li> The (unweighted) betweenness centrality of each node
  <li> The spread of shortest paths between each pair of nodes (For disconnected graphs the shortest paths with infinite length are omitted for readability)
</ul>

*/

/**
\page org_mitk_views_randomparcellationview The Random Parcellation View

\imageMacro{QmitkRandomParcellationIcon.png,"Icon of the Random Parcellation View",2.00}

\tableofcontents

\section org_mitk_views_randomparcellationviewSummary Summary
This view is used to create a random parcellation of a segmented image.
It was designed to parcellate grey matter to acquire random nodes for network analysis.
This document describes how to use this view.

\section org_mitk_views_randomparcellationviewOverview Overview

When parcellating an image you can either do a parcellation and use the generated parcellation. In which case it will have as many parcellation as seed points were specified. Instead you can choose to merge some of the original parcels untill either none below a threshold size remain, or until a specified minimum number of parcels has been reached.
A further option is to "Just Merge Small Parcels". This will result in only neighbouring parcels below a threshold size being merged. Using this option may result in final parcels below the given threshold size if they are not adjacent to another parcel below the threshold size.

In all there are four possibilities to get a random parcellation
<ul>
<li>Without merging
<li>Merging with respect to the number of nodes afterwards
<li>Merging with respect to the number of voxels of the smallest parcel
<li>Merging with respect to the number of voxels of the smallest parcel, where just small parcels are merged
</ul>

\section org_mitk_views_randomparcellationviewUsage Usage

First you have to get a segmentation of the target structure. You can use the Segmentation View to create one.
Select it in the Data Manager. Now you can choose which of the possible ways of parcellation you would like.
See \ref org_mitk_views_randomparcellationviewOverview for these possibilities.
Start the parcellation process using the "Select Random Nodes" button. 
You will get a new image in the Data Manager. Every voxel of a given parcel will have the same value (0 for background).

\section org_mitk_views_randomparcellationviewMethods Methods

This Plug-In uses a kind of region growing algorithm. Random seed voxels are set on the segmentation and each is an own region at the beginning. Then voxels are added iteratively to each smallest region, first just the 6-connected ones and later the 26-connected ones and isolated voxels.
Specific constraints have to be fulfilled before a voxel is added to a region.
The algorithm stops when all voxels are contained in the regions.
For merging it is checked which regions are neighbors of the smallest parcel and then a suitable one,
according to a cost function, is merged to this parcel. When the merging algorithm stops depends on which stop-mechanism is chosen.

*/
