# <markdowncell> # Loading data from file using FileReader methods # ----------------------------------------------- # # To load a VTK data file, say heart.vtk file in mayavi/examples/data/ # directory, simply type: # # <codecell> from enthought.mayavi.sources.vtk_file_reader import VTKFileReader src = VTKFileReader() src.initialize("heart.vtk") # <markdowncell> # Note: Files with .vtk extension are called "legacy VTK" files. !MayaVi2 # can read a lot of other files formats (XML, files from Ensight, Plot3D # and so on). For example, you can load an XML file (with extension .vti, # .vtp, .vtr, .vts, .vtu, etc) using VTKXML!FileReader method. # # Add the source to your MayaVi2 class # ------------------------------------ # # Then, once your data are loaded using one of the two methods above, add # the source with the add\_source() method in the body of the class # !MyClass (after script.new\_scene): #