-
Notifications
You must be signed in to change notification settings - Fork 100
Better colormaps #82
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
Better colormaps #82
Conversation
@@ -10,6 +10,8 @@ | |||
import nibabel as nib | |||
from scipy import sparse | |||
from scipy.spatial.distance import cdist | |||
import matplotlib as mpl | |||
from matplotlib import cm |
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.
I don't think we should add a strong dependency on matplotlib
. It wouldn't be used by people who supply their own LUT. I'd just nest the import in the functions, throwing an error if it doesn't import. WDYT?
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.
We already imported matplotlib at the top level in surfer.viz
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.
Ahh, alright. I guess if it was already a dependency, it won't matter -- and most people have matplotlib
anyway...
Other than my comment, LGTM, especially if it avoids using |
@@ -1,6 +1,7 @@ | |||
from os.path import join as pjoin | |||
|
|||
import numpy as np | |||
import nose.tools as nt |
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.
why not from nose.tools import assert_equal
to match our other uses?
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.
Just habit
We didn't have Jet, but |
Hold up on merging this, I need to update the contour activation example, as the new default isn't appropriate for a thresholded image. |
OK should be good now. I forgot contour overlays are strictly positive. |
Looks good, thanks! |
As you may know, I have strong opinions about colormaps.
This improves the colormap handling in PySurfer substantially. For
add_data
andadd_contour_overlay
, you can pass_r
reversed colormaps)and it will handle them appropriately.
I also changed the defaults so there are no evil rainbow colormaps in PySurfer.