{"action":"created","issue":{"url":"https://api.github.com/repos/nilearn/nilearn/issues/441","labels_url":"https://api.github.com/repos/nilearn/nilearn/issues/441/labels{/name}","comments_url":"https://api.github.com/repos/nilearn/nilearn/issues/441/comments","events_url":"https://api.github.com/repos/nilearn/nilearn/issues/441/events","html_url":"https://github.com/nilearn/nilearn/pull/441","id":58078399,"number":441,"title":"[WIP] Connectome plotting","user":{"login":"lesteve","id":1680079,"avatar_url":"https://avatars.githubusercontent.com/u/1680079?v=3","gravatar_id":"","url":"https://api.github.com/users/lesteve","html_url":"https://github.com/lesteve","followers_url":"https://api.github.com/users/lesteve/followers","following_url":"https://api.github.com/users/lesteve/following{/other_user}","gists_url":"https://api.github.com/users/lesteve/gists{/gist_id}","starred_url":"https://api.github.com/users/lesteve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lesteve/subscriptions","organizations_url":"https://api.github.com/users/lesteve/orgs","repos_url":"https://api.github.com/users/lesteve/repos","events_url":"https://api.github.com/users/lesteve/events{/privacy}","received_events_url":"https://api.github.com/users/lesteve/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":26,"created_at":"2015-02-18T15:00:30Z","updated_at":"2015-02-20T19:19:13Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/nilearn/nilearn/pulls/441","html_url":"https://github.com/nilearn/nilearn/pull/441","diff_url":"https://github.com/nilearn/nilearn/pull/441.diff","patch_url":"https://github.com/nilearn/nilearn/pull/441.patch"},"body":"Remaining todos:\r\n\r\n- [x] sparse matrix support (haven't even tried yet)\r\n- [x] add connectome to plot_adhd_covariance.py\r\n- [x] more sanity checks on adjacency_matrix and nodes_coords\r\n\r\nHow it looks:\r\n![connectome_plotting_1](https://cloud.githubusercontent.com/assets/1680079/6249380/2192bae4-b787-11e4-875e-4f37110e7a93.png)\r\n![connectome_plotting_2](https://cloud.githubusercontent.com/assets/1680079/6249387/27f64b9e-b787-11e4-908c-7ad1d1cbd1e0.png)\r\n\r\nA snippet to produce the connectome plots inside a ipython session:\r\n```python\r\nimport numpy as np\r\n\r\nfrom nilearn import image, plotting\r\n\r\n# Need to run the plot_adhd_covariance.py example\r\n%run examples/connectivity/plot_adhd_covariance.py\r\n\r\nimgs = list(image.iter_img(msdl_atlas_dataset.maps))\r\ncoords = np.array([\r\n    map(np.asscalar, plotting.find_xyz_cut_coords(img)) for img in imgs])\r\n\r\ncov = gsc.covariances_[..., plotted_subject]\r\n\r\nfrom nilearn import plotting\r\nnp.random.seed(42)\r\nnode_colors = np.random.rand(39, 3)\r\ndisplay = plotting.plot_connectome(cov, coords,\r\n                                   edges_threshold=0.38,\r\n                                   title='threshold=0.38',\r\n                                   nodes_kwargs={\r\n                                       's': 50, 'c': node_colors})\r\n\r\ndisplay = plotting.plot_connectome(cov, coords,\r\n                                   edges_threshold='70%',\r\n                                   title='threshold=70%',\r\n                                   nodes_kwargs={\r\n                                       's': 50, 'c': node_colors})\r\n\r\n\r\n```\r\n\r\nComments more than welcome while I go through the remaining todos."},"comment":{"url":"https://api.github.com/repos/nilearn/nilearn/issues/comments/75301664","html_url":"https://github.com/nilearn/nilearn/pull/441#issuecomment-75301664","issue_url":"https://api.github.com/repos/nilearn/nilearn/issues/441","id":75301664,"user":{"login":"GaelVaroquaux","id":208217,"avatar_url":"https://avatars.githubusercontent.com/u/208217?v=3","gravatar_id":"","url":"https://api.github.com/users/GaelVaroquaux","html_url":"https://github.com/GaelVaroquaux","followers_url":"https://api.github.com/users/GaelVaroquaux/followers","following_url":"https://api.github.com/users/GaelVaroquaux/following{/other_user}","gists_url":"https://api.github.com/users/GaelVaroquaux/gists{/gist_id}","starred_url":"https://api.github.com/users/GaelVaroquaux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GaelVaroquaux/subscriptions","organizations_url":"https://api.github.com/users/GaelVaroquaux/orgs","repos_url":"https://api.github.com/users/GaelVaroquaux/repos","events_url":"https://api.github.com/users/GaelVaroquaux/events{/privacy}","received_events_url":"https://api.github.com/users/GaelVaroquaux/received_events","type":"User","site_admin":false},"created_at":"2015-02-20T19:19:12Z","updated_at":"2015-02-20T19:19:12Z","body":"> Admittedly I have very little idea how people look at these plots but I\n> assumed that at the very least you want to be able to identify a given\n> node across the three views in which case having a slightly separate\n> color for each node seems like a good idea.\n\nThat's not the way I usually work with these: the location in the brain\ntells me enough. But I see your point.\n\n> If I understand your index suggestion correctly I think that is close\n> to what I have in mind.\n\nCombined with some form of colorbar for nodes that links a color to a\nname, it would be great. However, let's leave that for a second PR.\n"}}