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

Fvtk cleanup #378

Merged
merged 6 commits into from Jun 11, 2014

Conversation

Projects
None yet
3 participants
@MrBago
Contributor

MrBago commented Jun 4, 2014

  • I've cleaned up how colormaps are handled a little in dipy, and moved the actual colormap data information from the code into a json file. This makes the code cleaner and makes it easier to handle matplotlib colormaps. All matplotlib colormaps can be used in any part of fvtk if the user has matplotlib installed
  • I've replaces all the if/elif/elif calls in fvtk with a new function
  • Added tests, and fixed a bug I discovered while writing said tests, for colormaps.

This should supplant #376 and #377 I believe.

@MrBago

This comment has been minimized.

Contributor

MrBago commented Jun 4, 2014

So I used indent=2 when i made the json file because I thought it would be more readable, but it still doesn't seem all that readable. Should I replace the long json file with a smushed json stream instead? Pickle file could work too.

@arokem

This comment has been minimized.

Member

arokem commented Jun 4, 2014

You mean to suggest that it's better to solve something once properly, than to solve it many times half-way?

:-)

@arokem

This comment has been minimized.

Member

arokem commented Jun 4, 2014

Thanks for doing this!

@arokem

This comment has been minimized.

Member

arokem commented Jun 4, 2014

I think the json file looks ok

name of the colourmap
name : str.
name of the colormap. Currently implemented: 'jet', 'blues',
'accent', 'bone' and matplotlib colormaps if you have mapplotlib

This comment has been minimized.

@samuelstjean

samuelstjean Jun 5, 2014

Contributor

mapplotlib?

return np.vstack((red, green, blue)).T
v = np.clip(v, 0, 1)
# The names a few colormaps are different in dipy

This comment has been minimized.

@samuelstjean

samuelstjean Jun 5, 2014

Contributor

names of a few

def _makeNd(array, ndim):
"""Pads 1s at the beginning of array's shape so that array until array is

This comment has been minimized.

@samuelstjean

samuelstjean Jun 5, 2014

Contributor

Not really sure about the meaning pf that docstring, is it missing some words?

v = np.random.random(1000)
for name in 'jet', 'Blues', 'Accent', 'bone':
# Matplot lib version of get_cmap

This comment has been minimized.

@samuelstjean

samuelstjean Jun 5, 2014

Contributor

extra space in Matplotlib's name

arokem added a commit that referenced this pull request Jun 11, 2014

@arokem arokem merged commit fe69c87 into nipy:master Jun 11, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment