[mayavi] colormaps

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

[mayavi] colormaps

Fred-5
Hi all,

I would like to play with Mayavi colormaps.

So I would like to know how the file pylab_luts.pkl, which contains the
colomaps definition IIUC, is built.

TIA.

Cheers,

--
Fred
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: [mayavi] colormaps

Gael Varoquaux
On Thu, May 06, 2010 at 11:32:31AM +0200, Fred wrote:
> I would like to play with Mayavi colormaps.

> So I would like to know how the file pylab_luts.pkl, which contains the
> colomaps definition IIUC, is built.

In the scripts directory, the cm2lut.py file.

HTH,

Gaël
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: [mayavi] colormaps

fred-2
Le 06/05/2010 11:35, Gael Varoquaux a écrit :
> On Thu, May 06, 2010 at 11:32:31AM +0200, Fred wrote:
>> I would like to play with Mayavi colormaps.
>
>> So I would like to know how the file pylab_luts.pkl, which contains the
>> colomaps definition IIUC, is built.
>
> In the scripts directory, the cm2lut.py file.
Oops, sorry, I did a grin pylab_luts in Mayavi dir but did not see it :-/

Thanks!


Cheers,

--
Fred
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: [mayavi] colormaps

fred-2
Hi,

Normally, the gif which displays the colormap has low value to the left
and high value to the right.

This is not the case for the Spectral colormap.

http://ktools.free.fr/snapshot.png



Cheers,

--
Fred
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: [mayavi] colormaps

fred-2
Le 06/05/2010 15:58, Fred a écrit :

> http://ktools.free.fr/snapshot.png
In others words, the gif is reversed vs. the colormap.

--
Fred
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: [mayavi] colormaps

fred-2
Le 06/05/2010 16:00, Fred a écrit :
> Le 06/05/2010 15:58, Fred a écrit :
>
>> http://ktools.free.fr/snapshot.png
> In others words, the gif is reversed vs. the colormap.
Mmmh, ok.

There are two colormaps called spectral: Spectral and spectral.

As colormap names are lowered to create gif, the issue is here :-)



Cheers,

--
Fred
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: [mayavi] colormaps

fred-2
Le 06/05/2010 16:03, Fred a écrit :

> As colormap names are lowered to create gif, the issue is here :-)
And I do prefer Spectral, IMHO ;-)


Cheers,

--
Fred
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: [mayavi] colormaps

fred-2
In reply to this post by fred-2
Le 06/05/2010 11:46, Fred a écrit :

>> In the scripts directory, the cm2lut.py file.
> Oops, sorry, I did a grin pylab_luts in Mayavi dir but did not see it :-/
BTW, what does 'pkl' mean?

Cheers,

--
Fred
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: [mayavi] colormaps

Gael Varoquaux
On Fri, May 07, 2010 at 10:54:56AM +0200, Fred wrote:
> Le 06/05/2010 11:46, Fred a écrit :

> >> In the scripts directory, the cm2lut.py file.
> > Oops, sorry, I did a grin pylab_luts in Mayavi dir but did not see it :-/
> BTW, what does 'pkl' mean?

pickle

G.
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: [mayavi] colormaps

fred-2
Le 07/05/2010 10:57, Gael Varoquaux a écrit :
> On Fri, May 07, 2010 at 10:54:56AM +0200, Fred wrote:
>> Le 06/05/2010 11:46, Fred a écrit :
>
>>>> In the scripts directory, the cm2lut.py file.
>>> Oops, sorry, I did a grin pylab_luts in Mayavi dir but did not see it :-/
>> BTW, what does 'pkl' mean?
>
> pickle
Ok, Thanks :-)

--
Fred
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: [mayavi] colormaps

fred-2
In reply to this post by Gael Varoquaux
Ok, I have a few colormaps I want to be included in mayavi (from my
Traits app, of course).

As I don't really know how to manage this, I tried the following, which
works (but with a few issues, I guess):

def change_colormap(self):
     try:
         self.tab.lut_manager.lut_mode = self.name
     except TraitError:
         cmap = colormaps_dict[self.name]
         self.lut_manager.load_lut_from_list(cmap.tolist())

The issue I can see is that lut_mode is not updated.


If you have a better approach...

TIA.


Cheers,

--
Fred
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: [mayavi] colormaps

Gael Varoquaux
On Fri, May 07, 2010 at 11:59:12AM +0200, Fred wrote:
> If you have a better approach...

Rework the logic in the lut_manager to make it extensible. It would be
nice.

Gaël
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: [mayavi] colormaps

Gael Varoquaux
In reply to this post by fred-2
On Thu, May 06, 2010 at 04:03:26PM +0200, Fred wrote:
> Le 06/05/2010 16:00, Fred a écrit :
> > Le 06/05/2010 15:58, Fred a écrit :

> >> http://ktools.free.fr/snapshot.png
> > In others words, the gif is reversed vs. the colormap.
> Mmmh, ok.

> There are two colormaps called spectral: Spectral and spectral.

> As colormap names are lowered to create gif, the issue is here :-)

OK, the problem is that we can't store two files with names differing
only by capitalisation, as if we do that there will be collisions on
systems that hash files without taking in account capitals (such as
windows).

One option is to change the name of 'Spectral'. I don't really like this
option, because I liked having the same names than matplotlib. Maybe we
are going to have to break this rule for spectral. I'll think about it a
bit.

Anybody has a good suggestion?

Gaël
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev