Skip to content
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

Plotting thresholded data doesn't work reliably #372

Open
ejolly opened this issue Mar 5, 2021 · 0 comments
Open

Plotting thresholded data doesn't work reliably #372

ejolly opened this issue Mar 5, 2021 · 0 comments

Comments

@ejolly
Copy link
Collaborator

ejolly commented Mar 5, 2021

Related to #304. It looks like recent versions of nilearn now raise errors on transformed data that isn't nsamples x nvoxels. So whenever we run brain.ttest(threshold_dict=...) plotting and saving (to nifti) the thresholded t map produces TypeErrors, like

~/anaconda3/lib/python3.8/site-packages/nilearn/masking.py in _unmask_3d(X, mask, order)
    831     n_features = mask.sum()
    832     if X.shape[0] != n_features:
--> 833         raise TypeError('X must be of shape (samples, %d).' % n_features)
    834
    835     data = np.zeros(

TypeError: X must be of shape (samples, 51029).

@ljchang This is another example where we should prioritize revisiting #304 I'm not seeing an advantage of changing the shape of a brain data object ever, as oppose to just setting voxels to 0 whenever we threshold. And this new error supports the opting for the latter approach across our toolbox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant