cjrf = 0 #Will look for files that are of the conjugated and reflected reconstruction transparent = 0 #will mkae a movie with transparent isosurfaces string = '*Amp-Phase.vtk' for file0 in os.listdir('.'): if fnmatch.fnmatch(file0, string): filename = file0 print filename savename = filename scene = engine.new_scene() scene.scene.off_screen_rendering = True vtk_file_reader = engine.open(filename, scene) scene.scene.background = (1.0, 1.0, 1.0) from enthought.mayavi.filters.contour import Contour contour = Contour() engine.add_filter(contour, obj=None) from enthought.mayavi.filters.set_active_attribute import SetActiveAttribute set_active_attribute = SetActiveAttribute() engine.add_filter(set_active_attribute, obj=None) from enthought.mayavi.modules.surface import Surface surface = Surface() engine.add_module(surface, obj=None) ##Orientation axes orientation_axes = OrientationAxes()
if len(engine.scenes) == 0: engine.new_scene() # ------------------------------------------- dir = os.getcwd() for file0 in os.listdir('.'): if fnmatch.fnmatch(file0, '*AMP.rec'): filename = file0 print filename savename = filename ## scene1 = engine.new_scene() scene1.scene.off_screen_rendering = True jesse_mat_lab_coord_source1 = engine.open(filename, scene1) ## from enthought.mayavi.modules.iso_surface import IsoSurface iso_surface1 = IsoSurface() engine.add_filter(iso_surface1, jesse_mat_lab_coord_source1) iso_surface1.contour.contours[0:1] = [0.5] ##Orientation axes orientation_axes = OrientationAxes() engine.add_module(orientation_axes, obj=None) orientation_axes.text_property.shadow_offset = array([1, -1]) orientation_axes.text_property.font_family = 'times' orientation_axes.text_property.shadow_offset = array([1, -1]) orientation_axes.text_property.font_size = 15 orientation_axes.axes.axis_labels = False
# Recorded script from Mayavi2 from numpy import array try: engine = mayavi.engine except NameError: from enthought.mayavi.api import Engine engine = Engine() engine.start() if len(engine.scenes) == 0: engine.new_scene() # ------------------------------------------- scene = engine.scenes[0] vtkxml_file_reader = engine.open(u'/Users/prabhu/work/MEDIA/m2/data/solution.vtp', scene) from enthought.mayavi.modules.surface import Surface surface = Surface() engine.add_filter(surface, vtkxml_file_reader) scene.scene.camera.position = [-5.0805380472988206, -22.772737120755238, 27.951999647518075] scene.scene.camera.focal_point = [-0.30313491821289062, 0.0, 1.4027749300003052] scene.scene.camera.view_angle = 30.0 scene.scene.camera.view_up = [-0.1142423672711194, 0.76412329986979977, 0.63487342369670707] scene.scene.camera.clipping_range = [22.838642391722981, 51.077591804257452] scene.scene.camera.compute_view_plane_normal() scene.scene.render() scene.scene.camera.position = [-26.79814746753679, -17.616423028517339, 16.698474306673273] scene.scene.camera.focal_point = [-0.30313491821289062, 0.0, 1.4027749300003052] scene.scene.camera.view_angle = 30.0 scene.scene.camera.view_up = [0.117668827287714, 0.54423876670086724, 0.83063723243342136] scene.scene.camera.clipping_range = [16.95271984178639, 58.486755617116714] scene.scene.camera.compute_view_plane_normal() scene.scene.render() surface.actor.property.edge_visibility = True
# Recorded script from Mayavi2 from numpy import array try: engine = mayavi.engine except NameError: from enthought.mayavi.api import Engine engine = Engine() engine.start() if len(engine.scenes) == 0: engine.new_scene() # ------------------------------------------- scene = engine.scenes[0] vtkxml_file_reader = engine.open( u'/Users/prabhu/work/MEDIA/m2/data/solution.vtp', scene) from enthought.mayavi.modules.surface import Surface surface = Surface() engine.add_filter(surface, vtkxml_file_reader) scene.scene.camera.position = [ -7.8710042803035831, -23.270734468965951, 26.848457084803901 ] scene.scene.camera.focal_point = [ -0.30313491821289062, 0.0, 1.4027749300003052 ] scene.scene.camera.view_angle = 30.0 scene.scene.camera.view_up = [ -0.18791276028283388, 0.75198808427818908, 0.63182490899497246 ] scene.scene.camera.clipping_range = [21.722908882245918, 52.482070417945934] scene.scene.camera.compute_view_plane_normal() scene.scene.render() scene.scene.camera.position = [
exit(1) # Recorded script from Mayavi2 from numpy import array try: engine = mayavi.engine except NameError: from enthought.mayavi.api import Engine engine = Engine() engine.start() if len(engine.scenes) == 0: engine.new_scene(size=(512,512)) #engine.new_scene(size=(1000,1000)) # ------------------------------------------- #vtkxml_file_reader = engine.open(u'/home/mike/vilnius/prog/computenode/src/test/test.vtp') vtkxml_file_reader = engine.open(sys.argv[1]) from enthought.mayavi.modules.surface import Surface surface = Surface() engine.add_module(surface, obj=None) scene = engine.scenes[0] scene.scene.parallel_projection = True scene.scene.background = (0.49803921568627452, 0.49803921568627452, 0.49803921568627452) camera_light = engine.scenes[0].scene.light_manager.lights[0] camera_light.elevation = 0.0 camera_light.azimuth = 0.0 camera_light1 = engine.scenes[0].scene.light_manager.lights[1] camera_light1.elevation = 0.0 camera_light1.azimuth = 0.0 camera_light1.intensity = 1.0 camera_light1.activate = False
filename = file0 if os.path.isdir(dir + save_mname) == False: os.mkdir(dir + save_mname) if os.path.isdir(dir + save_mname + sstring + str(thing) + '/') == False: os.mkdir(dir + save_mname + sstring + str(thing) + '/') this_dir = dir + save_mname + sstring + str(thing) + '/' files_string = this_dir + sstring + '-' thing = thing + 1 scene = engine.scenes[0] vtk_file_reader = engine.open(ref_file, scene) from enthought.mayavi.modules.iso_surface import IsoSurface iso_surface = IsoSurface() engine.add_filter(iso_surface, vtk_file_reader) iso_surface.contour.contours[0:1] = [0.050000000000000003] iso_surface.actor.property.opacity = 0.10000000000000001 vtk_file_reader1 = engine.open(filename) vtk_file_reader1.point_scalars_name = 'phases' iso_surface1 = IsoSurface() engine.add_filter(iso_surface1, vtk_file_reader1) iso_surface1.contour.auto_contours = True iso_surface1.contour.number_of_contours = 2 iso_surface1.contour.minimum_contour = thlow iso_surface1.contour.maximum_contour = thhigh module_manager1 = vtk_file_reader1.children[0]
exit(1) # Recorded script from Mayavi2 from numpy import array try: engine = mayavi.engine except NameError: from enthought.mayavi.api import Engine engine = Engine() engine.start() if len(engine.scenes) == 0: engine.new_scene(size=(512, 512)) #engine.new_scene(size=(1000,1000)) # ------------------------------------------- #vtkxml_file_reader = engine.open(u'/home/mike/vilnius/prog/computenode/src/test/test.vtp') vtkxml_file_reader = engine.open(sys.argv[1]) from enthought.mayavi.modules.surface import Surface surface = Surface() engine.add_module(surface, obj=None) scene = engine.scenes[0] scene.scene.parallel_projection = True scene.scene.background = (0.49803921568627452, 0.49803921568627452, 0.49803921568627452) camera_light = engine.scenes[0].scene.light_manager.lights[0] camera_light.elevation = 0.0 camera_light.azimuth = 0.0 camera_light1 = engine.scenes[0].scene.light_manager.lights[1] camera_light1.elevation = 0.0 camera_light1.azimuth = 0.0 camera_light1.intensity = 1.0