Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/nipyPublic

Fix get_3d_peaks when using mask#455

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
aperezlebel wants to merge1 commit intonipy:main
base:main
Choose a base branch
Loading
fromaperezlebel:fix-mask-3d-peaks

Conversation

aperezlebel
Copy link

Issue

Theget_3d_peaks function fromnipy.labs.statistical_mapping throws an error when using it with a mask.

Minimal reproductible example

fromnilearnimportdatasets,masking,imagefromnipy.labs.statistical_mappingimportget_3d_peakstemplate=datasets.load_mni152_template()mask=masking.compute_gray_matter_mask(template)imgs=datasets.fetch_neurovault_motor_task()img=image.resample_to_img(imgs.images[0],template)get_3d_peaks(img,mask=mask)

Error

Traceback (most recent call last):  File "minimal.py", line 10, in <module>    get_3d_peaks(img, mask=mask)  File ".../venv/lib/python3.7/site-packages/nipy/labs/statistical_mapping.py", line 199, in get_3d_peaks    ff = field_from_graph_and_data(wgraph_from_3d_grid(xyz, k=18), data)  File ".../venv/lib/python3.7/site-packages/nipy/algorithms/graph/graph.py", line 527, in wgraph_from_3d_grid    raise ValueError('xyz should have shape n * 3')ValueError: xyz should have shape n * 3

Versions

nipy==0.4.2nilearn==0.5.2

Fix

xyz must be of shape n*3 to be used bywgraph_from_3d_grid, hence the use of the 3D mask array instead of the 1D ravelled mask array innp.where.

xyz must be of shape n*3 to be used by wgraph_from_3d_grid, hence the use of the 3D mask array instead of the 1D ravelled mask array in np.where
@jbpoline
Copy link
Member

jbpoline commentedAug 22, 2019 via email

Ok ! Bien vu - le mieux serait de simuler les cartes d’activation et defaire tourner le pipelinePrends du temps avec ta famille demain!JB
On Thu, Aug 22, 2019 at 12:36 PM Alexandre PEREZ ***@***.***> wrote: Issue The get_3d_peaks function from nipy.labs.statistical_mapping throws an error when using it with a mask. Minimal reproductible example from nilearn import datasets, masking, imagefrom nipy.labs.statistical_mapping import get_3d_peaks template = datasets.load_mni152_template() mask = masking.compute_gray_matter_mask(template) imgs = datasets.fetch_neurovault_motor_task() img = image.resample_to_img(imgs.images[0], template) get_3d_peaks(img, mask=mask) Error Traceback (most recent call last): File "minimal.py", line 10, in <module> get_3d_peaks(img, mask=mask) File ".../venv/lib/python3.7/site-packages/nipy/labs/statistical_mapping.py", line 199, in get_3d_peaks ff = field_from_graph_and_data(wgraph_from_3d_grid(xyz, k=18), data) File ".../venv/lib/python3.7/site-packages/nipy/algorithms/graph/graph.py", line 527, in wgraph_from_3d_grid raise ValueError('xyz should have shape n * 3') ValueError: xyz should have shape n * 3 Versions nipy==0.4.2 nilearn==0.5.2 Fix xyz must be of shape n*3 to be used by wgraph_from_3d_grid, hence the use of the 3D mask array instead of the 1D ravelled mask array in np.where. ------------------------------ You can view, comment on, or merge this pull request online at:#455 Commit Summary - Fix get_3d_peaks when using mask File Changes - *M* nipy/labs/statistical_mapping.py <https://github.com/nipy/nipy/pull/455/files#diff-0> (2) Patch Links: -https://github.com/nipy/nipy/pull/455.patch -https://github.com/nipy/nipy/pull/455.diff — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#455?email_source=notifications&email_token=AACDE2HUZR4HW2YBFRIGYQDQF26A3A5CNFSM4IOXAHX2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HG2YWJA>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AACDE2EK2BIFP4GC7CWOK3LQF26A3ANCNFSM4IOXAHXQ> .

@aperezlebel
Copy link
Author

Hi, any news ?

@matthew-brett
Copy link
Member

I'm very very sorry to be so slow here - but can you think of a test for this fix? I will honestly get to this very quickly, if you do still have interest.

@aperezlebel
Copy link
Author

No problem! I am not working on this anymore but I can try to have a look in the following weeks.

@matthew-brett
Copy link
Member

That would be kind. I'm very sorry for the delay.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@aperezlebel@jbpoline@matthew-brett

[8]ページ先頭

©2009-2025 Movatter.jp