def treader(fname, engine):
    from enthought.tvtk.api import tvtk
    from enthought.mayavi.sources.vtk_data_source import VTKDataSource
    from enthought.mayavi.sources.api import ArraySource
    # Do your own reader stuff here, I'm just reading a VTK file with a
    # different extension here.
    
    src = ArraySource()
    src.scalar_name=fname
    import os.path
    src.name=os.path.split(fname)[-1]
    return src
Exemple #2
0
def spe_reader(fname, engine):
    """Reader for .zzz files.
    
    Parameters:
    -----------
    fname -- Filename to be read.
    engine -- The engine the source will be associated with.
    """
    from enthought.tvtk.api import tvtk
    from enthought.mayavi.sources.vtk_data_source import VTKDataSource
    # Do your own reader stuff here, I'm just reading a VTK file with a
    # different extension here.
    import SpeFile as spe
    r = spe.SpeFile(fname)

    from enthought.mayavi.sources.api import ArraySource
    src = ArraySource()
    src.scalar_data = r.GetNumArray()
    src.scalar_name = fname
    import os.path
    src.name = os.path.split(fname)[-1]
    return src