tags:

views:

396

answers:

3

I have the following problem. I have brain regions and correlations between them. The brain regions I know the distances of. Now, we expect the correlations to be negatively correlated to the distance between the brain regions. So when we increase distance correlation goes down to zero. The expectation is that this is by 1/D^2.

I want to visualize my correlation matrix to check for abnormalities. I have already some other implementations like Taiyun's correlation matrix visualization and a simple 2D scatterplot with the 1/D^2 curve as a blue line.

Next I want to have something based on correlation circles.

The brain regions I have created a Node class for. So my brain regions are nodes. I mimic correlation with Edges. My Edges have a sourceNode and a destinationNode and also a correlation and distance so I can couple them to the correct Node. The distance and correlation are needed for table lookup (backcoupling to regionID and regionName etc).

Now what I want is to place all nodes on a circle so that the nodes which have a small distance to eachother are placed close together, and nodes far away from eachother are placed further away. This way the strong edges (which are thick) are close to eachother. And when you have a very strong edge crossing the circle it is awkward and the eye spots it easily. Of course I seek an optimum, as pointed out below a single real answer does not excist.

I have been searching google but since I do not have a clue what to search for I have found no results. I suspect there is a name for a standard algorithm for this but i do not know it. A link to such an algorithm is okay too.

The thing I came up with so far is to arrange the nodes on the circle in such a way that the SUM of all distances is smallest. But for this I need to make a sort of point system so regions which are close to each other and placed close to each other get for instance some +points and points close to each other but placed further away from each other get some downpoints. Now optimize the point algorithm and get highest outcome.

Any tips on this matter? My math is not that great ;). I'm currently googling on circles, nodes, weights..

Note

If you have any other bright ideas to visualize the matrix be sure to PM me about it, or comment here :).

+2  A: 

I suggest you use an energy minimization algorithm to place your nodes on the circle in a way that minimizes something like square(distance on circle - distance in brain). Then thicken the edges as you describe and the visualization should be complete.

redtuna
+1  A: 

It's possible that GraphViz has some links to algorithms. Alternatively, you may be able to get your data into a format that GraphViz accepts and run it through that.

Vatine
At first I want to ty and keep it inside my app, without using GraphViz. But thanks for the hint. Could not find anything really interesting except a link to a book.
bastijn
+3  A: 
tom10
Therefor i seek an optimum, which does have a solution. I seek an answer where as many as possible are placed correctly and some not.
bastijn
I totally agree with the importance of visualization. But to me it seems that the approximations required are beyond what you can expect others to supply since only you can choose which ways to warp and tear the space to keep consistent what's important to you (and mathematically, distance can't be one of these things). I suggest that you might have more luck if you rephrase the problem in a more open way (like your last sentence), and rather than ask for an impossible mapping, ask for suggestions of visualizations that might show you what you want to know.
tom10
No, I def. want this option since it is my mind now :). It is possible but maybe my explanation is not right. I do seek an optimum, if totally random is the best option that would be optimum. But first I want to seek for a better placement. I think it must be possible to at least have a majority of points which are in real distance close together, together on the circle.
bastijn
Wow, thanks for the shear effort of putting this together in such detail. I will def. test this when I'm home. I will not mark it for an answer until I have my final routine (so I can post my own if it performs better) but credits will be given :).
bastijn
No problem... I was trying to explain how to do it, and then it just seemed easier to do it. (Though it's certainly not the easiest 20 pts I've ever earned on SO, but clearly that wasn't the point. It's just and interesting question.)
tom10
I have marked you as the final answer. Thanks again. This post led me to the final arrangement. I'm still tweaking but it is not really different from your approach. I will post some pics maybe tomorrow.
bastijn
I'm happy to hear it's working for you. I've looked for the plots you mentioned, and look forward to seeing them when you get them up.
tom10