WhitakerLab / scona

Code to analyse structural covariance brain networks using python.
https://whitakerlab.github.io/scona/
MIT License
68 stars 33 forks source link

Circular network visualisation with brain pictures at the nodes #46

Open KirstieJane opened 7 years ago

KirstieJane commented 7 years ago

Back in the day I wrote a little function called plot_circular_network.py and now @lzdh would like to use it to visualise her data.

Inputs

A correlation matrix and a directory with brain images named in ascending numerical order (starting with 0000.png).

We'll also need to pass a threshold as we can't visualise ALL of these.

Output

A pretty picture of top X edges in a network with brain images around the outside representing the different nodes in the network.

What we already have

get_circular_layout takes a graph (G) and a data frame (df) and returns pos_dict, theta_dict.

plot_circular_network.py plots the network and returns a figure.

What we want

A circle with brains around the outside and some edges connecting these different nodes representing the network.

Stretch goals

KirstieJane commented 7 years ago

You may be able to just get rid of this section?

    # Put the measures you care about together
    # in a data frame
    df = pd.DataFrame({ 'degree' : measure_dict['Degree_CT_covar_ones_all_COST_10'] ,
                        'module' : measure_dict['Module_CT_covar_ones_all_COST_10'],
                        'renum_module' : measure_dict['Renumbered_Module_CT_covar_ones_all_COST_10'],
                        'von_economo' : measure_dict['von_economo'],
                        'lobes' : measure_dict['lobes'],
                        'x' : measure_dict['centroids'][:,0],
                        'y' : measure_dict['centroids'][:,1],
                        'z' : measure_dict['centroids'][:,2]})
    df['node'] = range(len(df['degree']))
Islast commented 7 years ago
KirstieJane commented 7 years ago

Happy to use a different tool if it exists. I’ve never used circos.ca but those images look beautiful. The challenge is whether it’s easy to use? Easy to add the brain pics??

Islast commented 7 years ago

It's very lovely, but a three-weeker to install according to jessie

Islast commented 7 years ago

d3.js is a javascript library for creating figures. it can do quite alot, for example very nice circular layouts so it might be a good idea to make bnip interoperable with this

lzdh commented 7 years ago

It does look nice! 😃 but I've never coded in java before, not sure how easy it is to pick up. It took me quite a long time picking up circos 😢 but we could certainly try :) thank you Isla!