コード例 #1
0
"""
Script to generate the preview images for the mayavi2 LUTs.

Requires ImageMagick.
"""
import os

from enthought.mayavi import mlab
from enthought.mayavi.core.lut_manager import lut_mode_list, lut_image_dir

import numpy as np

# Create some data
X = np.arange(0, 255)
X = X * np.ones((200, 1))

mlab.clf()
image = mlab.imshow(X.T)
mlab.view(0, 0, 118)
# Make a preview for each possible lut
for lut in lut_mode_list():
    filebasename = os.path.join(lut_image_dir, lut.lower())
    if not lut == 'file':
        image.module_manager.scalar_lut_manager.lut_mode = lut
        mlab.savefig(filebasename + '.png', size=(80, 20))
        #os.system('convert %s.png %s.gif &' %(filebasename, filebasename))
        os.system('montage -geometry -0-0 -label "%s"  %s.png   %s.gif &' %
                  (lut, filebasename, filebasename))
コード例 #2
0
importing.
"""
# Authors: Prabhu Ramachandran <*****@*****.**>
#          Judah De Paula <*****@*****.**>
# Copyright (c) 2005-2008, Enthought, Inc.
# License: BSD Style.

from enthought.traits.ui.api \
    import Item, Group, View, ImageEnumEditor, InstanceEditor, HGroup
from enthought.mayavi.core.lut_manager import lut_mode_list, \
            lut_image_dir


# The view of the LUT Manager object.
view = View(Group(Item(name='lut_mode',
                       editor=ImageEnumEditor(values=lut_mode_list(), 
                                              cols=6,
                                              path=lut_image_dir)),
                  Item(name='file_name', visible_when="lut_mode=='file'"), 
                  Item(name='number_of_colors'),
                  Item(name='reverse_lut'),
                  Item(name='lut',
                       show_label=False,
                       editor=InstanceEditor(label='Edit LUT properties',
                                             id='mayavi.core.lut_manager.edit_lut')),
                  Item(name='scalar_bar_representation',
                       show_label=False,
                       visible_when='scalar_bar_representation is not None',
                       editor=InstanceEditor(label='Edit Legend representation',
                                             id='mayavi.core.lut_manager.edit_represetation')),
                  Item(name='create_lut', show_label=False),
コード例 #3
0
"""
Script to generate the preview images for the mayavi2 LUTs.

Requires ImageMagick.
"""
import os

from enthought.mayavi import mlab
from enthought.mayavi.core.lut_manager import lut_mode_list, lut_image_dir

import numpy as np

# Create some data
X = np.arange(0, 255)
X = X * np.ones((200, 1))

mlab.clf()
image = mlab.imshow(X.T)
mlab.view(0, 0, 118)
# Make a preview for each possible lut
for lut in lut_mode_list():
    filebasename = os.path.join(lut_image_dir, lut.lower())
    if not lut == 'file':
        image.module_manager.scalar_lut_manager.lut_mode = lut
        mlab.savefig(filebasename + '.png', size=(80, 20))
        #os.system('convert %s.png %s.gif &' %(filebasename, filebasename))
        os.system('montage -geometry -0-0 -label "%s"  %s.png   %s.gif &' 
                        % (lut, filebasename, filebasename) )