-
Notifications
You must be signed in to change notification settings - Fork 584
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
Marker size array is not well displayed in plot_glass_brain #2185
Comments
Yes please!
…On Thu, Oct 17, 2019, 18:18 robbisg ***@***.***> wrote:
What version of Nilearn are you using?
In [36]: nilearn.__version__
Out[36]: '0.6.0a'
What were you trying to do?
Plot a connectome using plot_connectome function, giving the a numpy
array as node_size.
Here's the snippet to replicate:
coords and colors are obtained by some functions I've implemented in my
libraries.
from nilearn.plotting import plot_connectome
matrix = np.random.rand(90,90)
matrix = (matrix * matrix.T)/2
t_matrix = matrix * np.int_(matrix > 0.45) #Plot only some connections
f = plot_connectome(t_matrix,
coords[:90],
colors[:90],
t_matrix.sum(0)*100,
'magma_r',
display_mode='lyr',
edge_vmin=0.45,
edge_vmax=0.5,
figure=pl.figure(figsize=(25,15)),
)
What did you expect will happen?
[image: fixed]
<https://user-images.githubusercontent.com/695037/67026948-0d33a980-f109-11e9-83f5-24c2bf1c66e1.png>
What actually happened?
The node size of left and right images are different from those obtained
in coronal view.
[image: buggy]
<https://user-images.githubusercontent.com/695037/67026961-13298a80-f109-11e9-909b-f8565edcd422.png>
I've found the problem in displays.pyand fixed it by adding at line 417
Maybe we also need some control on array/list length.
if isinstance(marker_size, np.ndarray) or \
isinstance(marker_size, list):
marker_size = np.array(marker_size)[relevant_coords]
I can do the PR, if you are ok.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2185?email_source=notifications&email_token=AB6SXRAZVHXRL5LFDHWOGT3QPCF5FA5CNFSM4JB37HLKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HSQL4QA>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB6SXRBA5TAH3YLIWECTRNLQPCF5FANCNFSM4JB37HLA>
.
|
I think you are right and a PR would be welcome. Thanks!
|
kchawla-pi
pushed a commit
that referenced
this issue
Oct 28, 2019
* FIX: marker size issue in plot_connectome #2185 * Update displays.py * Update displays.py List and numpy array accepted * Update nilearn/plotting/displays.py Co-Authored-By: jeromedockes <jerome@dockes.org> * FIX: marker size issue in plot_connectome #2185 * Update whats_new.rst * Update displays.py * Fixed identation for flake
kchawla-pi
added a commit
to illdopejake/nilearn
that referenced
this issue
Nov 9, 2019
…nt_modify_fetch_dev * 'master' of https://github.com/nilearn/nilearn: Verbose doc building to ease tracking of progress & diagnose stalls (nilearn#2203) New conda env is created once conda path has been activated Conda environment is created for full-builds Refactor CircleCI config for reduced redundancy (nilearn#2204) Installation should fail on Python < 3.5 (nilearn#2198) [MRG] Add get data function (nilearn#2172) fix error when colorscale given boolean array (nilearn#2193) remove is_valid filter (nilearn#2169) Moved new entries to next release FIX: marker size issue in plot_connectome nilearn#2185 (nilearn#2186) Updated Appveyor status badge Run tests on local Windows machines & Azure Pipelines (nilearn#2191) Updated requirements list for devs (nilearn#2190) Update azure-pipelines.yml for Azure Pipelines 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)
kchawla-pi
added a commit
to pausz/nilearn
that referenced
this issue
Nov 21, 2019
…smooth-image * 'master' of https://github.com/nilearn/nilearn: (25 commits) Add testing for Nilearn setup & install & Fix the broken dependency installation (nilearn#2201) Fix uniform ball cloud test for sklearn >= 0.22 (nilearn#2175) MAINT: sklearn Deprecations (nilearn#2219) DOC: title in bold [DOC] Add note about decreasing memory usage (nilearn#2223) Rel 060b0 (nilearn#2208) Nilearn 0.6.0b0 release (nilearn#2206) Fixed the redundant & missing test case in merged PR nilearn#2035 (nilearn#2205) Modify fetch_development_fmri to fetch adults or children (nilearn#2035) Verbose doc building to ease tracking of progress & diagnose stalls (nilearn#2203) New conda env is created once conda path has been activated Conda environment is created for full-builds Refactor CircleCI config for reduced redundancy (nilearn#2204) Installation should fail on Python < 3.5 (nilearn#2198) [MRG] Add get data function (nilearn#2172) fix error when colorscale given boolean array (nilearn#2193) remove is_valid filter (nilearn#2169) Moved new entries to next release FIX: marker size issue in plot_connectome nilearn#2185 (nilearn#2186) Updated Appveyor status badge ...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of Nilearn are you using?
What were you trying to do?
Plot a connectome using
plot_connectome
function, giving the a numpy array as node_size.Here's the snippet to replicate:
coords
andcolors
are obtained by some functions I've implemented in my libraries.What did you expect will happen?
![fixed](https://user-images.githubusercontent.com/695037/67026948-0d33a980-f109-11e9-83f5-24c2bf1c66e1.png)
What actually happened?
![buggy](https://user-images.githubusercontent.com/695037/67026961-13298a80-f109-11e9-909b-f8565edcd422.png)
The node size of left and right images are different from those obtained in coronal view.
I've found the problem in
displays.py
and fixed it by adding at line 417Maybe we also need some control on array/list length.
I can do the PR, if you are ok.
The text was updated successfully, but these errors were encountered: