-
Notifications
You must be signed in to change notification settings - Fork 576
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] ENH: add connectome strength plot #2028
[WIP] ENH: add connectome strength plot #2028
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2028 +/- ##
==========================================
+ Coverage 92.31% 92.34% +0.03%
==========================================
Files 149 149
Lines 18781 18867 +86
Branches 2290 2302 +12
==========================================
+ Hits 17337 17423 +86
- Misses 922 924 +2
+ Partials 522 520 -2
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #2028 +/- ##
=========================================
- Coverage 94.96% 94.86% -0.1%
=========================================
Files 138 138
Lines 17878 17897 +19
=========================================
+ Hits 16977 16978 +1
- Misses 901 919 +18
Continue to review full report at Codecov.
|
Sorry, we've merge @illdopejake 's PR in master. There are now conflicts to address :(. |
I'll fix that |
Let me know if I can help |
@illdopejake Should be good to be reviewed. |
@glemaitre Looks great! The one thing that we are going to explore, however, is whether the crappy connectomes that we are seeing are because the first several subjects are young children, rather than adults. I will have a look at this and maybe we can set an argument to the fetcher to grab children or adults specifically. That way we, maybe we won't need to download 20 subjects just to run the example. |
fyi just added the PR to a) get adults first, b) choose if you want children or adults. Find it here: #2035 |
display.close() | ||
display = None | ||
|
||
return display |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @glemaitre this is a super long method, refactoring it would be helpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But there is no code duplication. It would not be really meaningful to cut the function into smaller functions if they are not reused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They improve ease of understanding.
Add a |
But there is no code duplication. It would not be really meaningful to cut the function into smaller functions if they are not reused.
+1
|
|
||
adjacency_matrix = np.nan_to_num(adjacency_matrix) | ||
|
||
adjacency_matrix_shape = adjacency_matrix.shape |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the 4 checks below (adjacency shape, nodes shape, both shapes, adjacency symmetry, mask symmetry) could be useful for other connectome plotting functions?
@glemaitre We are aiming for an end of September release. Think this can be included? |
I think this can be merged once rebased. My comment about turning the checks into functions can be ignored or left for a later PR. Hence @glemaitre do you mind rebasing? |
…lot_connectome_strength * 'master' of https://github.com/nilearn/nilearn: (272 commits) [MRG] FIX: orientation problem with plot_glass_brain (nilearn#1888) Import HTMLDocument in its original module to preserve backwards compatibility (nilearn#2162) Fixing malfunctioning allowed-failure section in Travis (nilearn#2160) Update Brainomics fetcher (nilearn#2097) Remove inplace modification in signal.clean (nilearn#2125) Iter age group prediction example (nilearn#2063) Expose bg_img, vmin and vmax in plot_img signature (nilearn#2157) Replac conda with pip in TravisCI setup (nilearn#2141) Core devs doc and add @emdupre (nilearn#2151) Add check for vmin, vmax in plot_surf_roi (nilearn#2052) [ENH] Initial visual reports (nilearn#2019) Renamed test to deduplicate name (nilearn#2144) Fixes nilearn#2029 Handle gzip files without extensions (nilearn#2126) Update Schaefer parcelation to v0.14.3 (nilearn#2138) MAINT: Future-compatible cmap reversal (nilearn#2131) fix openmp crash (nilearn#2140) change nose to pytest on appveyor (nilearn#2130) adding fix to whatsnew fix wrong urls in nki dataset Made Flake8 happy ... # Conflicts: # examples/03_connectivity/plot_sphere_based_connectome.py
CircleCI error: File "/home/circleci/miniconda3/envs/testenv/lib/python3.6/site-packages/sklearn/covariance/graph_lasso_.py", line 247, in graphical_lasso
raise FloatingPointError('The system is too ill-conditioned '
FloatingPointError: The system is too ill-conditioned for this solver. The system is too ill-conditioned for this solver |
Before the OSF problem I was seeing this error. We must not merge this until there is a reliable solution to this problem. |
This is a numerical proble; hence, to move forward on this, we need to localize the problem: with which dataset does it occur ? What is the problem with this dataset. |
I could reproduce it locally, I can look into it tomorrow
|
note that the link above is from another pr: but the error can be reproduced with either pr |
I open a PR on @glemaitre 's branch that fixes the issue for this one: |
@jeromedockes Anything you wanna change? Or imma merge this once green. |
you can merge. I think we should remove the last atlas from the |
I will remove it now, and if we decide otherwise, we can add it back in another PR. |
I will remove it now, and if we decide otherwise, we can add it back in another PR.
why? it's not related to this PR
|
Gah right. No worries. |
…nt_modify_fetch_dev * 'master' of https://github.com/nilearn/nilearn: ENH: add connectome strength plot (nilearn#2028) Fix cache mixin tests (nilearn#2161) Do not fail if metadata cannot be updated for an image (nilearn#2167)
…ctome strength)
* 'master' of github.com:nilearn/nilearn: Fix Flake8 errors overlooked when merging PR nilearn#2028 (Plot connectome strength) (nilearn#2174) ENH: add connectome strength plot (nilearn#2028)
…ecomposition * 'master' of https://github.com/nilearn/nilearn: Fix Flake8 errors overlooked when merging PR nilearn#2028 (Plot connectome strength) (nilearn#2174) ENH: add connectome strength plot (nilearn#2028) Fix cache mixin tests (nilearn#2161) Do not fail if metadata cannot be updated for an image (nilearn#2167) [MRG] Nans in view connectome (nilearn#2166)
…nt_modify_fetch_dev * 'master' of https://github.com/nilearn/nilearn: Removed sub-example due to unfit for lasso dataset - unstable float values (nilearn#2177) Fix Flake8 errors overlooked when merging PR nilearn#2028 (Plot connectome strength) (nilearn#2174)
…smooth-image * 'master' of https://github.com/nilearn/nilearn: (114 commits) [DOC] Update whats_new to reference nilearn#2013 (Merging of several examples) (nilearn#2183) Removed sub-example due to unfit for lasso dataset - unstable float values (nilearn#2177) Fix Flake8 errors overlooked when merging PR nilearn#2028 (Plot connectome strength) (nilearn#2174) ENH: add connectome strength plot (nilearn#2028) Fix cache mixin tests (nilearn#2161) Do not fail if metadata cannot be updated for an image (nilearn#2167) [MRG] Nans in view connectome (nilearn#2166) [MRG] FIX: orientation problem with plot_glass_brain (nilearn#1888) Import HTMLDocument in its original module to preserve backwards compatibility (nilearn#2162) Fixing malfunctioning allowed-failure section in Travis (nilearn#2160) Update Brainomics fetcher (nilearn#2097) Remove inplace modification in signal.clean (nilearn#2125) Iter age group prediction example (nilearn#2063) Expose bg_img, vmin and vmax in plot_img signature (nilearn#2157) Replac conda with pip in TravisCI setup (nilearn#2141) Core devs doc and add @emdupre (nilearn#2151) Add check for vmin, vmax in plot_surf_roi (nilearn#2052) [ENH] Initial visual reports (nilearn#2019) Renamed test to deduplicate name (nilearn#2144) Fixes nilearn#2029 Handle gzip files without extensions (nilearn#2126) ...
…te-req-dev * 'master' of https://github.com/nilearn/nilearn: (336 commits) Release Nilearn 0.6.0 alpha (nilearn#2164) Making fetch_localizer_button_task backwards compatibile (nilearn#2182) [DOC] Update whats_new to reference nilearn#2013 (Merging of several examples) (nilearn#2183) Removed sub-example due to unfit for lasso dataset - unstable float values (nilearn#2177) Fix Flake8 errors overlooked when merging PR nilearn#2028 (Plot connectome strength) (nilearn#2174) ENH: add connectome strength plot (nilearn#2028) Fix cache mixin tests (nilearn#2161) Do not fail if metadata cannot be updated for an image (nilearn#2167) [MRG] Nans in view connectome (nilearn#2166) [MRG] FIX: orientation problem with plot_glass_brain (nilearn#1888) Import HTMLDocument in its original module to preserve backwards compatibility (nilearn#2162) Fixing malfunctioning allowed-failure section in Travis (nilearn#2160) Update Brainomics fetcher (nilearn#2097) Remove inplace modification in signal.clean (nilearn#2125) Iter age group prediction example (nilearn#2063) Expose bg_img, vmin and vmax in plot_img signature (nilearn#2157) Replac conda with pip in TravisCI setup (nilearn#2141) Core devs doc and add @emdupre (nilearn#2151) Add check for vmin, vmax in plot_surf_roi (nilearn#2052) [ENH] Initial visual reports (nilearn#2019) ...
This PR adds the possibility to plot the strength of a connectome on a glass brain.
The strength is defined as the absolute sum of the edges at a node.
TODO: