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

plot_prob_atlas error: No contour levels were found within the data range #2513

Closed
vnckppl opened this issue Jun 2, 2020 · 2 comments
Closed
Labels
Usage Usage-related questions, to be forwarded to NeuroStars.

Comments

@vnckppl
Copy link

vnckppl commented Jun 2, 2020

Problem
plot_prob_atlas is not plotting atlas outlines

Approach
I have several 4D image files each containing 28 binary masks. I want to plot the outlines of the 28 ROIs per file. I used:

binmask = nb.load('/path/to/4D_binary_mask.nii.gz')
display = plotting.plot_prob_atlas(binmask)

For most but not all files, this results in several errors, all in the form of:

/Users/vincent/Data/tmp/env/lib/python3.8/site-packages/nilearn/plotting/displays.py:97: UserWarning: No contour levels were found within the data range.
im = getattr(ax, type)(data_2d.copy()

I checked and made sure that none of the 3D volumes within the 4D volume are empty. All 4D files are created by the same pipeline and I can't detect differences between these files other than differences in the location of the ROIs within these 4D files.

I am using the following software:
Python 3.8
Nilearn 0.6.2

@emdupre
Copy link
Member

emdupre commented Jun 2, 2020

Hi ! This is a question that would be better suited to NeuroStars, as it's about the usage of the software rather than an issue in the software itself.

The problem here is likely that you're using plotting.plot_prob_atlas, which expects a probabilistic atlas rather than a binary mask. You likely want something more like add_contours. You can see an example here.

I'll close the discussion here but would be happy to continue it on NeuroStars ! Just use the nilearn tag. Thanks !

@emdupre emdupre closed this as completed Jun 2, 2020
@vnckppl
Copy link
Author

vnckppl commented Jul 4, 2020

Hi Elizabeth, Thank you for your reply. I agree that there are better ways of plotting the data, but the tool does not seem to be the culprit here. In fact, I experience the exact same problems with add_contours. I'll refer to my follow-up question here, just in case someone else may land here who experiences the same issue: #2537

@tsalo tsalo added the Usage Usage-related questions, to be forwarded to NeuroStars. label Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Usage Usage-related questions, to be forwarded to NeuroStars.
Projects
None yet
Development

No branches or pull requests

3 participants