diff --git a/docs/examples/collision-particles.py b/docs/examples/collision-particles.py index 1eedb520e..9fd836719 100644 --- a/docs/examples/collision-particles.py +++ b/docs/examples/collision-particles.py @@ -123,7 +123,10 @@ def collision(): box_directions = np.array([[0, 1, 0]]) box_colors = np.array([[1, 1, 1, 0.2]]) box_actor = actor.box( - box_centers, box_directions, box_colors, scales=(box_lx, box_ly, box_lz) + box_centers, + directions=box_directions, + colors=box_colors, + scales=(box_lx, box_ly, box_lz), ) scene.add(box_actor) @@ -135,7 +138,7 @@ def collision(): scene.add(sphere_actor) showm = window.ShowManager( - scene, size=(900, 768), reset_camera=True, order_transparent=True + scene=scene, size=(900, 768), reset_camera=True, order_transparent=True ) tb = ui.TextBlock2D(bold=True) @@ -146,7 +149,7 @@ def collision(): counter = itertools.count() vertices = utils.vertices_from_actor(sphere_actor) -vcolors = utils.colors_from_actor(sphere_actor, "colors") +vcolors = utils.colors_from_actor(sphere_actor, array_name="colors") no_vertices_per_sphere = len(vertices) / num_particles initial_vertices = vertices.copy() - np.repeat(xyz, no_vertices_per_sphere, axis=0) @@ -175,4 +178,4 @@ def timer_callback(_obj, _event): if interactive: showm.start() -window.record(showm.scene, size=(900, 768), out_path="simple_collisions.png") +window.record(scene=showm.scene, size=(900, 768), out_path="simple_collisions.png") diff --git a/docs/examples/viz_animated_surfaces.py b/docs/examples/viz_animated_surfaces.py index 7ab83ee8f..1d20af1eb 100644 --- a/docs/examples/viz_animated_surfaces.py +++ b/docs/examples/viz_animated_surfaces.py @@ -128,7 +128,7 @@ def create_surface(x, y, equation, colormap_name): scene.set_camera( position=(4.45, -21, 12), focal_point=(4.45, 0.0, 0.0), view_up=(0.0, 0.0, 1.0) ) -showm = fury.window.ShowManager(scene, size=(600, 600)) +showm = fury.window.ShowManager(scene=scene, size=(600, 600)) ############################################################################### # Creating a grid to interact with surfaces individually. @@ -137,7 +137,7 @@ def create_surface(x, y, equation, colormap_name): text = [] for i in range(4): t_actor = fury.actor.vector_text( - "Function " + str(i + 1), pos=(0, 0, 0), scale=(0.17, 0.2, 0.2) + text="Function " + str(i + 1), pos=(0, 0, 0), scale=(0.17, 0.2, 0.2) ) text.append(t_actor) @@ -207,4 +207,6 @@ def timer_callback(_obj, _event): if interactive: showm.start() -fury.window.record(showm.scene, size=(600, 600), out_path="viz_animated_surfaces.png") +fury.window.record( + scene=showm.scene, size=(600, 600), out_path="viz_animated_surfaces.png" +) diff --git a/docs/examples/viz_arrow.py b/docs/examples/viz_arrow.py index afb510e0e..3c1f1b1ea 100644 --- a/docs/examples/viz_arrow.py +++ b/docs/examples/viz_arrow.py @@ -50,4 +50,4 @@ if interactive: fury.window.show(scene, size=(600, 600)) -fury.window.record(scene, out_path="viz_arrow.png", size=(600, 600)) +fury.window.record(scene=scene, out_path="viz_arrow.png", size=(600, 600)) diff --git a/docs/examples/viz_bezier_interpolator.py b/docs/examples/viz_bezier_interpolator.py index ff34396f7..096c3592e 100644 --- a/docs/examples/viz_bezier_interpolator.py +++ b/docs/examples/viz_bezier_interpolator.py @@ -19,7 +19,7 @@ scene = fury.window.Scene() showm = fury.window.ShowManager( - scene, size=(900, 768), reset_camera=False, order_transparent=True + scene=scene, size=(900, 768), reset_camera=False, order_transparent=True ) @@ -113,7 +113,7 @@ showm.start() fury.window.record( - scene, + scene=scene, out_path="viz_keyframe_animation_bezier_1.png", size=(900, 768), ) @@ -125,7 +125,7 @@ scene = fury.window.Scene() show_manager = fury.window.ShowManager( - scene, size=(900, 768), reset_camera=False, order_transparent=True + scene=scene, size=(900, 768), reset_camera=False, order_transparent=True ) ############################################################################### @@ -144,7 +144,7 @@ ############################################################################### # Create an ``Animation`` and adding the sphere actor to it. -animation = fury.animation.Animation(sphere) +animation = fury.animation.Animation(actors=sphere) ############################################################################### # Setting Cubic Bezier keyframes @@ -179,7 +179,7 @@ ############################################################################### # Initializing the timeline to be able to control the playback of the # animation. -timeline = fury.animation.Timeline(animation, playback_panel=True) +timeline = fury.animation.Timeline(animations=animation, playback_panel=True) ############################################################################### # We only need to add the ``Timeline`` to the ``ShowManager`` @@ -191,5 +191,5 @@ show_manager.start() fury.window.record( - showm.scene, out_path="viz_keyframe_animation_bezier_2.png", size=(900, 768) + scene=showm.scene, out_path="viz_keyframe_animation_bezier_2.png", size=(900, 768) ) diff --git a/docs/examples/viz_billboard_sdf_spheres.py b/docs/examples/viz_billboard_sdf_spheres.py index 324809d4e..4dcb2b805 100644 --- a/docs/examples/viz_billboard_sdf_spheres.py +++ b/docs/examples/viz_billboard_sdf_spheres.py @@ -80,7 +80,7 @@ if interactive: fury.window.show(scene) else: - fury.window.record(scene, size=(600, 600), out_path="viz_regular_spheres.png") + fury.window.record(scene=scene, size=(600, 600), out_path="viz_regular_spheres.png") ############################################################################### # Now, let's explore our scene to understand what we have created. Traditional @@ -92,7 +92,9 @@ if interactive: fury.window.show(scene) else: - fury.window.record(scene, size=(600, 600), out_path="viz_low_res_wireframe.png") + fury.window.record( + scene=scene, size=(600, 600), out_path="viz_low_res_wireframe.png" + ) ############################################################################### # Let's clean the scene and play with the parameters `phi` and `theta`. @@ -106,7 +108,9 @@ if interactive: fury.window.show(scene) else: - fury.window.record(scene, size=(600, 600), out_path="viz_hi_res_wireframe.png") + fury.window.record( + scene=scene, size=(600, 600), out_path="viz_hi_res_wireframe.png" + ) ############################################################################### # As you might have noticed, these parameters control the resolution of the @@ -137,7 +141,9 @@ if interactive: fury.window.show(scene) else: - fury.window.record(scene, size=(600, 600), out_path="viz_billboards_wireframe.png") + fury.window.record( + scene=scene, size=(600, 600), out_path="viz_billboards_wireframe.png" + ) ############################################################################### # If you interacted with this actor, you might have noticed how it always @@ -187,7 +193,9 @@ if interactive: fury.window.show(scene) else: - fury.window.record(scene, size=(600, 600), out_path="viz_billboards_circles.png") + fury.window.record( + scene=scene, size=(600, 600), out_path="viz_billboards_circles.png" + ) ############################################################################### # Hold on, those actors don't look exactly like the ones we created using @@ -280,7 +288,9 @@ if interactive: fury.window.show(scene) else: - fury.window.record(scene, size=(600, 600), out_path="viz_billboards_spheres.png") + fury.window.record( + scene=scene, size=(600, 600), out_path="viz_billboards_spheres.png" + ) ############################################################################### # References diff --git a/docs/examples/viz_brownian_motion.py b/docs/examples/viz_brownian_motion.py index 4fc2c728e..1ad06ff28 100644 --- a/docs/examples/viz_brownian_motion.py +++ b/docs/examples/viz_brownian_motion.py @@ -58,7 +58,7 @@ def particle( ): _origin = np.asarray(_origin, dtype=float) position = np.tile(origin, (_num_total_steps, 1)) - path_actor = fury.actor.line([position], colors, linewidth=_path_thickness) + path_actor = fury.actor.line([position], colors=colors, linewidth=_path_thickness) path_actor.position = position path_actor.delta = _delta path_actor.num_total_steps = _num_total_steps @@ -98,7 +98,7 @@ def update_path(act, counter_step): position=(0, 0, 40), focal_point=(0.0, 0.0, 0.0), view_up=(0.0, 0.0, 0.0) ) showm = fury.window.ShowManager( - scene, size=(600, 600), reset_camera=True, order_transparent=True + scene=scene, size=(600, 600), reset_camera=True, order_transparent=True ) @@ -155,4 +155,6 @@ def timer_callback(_obj, _event): showm.add_timer_callback(True, 30, timer_callback) showm.start() -fury.window.record(showm.scene, size=(600, 600), out_path="viz_brownian_motion.png") +fury.window.record( + scene=showm.scene, size=(600, 600), out_path="viz_brownian_motion.png" +) diff --git a/docs/examples/viz_buttons.py b/docs/examples/viz_buttons.py index f0c6eb90d..fab9ffd37 100644 --- a/docs/examples/viz_buttons.py +++ b/docs/examples/viz_buttons.py @@ -88,4 +88,6 @@ def change_icon_callback(i_ren, _obj, _button): if interactive: show_manager.start() -fury.window.record(show_manager.scene, size=current_size, out_path="viz_button.png") +fury.window.record( + scene=show_manager.scene, size=current_size, out_path="viz_button.png" +) diff --git a/docs/examples/viz_camera.py b/docs/examples/viz_camera.py index 13efe2aeb..a00985e31 100644 --- a/docs/examples/viz_camera.py +++ b/docs/examples/viz_camera.py @@ -22,7 +22,7 @@ scene = fury.window.Scene() showm = fury.window.ShowManager( - scene, size=(900, 768), reset_camera=False, order_transparent=True + scene=scene, size=(900, 768), reset_camera=False, order_transparent=True ) @@ -60,11 +60,11 @@ ############################################################################### # Creating "FURY" text # ==================== -fury_text = fury.actor.vector_text("FURY", pos=(-4.3, 15, 0), scale=(2, 2, 2)) +fury_text = fury.actor.vector_text(text="FURY", pos=(-4.3, 15, 0), scale=(2, 2, 2)) ############################################################################### # Creating an ``Animation`` to animate the opacity of ``fury_text`` -text_anim = Animation(fury_text, loop=False) +text_anim = Animation(actors=fury_text, loop=False) ############################################################################### # opacity is set to 0 at time 29 and set to one at time 35. @@ -87,14 +87,16 @@ # and radius. actors = [ fury.actor.sphere( - np.array([[0, 0, 0]]), np.random.random([1, 3]), np.random.random([1, 3]) + np.array([[0, 0, 0]]), + np.random.random([1, 3]), + radii=np.random.random([1, 3]), ) ] ########################################################################### # create a timeline to animate this actor (single actor or list of actors) # Actors can be added later using `Timeline.add_actor(actor)` - animation = Animation(actors) + animation = Animation(actors=actors) # We generate random position and scale values from time=0 to time=49 each # two seconds. @@ -176,4 +178,6 @@ if interactive: showm.start() -fury.window.record(scene, out_path="viz_keyframe_animation_camera.png", size=(900, 768)) +fury.window.record( + scene=scene, out_path="viz_keyframe_animation_camera.png", size=(900, 768) +) diff --git a/docs/examples/viz_card.py b/docs/examples/viz_card.py index 1984938f0..0ce4aa6d1 100644 --- a/docs/examples/viz_card.py +++ b/docs/examples/viz_card.py @@ -57,4 +57,4 @@ if interactive: show_manager.start() -fury.window.record(show_manager.scene, out_path="card_ui.png", size=(1000, 1000)) +fury.window.record(scene=show_manager.scene, out_path="card_ui.png", size=(1000, 1000)) diff --git a/docs/examples/viz_card_sprite_sheet.py b/docs/examples/viz_card_sprite_sheet.py index 0a783b439..8507a095f 100644 --- a/docs/examples/viz_card_sprite_sheet.py +++ b/docs/examples/viz_card_sprite_sheet.py @@ -110,4 +110,4 @@ def sprite_to_vtk(): if interactive: show_manager.start() -fury.window.record(show_manager.scene, out_path="card_ui.png", size=(1000, 1000)) +fury.window.record(scene=show_manager.scene, out_path="card_ui.png", size=(1000, 1000)) diff --git a/docs/examples/viz_check_boxes.py b/docs/examples/viz_check_boxes.py index 4caed6c4b..a9c8e8460 100644 --- a/docs/examples/viz_check_boxes.py +++ b/docs/examples/viz_check_boxes.py @@ -107,7 +107,7 @@ def toggle_color(checkboxes): figure_dict = {"cube": cube, "sphere": sphere, "cone": cone, "arrow": arrow} check_box = ui.Checkbox( list(figure_dict), - list(figure_dict), + checked_labels=list(figure_dict), padding=1, font_size=18, font_family="Arial", @@ -161,4 +161,4 @@ def toggle_color(checkboxes): if interactive: show_manager.start() -window.record(show_manager.scene, size=current_size, out_path="viz_checkbox.png") +window.record(scene=show_manager.scene, size=current_size, out_path="viz_checkbox.png") diff --git a/docs/examples/viz_color_interpolators.py b/docs/examples/viz_color_interpolators.py index af90f4aca..408babb14 100644 --- a/docs/examples/viz_color_interpolators.py +++ b/docs/examples/viz_color_interpolators.py @@ -23,7 +23,7 @@ scene = window.Scene() showm = window.ShowManager( - scene, size=(900, 768), reset_camera=False, order_transparent=True + scene=scene, size=(900, 768), reset_camera=False, order_transparent=True ) @@ -41,11 +41,11 @@ ############################################################################### # Static labels for different interpolators (for show) -linear_text = actor.vector_text("Linear", (-2.64, -1, 0)) -lab_text = actor.vector_text("LAB", (-0.37, -1, 0)) -hsv_text = actor.vector_text("HSV", (1.68, -1, 0)) -xyz_text = actor.vector_text("XYZ", (3.6, -1, 0)) -step_text = actor.vector_text("Step", (5.7, -1, 0)) +linear_text = actor.vector_text(text="Linear", pos=(-2.64, -1, 0)) +lab_text = actor.vector_text(text="LAB", pos=(-0.37, -1, 0)) +hsv_text = actor.vector_text(text="HSV", pos=(1.68, -1, 0)) +xyz_text = actor.vector_text(text="XYZ", pos=(3.6, -1, 0)) +step_text = actor.vector_text(text="Step", pos=(5.7, -1, 0)) scene.add(step_text, lab_text, linear_text, hsv_text, xyz_text) ############################################################################### @@ -53,11 +53,11 @@ # Also cube actor is provided for each timeline to handle as follows: # ``Animation(actor)``, ``Animation(list_of_actors)``, or actors can be added # later using ``animation.add()`` or ``animation.add_actor()`` -anim_linear_color = Animation(actor.cube(cubes_pos[0])) -anim_LAB_color = Animation(actor.cube(cubes_pos[1])) -anim_HSV_color = Animation(actor.cube(cubes_pos[2])) -anim_XYZ_color = Animation(actor.cube(cubes_pos[3])) -anim_step_color = Animation(actor.cube(cubes_pos[4])) +anim_linear_color = Animation(actors=actor.cube(cubes_pos[0])) +anim_LAB_color = Animation(actors=actor.cube(cubes_pos[1])) +anim_HSV_color = Animation(actors=actor.cube(cubes_pos[2])) +anim_XYZ_color = Animation(actors=actor.cube(cubes_pos[3])) +anim_step_color = Animation(actors=actor.cube(cubes_pos[4])) ############################################################################### # Creating a timeline to control all the animations (one for each color @@ -108,4 +108,6 @@ if interactive: showm.start() -window.record(scene, out_path="viz_keyframe_animation_colors.png", size=(900, 768)) +window.record( + scene=scene, out_path="viz_keyframe_animation_colors.png", size=(900, 768) +) diff --git a/docs/examples/viz_combobox.py b/docs/examples/viz_combobox.py index 5b41808a9..1417d48da 100644 --- a/docs/examples/viz_combobox.py +++ b/docs/examples/viz_combobox.py @@ -87,4 +87,4 @@ def change_color(combobox): if interactive: showm.start() -window.record(showm.scene, out_path="combobox_ui.png", size=(400, 400)) +window.record(scene=showm.scene, out_path="combobox_ui.png", size=(400, 400)) diff --git a/docs/examples/viz_cone.py b/docs/examples/viz_cone.py index 1ca7d2ca7..87ed133a7 100644 --- a/docs/examples/viz_cone.py +++ b/docs/examples/viz_cone.py @@ -44,4 +44,4 @@ if interactive: window.show(scene, size=(600, 600)) -window.record(scene, out_path="viz_cone.png", size=(600, 600)) +window.record(scene=scene, out_path="viz_cone.png", size=(600, 600)) diff --git a/docs/examples/viz_custom_interpolator.py b/docs/examples/viz_custom_interpolator.py index 1e30d70a3..6287f56e0 100644 --- a/docs/examples/viz_custom_interpolator.py +++ b/docs/examples/viz_custom_interpolator.py @@ -116,7 +116,7 @@ def interpolate(t): scene = window.Scene() showm = window.ShowManager( - scene, size=(900, 768), reset_camera=False, order_transparent=True + scene=scene, size=(900, 768), reset_camera=False, order_transparent=True ) @@ -164,4 +164,6 @@ def interpolate(t): if interactive: showm.start() -window.record(scene, out_path="viz_keyframe_custom_interpolator.png", size=(900, 768)) +window.record( + scene=scene, out_path="viz_keyframe_custom_interpolator.png", size=(900, 768) +) diff --git a/docs/examples/viz_drawpanel.py b/docs/examples/viz_drawpanel.py index 3a0fe1d76..d7436d8dd 100644 --- a/docs/examples/viz_drawpanel.py +++ b/docs/examples/viz_drawpanel.py @@ -42,4 +42,6 @@ drawing_canvas.draw_shape(shape_type="circle", current_position=(275, 275)) drawing_canvas.shape_list[-1].resize((50, 50)) - fury.window.record(showm.scene, size=current_size, out_path="viz_drawpanel.png") + fury.window.record( + scene=showm.scene, size=current_size, out_path="viz_drawpanel.png" + ) diff --git a/docs/examples/viz_dt_ellipsoids.py b/docs/examples/viz_dt_ellipsoids.py index 4b2d37e02..5dbe53886 100644 --- a/docs/examples/viz_dt_ellipsoids.py +++ b/docs/examples/viz_dt_ellipsoids.py @@ -46,7 +46,7 @@ # vertices that made up the sphere, which have a standard number of 100, 200, # and 724 vertices. -vertices, faces = fury.prim_sphere("repulsion100", True) +vertices, faces = fury.prim_sphere(name="repulsion100", gen_faces=True) ############################################################################### @@ -80,7 +80,7 @@ def __init__(self, vertices, faces): scene.add(tensor_slice) # Create show manager -showm = fury.window.ShowManager(scene, size=(600, 600)) +showm = fury.window.ShowManager(scene=scene, size=(600, 600)) # Enables/disables interactive visualization interactive = False @@ -88,7 +88,7 @@ def __init__(self, vertices, faces): if interactive: showm.start() -fury.window.record(showm.scene, size=(600, 600), out_path="tensor_slice_100.png") +fury.window.record(scene=showm.scene, size=(600, 600), out_path="tensor_slice_100.png") ############################################################################### # If we zoom in at the scene to see with detail the tensor ellipsoids displayed @@ -96,7 +96,7 @@ def __init__(self, vertices, faces): scene.roll(10) scene.pitch(90) -showm = fury.window.ShowManager(scene, size=(600, 600), order_transparent=True) +showm = fury.window.ShowManager(scene=scene, size=(600, 600), order_transparent=True) showm.scene.zoom(50) if interactive: @@ -104,7 +104,7 @@ def __init__(self, vertices, faces): showm.start() fury.window.record( - showm.scene, + scene=showm.scene, out_path="tensor_slice_100_zoom.png", size=(600, 300), reset_camera=False, @@ -171,7 +171,7 @@ def get_params(evecs, evals): if interactive: showm.start() -fury.window.record(scene, size=(600, 600), out_path="tensor_slice_sdf.png") +fury.window.record(scene=scene, size=(600, 600), out_path="tensor_slice_sdf.png") ############################################################################### # Thus, one can see that the same result is obtained, however there is a @@ -182,7 +182,7 @@ def get_params(evecs, evals): scene.roll(10) scene.pitch(90) -showm = fury.window.ShowManager(scene, size=(600, 600), order_transparent=True) +showm = fury.window.ShowManager(scene=scene, size=(600, 600), order_transparent=True) showm.scene.zoom(50) if interactive: @@ -190,7 +190,7 @@ def get_params(evecs, evals): showm.start() fury.window.record( - showm.scene, + scene=showm.scene, out_path="tensor_slice_sdf_zoom.png", size=(600, 300), reset_camera=False, @@ -221,9 +221,9 @@ def get_params(evecs, evals): evals[..., :] = mevals evecs[..., :, :] = mevecs -vertices, faces = fury.prim_sphere("repulsion200", True) +vertices, faces = fury.prim_sphere(name="repulsion200", gen_faces=True) sphere200 = Sphere(vertices, faces) -vertices, faces = fury.prim_sphere("repulsion724", True) +vertices, faces = fury.prim_sphere(name="repulsion724", gen_faces=True) sphere724 = Sphere(vertices, faces) tensor_100 = fury.actor.tensor_slicer( @@ -247,10 +247,10 @@ def get_params(evecs, evals): objects = [tensor_100, tensor_200, tensor_724, tensor_sdf] text = [ - fury.actor.vector_text("Tensor 100"), - fury.actor.vector_text("Tensor 200"), - fury.actor.vector_text("Tensor 724"), - fury.actor.vector_text("Tensor SDF"), + fury.actor.vector_text(text="Tensor 100"), + fury.actor.vector_text(text="Tensor 200"), + fury.actor.vector_text(text="Tensor 724"), + fury.actor.vector_text(text="Tensor SDF"), ] grid_ui = fury.ui.GridUI( @@ -265,14 +265,14 @@ def get_params(evecs, evals): scene.background([255, 255, 255]) scene.zoom(3.5) scene.set_camera(position=(3.2, -20, 12), focal_point=(3.2, 0.0, 0.0)) -showm = fury.window.ShowManager(scene, size=(560, 200)) +showm = fury.window.ShowManager(scene=scene, size=(560, 200)) showm.scene.add(grid_ui) if interactive: showm.start() fury.window.record( - showm.scene, + scene=showm.scene, size=(560, 200), out_path="tensor_comparison.png", reset_camera=False, @@ -303,7 +303,7 @@ def get_params(evecs, evals): if interactive: showm.start() -fury.window.record(showm.scene, size=(600, 600), out_path="tensor_roi_100.png") +fury.window.record(scene=showm.scene, size=(600, 600), out_path="tensor_roi_100.png") showm.scene.clear() @@ -323,7 +323,7 @@ def get_params(evecs, evals): if interactive: showm.start() -fury.window.record(showm.scene, size=(600, 600), out_path="tensor_roi_sdf.png") +fury.window.record(scene=showm.scene, size=(600, 600), out_path="tensor_roi_sdf.png") showm.scene.clear() @@ -348,13 +348,13 @@ def get_params(evecs, evals): scene = fury.window.Scene() scene.add(tensors) scene.pitch(180) -showm = fury.window.ShowManager(scene, size=(600, 600)) +showm = fury.window.ShowManager(scene=scene, size=(600, 600)) if interactive: showm.start() fury.window.record( - showm.scene, + scene=showm.scene, size=(600, 600), reset_camera=False, out_path="tensor_whole_brain_sdf.png", diff --git a/docs/examples/viz_earth_animation.py b/docs/examples/viz_earth_animation.py index 38675c595..d3ec765bd 100644 --- a/docs/examples/viz_earth_animation.py +++ b/docs/examples/viz_earth_animation.py @@ -55,14 +55,14 @@ moon_actor.SetPosition(1, 0.1, 0.5) moon_actor.SetScale(0.25, 0.25, 0.25) -fury.utils.rotate(earth_actor, (-90, 1, 0, 0)) +fury.utils.rotate(earth_actor, rotation=(-90, 1, 0, 0)) ############################################################################## # The ShowManager class is the interface between the scene, the window and the # interactor. showm = fury.window.ShowManager( - scene, size=(900, 768), reset_camera=False, order_transparent=True + scene=scene, size=(900, 768), reset_camera=False, order_transparent=True ) ############################################################################## @@ -88,15 +88,18 @@ center = np.array([[-0.39, 0.3175, 0.025]]) radius = 0.002 -sphere_actor = fury.actor.sphere(center, fury.window.colors.blue_medium, radius) +sphere_actor = fury.actor.sphere(center, fury.window.colors.blue_medium, radii=radius) ############################################################################## # Also creating a text actor to add below the sphere. text_actor = fury.actor.text_3d( - "Bloomington, Indiana", (-0.42, 0.31, 0.03), fury.window.colors.white, 0.004 + "Bloomington, Indiana", + position=(-0.42, 0.31, 0.03), + color=fury.window.colors.white, + font_size=0.004, ) -fury.utils.rotate(text_actor, (-90, 0, 1, 0)) +fury.utils.rotate(text_actor, rotation=(-90, 0, 1, 0)) ############################################################################## # Let's also import a model of a satellite to visualize circling the moon. @@ -121,7 +124,7 @@ def timer_callback(_obj, _event): cnt = next(counter) showm.render() if cnt < 450: - fury.utils.rotate(earth_actor, (1, 0, 1, 0)) + fury.utils.rotate(earth_actor, rotation=(1, 0, 1, 0)) if cnt % 5 == 0 and cnt < 450: showm.scene.azimuth(-1) if cnt == 300: @@ -146,15 +149,15 @@ def timer_callback(_obj, _event): ) scene.zoom(0.03) scene.add(satellite_actor) - fury.utils.rotate(satellite_actor, (180, 0, 1, 0)) + fury.utils.rotate(satellite_actor, rotation=(180, 0, 1, 0)) scene.rm(earth_actor) if cnt > 575 and cnt < 750: showm.scene.azimuth(-2) - fury.utils.rotate(moon_actor, (-2, 0, 1, 0)) + fury.utils.rotate(moon_actor, rotation=(-2, 0, 1, 0)) satellite_actor.SetPosition(-0.8, 0.1 - cnt / 10000, 0.4) if cnt >= 750 and cnt < 1100: showm.scene.azimuth(-2) - fury.utils.rotate(moon_actor, (-2, 0, 1, 0)) + fury.utils.rotate(moon_actor, rotation=(-2, 0, 1, 0)) satellite_actor.SetPosition(-0.8, -0.07 + cnt / 10000, 0.4) if cnt == 1100: showm.exit() @@ -166,4 +169,6 @@ def timer_callback(_obj, _event): showm.add_timer_callback(True, 35, timer_callback) showm.start() -fury.window.record(showm.scene, size=(900, 768), out_path="viz_earth_animation.png") +fury.window.record( + scene=showm.scene, size=(900, 768), out_path="viz_earth_animation.png" +) diff --git a/docs/examples/viz_earth_coordinates.py b/docs/examples/viz_earth_coordinates.py index 6b5abd564..49e00f6bd 100644 --- a/docs/examples/viz_earth_coordinates.py +++ b/docs/examples/viz_earth_coordinates.py @@ -31,8 +31,8 @@ # Rotate the Earth to make sure the texture is correctly oriented. Change it's # scale using ``actor.SetScale()``. -fury.utils.rotate(earth_actor, (-90, 1, 0, 0)) -fury.utils.rotate(earth_actor, (180, 0, 1, 0)) +fury.utils.rotate(earth_actor, rotation=(-90, 1, 0, 0)) +fury.utils.rotate(earth_actor, rotation=(180, 0, 1, 0)) earth_actor.SetScale(2, 2, 2) ############################################################################### @@ -72,7 +72,7 @@ def latlong_coordinates(lat, lon): centers = np.array([[*locationone], [*locationtwo], [*locationthree]]) colors = np.random.rand(3, 3) radii = np.array([0.005, 0.005, 0.005]) -sphere_actor = fury.actor.sphere(centers, colors, radii) +sphere_actor = fury.actor.sphere(centers, colors, radii=radii) scene.add(sphere_actor) ############################################################################### @@ -81,32 +81,32 @@ def latlong_coordinates(lat, lon): nyc_actor = fury.actor.text_3d( "New York City, New York\n40.7128° N, 74.0060° W", - (locationone[0] - 0.04, locationone[1], locationone[2] + 0.07), - fury.window.colors.white, - 0.01, + position=(locationone[0] - 0.04, locationone[1], locationone[2] + 0.07), + color=fury.window.colors.white, + font_size=0.01, ) paris_actor = fury.actor.text_3d( "Paris, France\n48.8566° N, 2.3522° E", - (locationthree[0] - 0.04, locationthree[1], locationthree[2] - 0.07), - fury.window.colors.white, - 0.01, + position=(locationthree[0] - 0.04, locationthree[1], locationthree[2] - 0.07), + color=fury.window.colors.white, + font_size=0.01, ) beijing_actor = fury.actor.text_3d( "Beijing, China\n39.9042° N, 116.4074° E", - (locationtwo[0] - 0.06, locationtwo[1], locationtwo[2] - 0.07), - fury.window.colors.white, - 0.01, + position=(locationtwo[0] - 0.06, locationtwo[1], locationtwo[2] - 0.07), + color=fury.window.colors.white, + font_size=0.01, ) -fury.utils.rotate(paris_actor, (85, 0, 1, 0)) -fury.utils.rotate(beijing_actor, (180, 0, 1, 0)) -fury.utils.rotate(nyc_actor, (5, 1, 0, 0)) +fury.utils.rotate(paris_actor, rotation=(85, 0, 1, 0)) +fury.utils.rotate(beijing_actor, rotation=(180, 0, 1, 0)) +fury.utils.rotate(nyc_actor, rotation=(5, 1, 0, 0)) ############################################################################## # Create a ShowManager object, which acts as the interface between the scene, # the window and the interactor. showm = fury.window.ShowManager( - scene, size=(900, 768), reset_camera=False, order_transparent=True + scene=scene, size=(900, 768), reset_camera=False, order_transparent=True ) ############################################################################### @@ -156,4 +156,6 @@ def timer_callback(_obj, _event): showm.add_timer_callback(True, 25, timer_callback) showm.start() -fury.window.record(showm.scene, size=(900, 768), out_path="viz_earth_coordinates.png") +fury.window.record( + scene=showm.scene, size=(900, 768), out_path="viz_earth_coordinates.png" +) diff --git a/docs/examples/viz_emwave_animation.py b/docs/examples/viz_emwave_animation.py index 3968f5c24..9994b8501 100644 --- a/docs/examples/viz_emwave_animation.py +++ b/docs/examples/viz_emwave_animation.py @@ -71,7 +71,7 @@ def update_coordinates(wavenumber, ang_frq, time, phase_angle): position=(-6, 5, -10), focal_point=(0.0, 0.0, 0.0), view_up=(0.0, 0.0, 0.0) ) showm = fury.window.ShowManager( - scene, size=(800, 600), reset_camera=True, order_transparent=True + scene=scene, size=(800, 600), reset_camera=True, order_transparent=True ) @@ -86,7 +86,7 @@ def update_coordinates(wavenumber, ang_frq, time, phase_angle): centers, directions, fury.window.colors.yellow, - heights, + heights=heights, resolution=20, tip_length=0.06, tip_radius=0.012, @@ -105,11 +105,11 @@ def update_coordinates(wavenumber, ang_frq, time, phase_angle): pts = np.array(list(zip(x, y, z))) pts = [pts] colors = fury.window.colors.red -wave_actor1 = fury.actor.line(pts, colors, linewidth=3) +wave_actor1 = fury.actor.line(pts, colors=colors, linewidth=3) scene.add(wave_actor1) vertices = fury.utils.vertices_from_actor(wave_actor1) -vcolors = fury.utils.colors_from_actor(wave_actor1, "colors") +vcolors = fury.utils.colors_from_actor(wave_actor1, array_name="colors") no_vertices_per_point = len(vertices) / npoints initial_vertices = vertices.copy() - np.repeat(pts, no_vertices_per_point, axis=0) @@ -124,11 +124,11 @@ def update_coordinates(wavenumber, ang_frq, time, phase_angle): pts2 = np.array(list(zip(xx, yy, zz))) pts2 = [pts2] colors2 = fury.window.colors.blue -wave_actor2 = fury.actor.line(pts2, colors2, linewidth=3) +wave_actor2 = fury.actor.line(pts2, colors=colors2, linewidth=3) scene.add(wave_actor2) vertices2 = fury.utils.vertices_from_actor(wave_actor2) -vcolors2 = fury.utils.colors_from_actor(wave_actor2, "colors") +vcolors2 = fury.utils.colors_from_actor(wave_actor2, array_name="colors") no_vertices_per_point2 = len(vertices2) / npoints initial_vertices2 = vertices2.copy() - np.repeat(pts2, no_vertices_per_point2, axis=0) @@ -186,4 +186,4 @@ def timer_callback(_obj, _event): interactive = False if interactive: showm.start() -fury.window.record(showm.scene, size=(800, 600), out_path="viz_emwave.png") +fury.window.record(scene=showm.scene, size=(800, 600), out_path="viz_emwave.png") diff --git a/docs/examples/viz_fine_tuning_gl_context.py b/docs/examples/viz_fine_tuning_gl_context.py index a347bf691..68fd8f6ce 100644 --- a/docs/examples/viz_fine_tuning_gl_context.py +++ b/docs/examples/viz_fine_tuning_gl_context.py @@ -68,7 +68,7 @@ scene.background((0.5, 0.5, 0.5)) showm = fury.window.ShowManager( - scene, size=(900, 768), reset_camera=False, order_transparent=False + scene=scene, size=(900, 768), reset_camera=False, order_transparent=False ) ############################################################################### @@ -154,4 +154,6 @@ def timer_callback(obj, event): if interactive: showm.start() -fury.window.record(scene, out_path="viz_fine_tuning_gl_context.png", size=(600, 600)) +fury.window.record( + scene=scene, out_path="viz_fine_tuning_gl_context.png", size=(600, 600) +) diff --git a/docs/examples/viz_fractals.py b/docs/examples/viz_fractals.py index a1573c194..1dce12642 100644 --- a/docs/examples/viz_fractals.py +++ b/docs/examples/viz_fractals.py @@ -90,7 +90,7 @@ def gen_centers(depth, pos, center, dist): vertices, triangles, colors, _ = fury.primitive.repeat_primitive( centers=centers, colors=colors, vertices=vertices, faces=faces ) - return fury.utils.get_actor_from_primitive(vertices, triangles, colors) + return fury.utils.get_actor_from_primitive(vertices, triangles, colors=colors) ############################################################################### @@ -158,7 +158,7 @@ def gen_centers(depth, pos, center, dist): vertices, triangles, colors, _ = fury.primitive.repeat_primitive( centers=centers, colors=colors, vertices=vertices, faces=faces ) - return fury.utils.get_actor_from_primitive(vertices, triangles, colors) + return fury.utils.get_actor_from_primitive(vertices, triangles, colors=colors) ############################################################################### @@ -213,7 +213,7 @@ def gen_centers(depth, pos, center, side): vertices, triangles, colors, _ = fury.primitive.repeat_primitive( centers=centers, colors=colors, vertices=vertices, faces=faces ) - return fury.utils.get_actor_from_primitive(vertices, triangles, colors) + return fury.utils.get_actor_from_primitive(vertices, triangles, colors=colors) ############################################################################### @@ -221,7 +221,9 @@ def gen_centers(depth, pos, center, side): # the Scene and ShowManager. scene = fury.window.Scene() -showmgr = fury.window.ShowManager(scene, "Fractals", (800, 800), reset_camera=True) +showmgr = fury.window.ShowManager( + scene=scene, title="Fractals", size=(800, 800), reset_camera=True +) ############################################################################### # These values are what work nicely on my machine without lagging. If you have @@ -289,4 +291,4 @@ def timer_callback(_obj, _event): if interactive: showmgr.start() else: - fury.window.record(showmgr.scene, out_path="fractals.png", size=(800, 800)) + fury.window.record(scene=showmgr.scene, out_path="fractals.png", size=(800, 800)) diff --git a/docs/examples/viz_gltf.py b/docs/examples/viz_gltf.py index fd803b4a8..871b6067b 100644 --- a/docs/examples/viz_gltf.py +++ b/docs/examples/viz_gltf.py @@ -44,4 +44,4 @@ if interactive: fury.window.show(scene, size=(1280, 720)) -fury.window.record(scene, out_path="viz_gltf.png", size=(1280, 720)) +fury.window.record(scene=scene, out_path="viz_gltf.png", size=(1280, 720)) diff --git a/docs/examples/viz_gltf_animated.py b/docs/examples/viz_gltf_animated.py index b98dfb312..4874860a7 100644 --- a/docs/examples/viz_gltf_animated.py +++ b/docs/examples/viz_gltf_animated.py @@ -14,7 +14,7 @@ scene = fury.window.Scene() showm = fury.window.ShowManager( - scene, size=(900, 768), reset_camera=False, order_transparent=True + scene=scene, size=(900, 768), reset_camera=False, order_transparent=True ) showm.initialize() @@ -52,4 +52,4 @@ def timer_callback(_obj, _event): if interactive: showm.start() -fury.window.record(scene, out_path="viz_gltf_animated.png", size=(900, 768)) +fury.window.record(scene=scene, out_path="viz_gltf_animated.png", size=(900, 768)) diff --git a/docs/examples/viz_gltf_export.py b/docs/examples/viz_gltf_export.py index 93cf1280a..e0f9c56e3 100644 --- a/docs/examples/viz_gltf_export.py +++ b/docs/examples/viz_gltf_export.py @@ -64,4 +64,4 @@ if interactive: fury.window.show(scene, size=(1280, 720)) -fury.window.record(scene, out_path="viz_gltf_export.png", size=(1280, 720)) +fury.window.record(scene=scene, out_path="viz_gltf_export.png", size=(1280, 720)) diff --git a/docs/examples/viz_hierarchical_animation.py b/docs/examples/viz_hierarchical_animation.py index 5e0772493..cae38f438 100644 --- a/docs/examples/viz_hierarchical_animation.py +++ b/docs/examples/viz_hierarchical_animation.py @@ -13,7 +13,7 @@ scene = fury.window.Scene() showm = fury.window.ShowManager( - scene, size=(900, 768), reset_camera=False, order_transparent=True + scene=scene, size=(900, 768), reset_camera=False, order_transparent=True ) showm.initialize() @@ -34,7 +34,7 @@ ############################################################################### # Adding the the car's body to an Animation to be able to animate it later. -car_anim = fury.animation.Animation(body_actor) +car_anim = fury.animation.Animation(actors=body_actor) ############################################################################### # Creating the wheels of the car @@ -65,7 +65,7 @@ # Animating each wheel and setting its position to the right position using a # single keyframe that will not change. -wheels_animations = [fury.animation.Animation(wheel) for wheel in wheels] +wheels_animations = [fury.animation.Animation(actors=wheel) for wheel in wheels] for wheel_anim in wheels_animations: wheel_anim.set_position(0.0, wheel_positions.pop()) @@ -83,7 +83,7 @@ ############################################################################### # In order to animate the shaft actor we have to add it to an Animation -radar_shaft_anim = fury.animation.Animation(radar_shaft) +radar_shaft_anim = fury.animation.Animation(actors=radar_shaft) ############################################################################### # Setting a single position keyframe will make sure the actor will be placed at @@ -104,7 +104,7 @@ ############################################################################### # Then add it to an animation in order to rotate it -radar_animation = fury.animation.Animation(radar) +radar_animation = fury.animation.Animation(actors=radar) ############################################################################### # Set position and rotation as done above with the shaft. @@ -142,5 +142,5 @@ showm.start() fury.window.record( - scene, out_path="viz_keyframe_hierarchical_animation.png", size=(900, 768) + scene=scene, out_path="viz_keyframe_hierarchical_animation.png", size=(900, 768) ) diff --git a/docs/examples/viz_interaction.py b/docs/examples/viz_interaction.py index 73eb145dc..e3391b970 100644 --- a/docs/examples/viz_interaction.py +++ b/docs/examples/viz_interaction.py @@ -80,7 +80,7 @@ scene.add(actors) - showm = fury.window.ShowManager(scene, size=(window_size[0], window_size[1])) + showm = fury.window.ShowManager(scene=scene, size=(window_size[0], window_size[1])) stream = fury.stream.FuryStreamClient( showm, max_window_size=max_window_size, use_raw_array=use_raw_array @@ -121,7 +121,7 @@ p.start() stream_interaction.start(ms=ms_interaction) stream.start( - ms_stream, + ms=ms_stream, ) ########################################################################### # If you have aiortc in your system, you can see your live streaming @@ -141,4 +141,6 @@ stream.cleanup() stream_interaction.cleanup() - fury.window.record(showm.scene, size=window_size, out_path="viz_interaction.png") + fury.window.record( + scene=showm.scene, size=window_size, out_path="viz_interaction.png" + ) diff --git a/docs/examples/viz_interpolators.py b/docs/examples/viz_interpolators.py index 104bd40e1..769561fc5 100644 --- a/docs/examples/viz_interpolators.py +++ b/docs/examples/viz_interpolators.py @@ -62,7 +62,7 @@ scene = fury.window.Scene() showm = fury.window.ShowManager( - scene, size=(900, 768), reset_camera=False, order_transparent=True + scene=scene, size=(900, 768), reset_camera=False, order_transparent=True ) showm.initialize() @@ -78,7 +78,7 @@ ############################################################################### # Adding the sphere actor to the timeline # This could've been done during initialization. -animation.add_actor(arrow) +animation.add_actor(actor=arrow) ############################################################################### # Setting position keyframes @@ -131,4 +131,6 @@ if interactive: showm.start() -fury.window.record(scene, out_path="viz_keyframe_interpolator.png", size=(900, 768)) +fury.window.record( + scene=scene, out_path="viz_keyframe_interpolator.png", size=(900, 768) +) diff --git a/docs/examples/viz_introduction.py b/docs/examples/viz_introduction.py index 55c6a124e..28a577a85 100644 --- a/docs/examples/viz_introduction.py +++ b/docs/examples/viz_introduction.py @@ -61,7 +61,7 @@ scene = fury.window.Scene() -showm = fury.window.ShowManager(scene, size=(900, 768)) +showm = fury.window.ShowManager(scene=scene, size=(900, 768)) showm.initialize() @@ -80,7 +80,7 @@ ############################################################################### # Then lets add the sphere actor to the ``Animation`` -animation.add_actor(sphere) +animation.add_actor(actor=sphere) ############################################################################### # Then, we set our position keyframes at different timestamps @@ -112,5 +112,5 @@ showm.start() fury.window.record( - scene, out_path="viz_keyframe_animation_introduction.png", size=(900, 768) + scene=scene, out_path="viz_keyframe_animation_introduction.png", size=(900, 768) ) diff --git a/docs/examples/viz_layout.py b/docs/examples/viz_layout.py index 1859caf96..13e09fd53 100644 --- a/docs/examples/viz_layout.py +++ b/docs/examples/viz_layout.py @@ -61,4 +61,4 @@ if interactive: show_manager.start() -fury.window.record(show_manager.scene, out_path="ui_layout.png", size=(400, 400)) +fury.window.record(scene=show_manager.scene, out_path="ui_layout.png", size=(400, 400)) diff --git a/docs/examples/viz_markers.py b/docs/examples/viz_markers.py index 5a532598d..ccafd69fc 100644 --- a/docs/examples/viz_markers.py +++ b/docs/examples/viz_markers.py @@ -55,4 +55,4 @@ if interactive: fury.window.show(scene, size=(600, 600)) -fury.window.record(scene, out_path="viz_markers.png", size=(600, 600)) +fury.window.record(scene=scene, out_path="viz_markers.png", size=(600, 600)) diff --git a/docs/examples/viz_morphing.py b/docs/examples/viz_morphing.py index 25efc529f..d307cd579 100644 --- a/docs/examples/viz_morphing.py +++ b/docs/examples/viz_morphing.py @@ -40,7 +40,7 @@ scene = fury.window.Scene() showm = fury.window.ShowManager( - scene, size=(900, 768), reset_camera=True, order_transparent=True + scene=scene, size=(900, 768), reset_camera=True, order_transparent=True ) showm.initialize() @@ -69,4 +69,4 @@ def timer_callback(_obj, _event): if interactive: showm.start() -fury.window.record(scene, out_path="viz_morphing.png", size=(900, 768)) +fury.window.record(scene=scene, out_path="viz_morphing.png", size=(900, 768)) diff --git a/docs/examples/viz_multithread.py b/docs/examples/viz_multithread.py index 2d491eefe..c26ece1ed 100644 --- a/docs/examples/viz_multithread.py +++ b/docs/examples/viz_multithread.py @@ -31,7 +31,7 @@ # Preparing the show manager as usual showm = fury.window.ShowManager( - scene, size=(900, 768), reset_camera=False, order_transparent=True + scene=scene, size=(900, 768), reset_camera=False, order_transparent=True ) # showm.initialize() diff --git a/docs/examples/viz_network.py b/docs/examples/viz_network.py index c6189fb67..e9f250547 100644 --- a/docs/examples/viz_network.py +++ b/docs/examples/viz_network.py @@ -96,9 +96,9 @@ interactive = False if interactive: - fury.window.show(scene, size=(600, 600)) + fury.window.show(scene=scene, size=(600, 600)) -fury.window.record(scene, out_path="journal_networks.png", size=(600, 600)) +fury.window.record(scene=scene, out_path="journal_networks.png", size=(600, 600)) ############################################################################### # This example can be improved by adding some interactivy with slider, diff --git a/docs/examples/viz_network_animated.py b/docs/examples/viz_network_animated.py index 2f144a411..c4f568aa3 100644 --- a/docs/examples/viz_network_animated.py +++ b/docs/examples/viz_network_animated.py @@ -238,7 +238,11 @@ def _timer(_obj, _event): # more time. showm = fury.window.ShowManager( - scene, reset_camera=False, size=(900, 768), order_transparent=True, multi_samples=8 + scene=scene, + reset_camera=False, + size=(900, 768), + order_transparent=True, + multi_samples=8, ) @@ -254,4 +258,6 @@ def _timer(_obj, _event): showm.start() -fury.window.record(showm.scene, size=(900, 768), out_path="viz_animated_networks.png") +fury.window.record( + scene=showm.scene, size=(900, 768), out_path="viz_animated_networks.png" +) diff --git a/docs/examples/viz_no_interaction.py b/docs/examples/viz_no_interaction.py index 1a968a5ef..a710ceda7 100644 --- a/docs/examples/viz_no_interaction.py +++ b/docs/examples/viz_no_interaction.py @@ -70,7 +70,7 @@ ) showm = fury.window.ShowManager( - scene, + scene=scene, reset_camera=False, size=(window_size[0], window_size[1]), order_transparent=False, @@ -92,11 +92,13 @@ p.start() stream.start( - ms, + ms=ms, ) if interactive: showm.start() stream.stop() stream.cleanup() - fury.window.record(showm.scene, size=window_size, out_path="viz_no_interaction.png") + fury.window.record( + scene=showm.scene, size=window_size, out_path="viz_no_interaction.png" + ) diff --git a/docs/examples/viz_pbr_interactive.py b/docs/examples/viz_pbr_interactive.py index 768363919..0bd2b5b3f 100644 --- a/docs/examples/viz_pbr_interactive.py +++ b/docs/examples/viz_pbr_interactive.py @@ -336,4 +336,4 @@ def win_callback(obj, event): if interactive: show_m.start() -fury.window.record(scene, size=(1920, 1080), out_path="viz_pbr_interactive.png") +fury.window.record(scene=scene, size=(1920, 1080), out_path="viz_pbr_interactive.png") diff --git a/docs/examples/viz_pbr_spheres.py b/docs/examples/viz_pbr_spheres.py index e0cfa6f59..52ee1a238 100644 --- a/docs/examples/viz_pbr_spheres.py +++ b/docs/examples/viz_pbr_spheres.py @@ -81,14 +81,14 @@ for i, name in enumerate(labels): pos = [-40, -5 * i, 0] label = fury.actor.vector_text( - name, pos=pos, scale=(0.8, 0.8, 0.8), color=(0, 0, 0) + text=name, pos=pos, scale=(0.8, 0.8, 0.8), color=(0, 0, 0) ) scene.add(label) for j in range(num_values): pos = [-26 + 5 * j, 3, 0] label = fury.actor.vector_text( - str(np.round(j * 0.1, decimals=1)), + text=str(np.round(j * 0.1, decimals=1)), pos=pos, scale=(0.8, 0.8, 0.8), color=(0, 0, 0), @@ -136,14 +136,14 @@ for i, name in enumerate(labels): pos = [-40, -35 - (5 * i), 0] label = fury.actor.vector_text( - name, pos=pos, scale=(0.8, 0.8, 0.8), color=(0, 0, 0) + text=name, pos=pos, scale=(0.8, 0.8, 0.8), color=(0, 0, 0) ) scene.add(label) for j in range(num_values): pos = [-26 + 5 * j, -32, 0] label = fury.actor.vector_text( - "{:.02f}".format(iors[j]), pos=pos, scale=(0.8, 0.8, 0.8), color=(0, 0, 0) + text="{:.02f}".format(iors[j]), pos=pos, scale=(0.8, 0.8, 0.8), color=(0, 0, 0) ) scene.add(label) @@ -154,4 +154,4 @@ if interactive: fury.window.show(scene) -fury.window.record(scene, size=(600, 600), out_path="viz_pbr_spheres.png") +fury.window.record(scene=scene, size=(600, 600), out_path="viz_pbr_spheres.png") diff --git a/docs/examples/viz_picking.py b/docs/examples/viz_picking.py index 954cc9d5a..c7fa6d7c7 100644 --- a/docs/examples/viz_picking.py +++ b/docs/examples/viz_picking.py @@ -47,7 +47,9 @@ [0, np.sqrt(2) / 2, np.sqrt(2) / 2], ] ) -fury_actor = fury.actor.cube(centers, directions, colors, scales=radii) +fury_actor = fury.actor.cube( + centers, directions=directions, colors=colors, scales=radii +) ############################################################################### # Access the memory of the vertices of all the cubes @@ -59,7 +61,7 @@ ############################################################################### # Access the memory of the colors of all the cubes -vcolors = fury.utils.colors_from_actor(fury_actor, "colors") +vcolors = fury.utils.colors_from_actor(fury_actor, array_name="colors") ############################################################################### # Adding an actor showing the axes of the world coordinates @@ -139,7 +141,7 @@ def left_click_callback(obj, event): ############################################################################### # Make the window appear -showm = fury.window.ShowManager(scene, size=(1024, 768), order_transparent=True) +showm = fury.window.ShowManager(scene=scene, size=(1024, 768), order_transparent=True) scene.add(panel) @@ -155,4 +157,4 @@ def left_click_callback(obj, event): ############################################################################### # Save the current framebuffer in a PNG file -fury.window.record(showm.scene, size=(1024, 768), out_path="viz_picking.png") +fury.window.record(scene=showm.scene, size=(1024, 768), out_path="viz_picking.png") diff --git a/docs/examples/viz_play_video.py b/docs/examples/viz_play_video.py index dde63d78d..e6dd8be3c 100644 --- a/docs/examples/viz_play_video.py +++ b/docs/examples/viz_play_video.py @@ -49,7 +49,10 @@ def __init__(self, video, time=10): self.initialize_scene() # Create a Show Manager and Initialize it self.show_manager = fury.window.ShowManager( - self.scene, size=(900, 768), reset_camera=False, order_transparent=True + scene=self.scene, + size=(900, 768), + reset_camera=False, + order_transparent=True, ) # Initialize the Scene with actors @@ -91,5 +94,5 @@ def run(self): vp = VideoPlayer(video_url) vp.run() fury.window.record( - vp.show_manager.scene, out_path="viz_play_video.png", size=(600, 600) + scene=vp.show_manager.scene, out_path="viz_play_video.png", size=(600, 600) ) diff --git a/docs/examples/viz_principled_spheres.py b/docs/examples/viz_principled_spheres.py index 82ded4337..2dff79319 100644 --- a/docs/examples/viz_principled_spheres.py +++ b/docs/examples/viz_principled_spheres.py @@ -83,14 +83,14 @@ for i in range(10): pos = [-40, -5 * i, 0] label = fury.actor.vector_text( - labels[i], pos=pos, scale=(0.8, 0.8, 0.8), color=(0, 0, 0) + text=labels[i], pos=pos, scale=(0.8, 0.8, 0.8), color=(0, 0, 0) ) scene.add(label) for j in range(11): pos = [-26 + 5 * j, 5, 0] label = fury.actor.vector_text( - str(np.round(j * 0.1, decimals=1)), + text=str(np.round(j * 0.1, decimals=1)), pos=pos, scale=(0.8, 0.8, 0.8), color=(0, 0, 0), @@ -104,4 +104,4 @@ if interactive: fury.window.show(scene) -fury.window.record(scene, size=(600, 600), out_path="viz_principled_spheres.png") +fury.window.record(scene=scene, size=(600, 600), out_path="viz_principled_spheres.png") diff --git a/docs/examples/viz_radio_buttons.py b/docs/examples/viz_radio_buttons.py index e10e5f376..1ee50a14e 100644 --- a/docs/examples/viz_radio_buttons.py +++ b/docs/examples/viz_radio_buttons.py @@ -82,5 +82,5 @@ def toggle_color(radio): show_manager.start() fury.window.record( - show_manager.scene, size=current_size, out_path="viz_radio_buttons.png" + scene=show_manager.scene, size=current_size, out_path="viz_radio_buttons.png" ) diff --git a/docs/examples/viz_robot_arm_animation.py b/docs/examples/viz_robot_arm_animation.py index b35fd105c..c09b1c593 100644 --- a/docs/examples/viz_robot_arm_animation.py +++ b/docs/examples/viz_robot_arm_animation.py @@ -13,7 +13,7 @@ scene = fury.window.Scene() showm = fury.window.ShowManager( - scene, size=(900, 768), reset_camera=False, order_transparent=True + scene=scene, size=(900, 768), reset_camera=False, order_transparent=True ) showm.initialize() @@ -44,8 +44,8 @@ ############################################################################### # Setting the center of both shafts to the beginning. -fury.utils.set_actor_origin(main_arm, np.array([-6, 0, 0])) -fury.utils.set_actor_origin(sub_arm, np.array([-4, 0, 0])) +fury.utils.set_actor_origin(main_arm, center=np.array([-6, 0, 0])) +fury.utils.set_actor_origin(sub_arm, center=np.array([-4, 0, 0])) ############################################################################### # Creating a timeline @@ -53,9 +53,11 @@ ############################################################################### # Creating animations -main_arm_animation = fury.animation.Animation([main_arm, joint_1], length=2 * np.pi) -child_arm_animation = fury.animation.Animation([sub_arm, joint_2]) -drill_animation = fury.animation.Animation(end) +main_arm_animation = fury.animation.Animation( + actors=[main_arm, joint_1], length=2 * np.pi +) +child_arm_animation = fury.animation.Animation(actors=[sub_arm, joint_2]) +drill_animation = fury.animation.Animation(actors=end) ############################################################################### @@ -121,4 +123,4 @@ def rot_drill(t): if interactive: showm.start() -fury.window.record(scene, out_path="viz_robot_arm.png", size=(900, 768)) +fury.window.record(scene=scene, out_path="viz_robot_arm.png", size=(900, 768)) diff --git a/docs/examples/viz_sdf_cylinder.py b/docs/examples/viz_sdf_cylinder.py index e501237bd..0bc643894 100644 --- a/docs/examples/viz_sdf_cylinder.py +++ b/docs/examples/viz_sdf_cylinder.py @@ -123,7 +123,7 @@ if interactive: fury.window.show(scene) -fury.window.record(scene, size=(600, 600), out_path="viz_poly_cylinder.png") +fury.window.record(scene=scene, size=(600, 600), out_path="viz_poly_cylinder.png") ############################################################################### # Visualize the surface geometry representation for the object. @@ -135,7 +135,7 @@ if interactive: fury.window.show(scene) -fury.window.record(scene, size=(600, 600), out_path="viz_poly_cylinder_geom.png") +fury.window.record(scene=scene, size=(600, 600), out_path="viz_poly_cylinder_geom.png") ############################################################################### # Then we clean the scene to render the boxes we will use to render our @@ -360,7 +360,7 @@ if interactive: fury.window.show(scene) -fury.window.record(scene, size=(600, 600), out_path="viz_sdf_cylinder.png") +fury.window.record(scene=scene, size=(600, 600), out_path="viz_sdf_cylinder.png") ############################################################################### # References diff --git a/docs/examples/viz_sdfactor.py b/docs/examples/viz_sdfactor.py index 7d99356dc..bf9daabe6 100644 --- a/docs/examples/viz_sdfactor.py +++ b/docs/examples/viz_sdfactor.py @@ -53,11 +53,13 @@ # manager. current_size = (1024, 720) -showm = fury.window.ShowManager(scene, size=current_size, title="Visualize SDF Actor") +showm = fury.window.ShowManager( + scene=scene, size=current_size, title="Visualize SDF Actor" +) interactive = False if interactive: showm.start() -fury.window.record(scene, out_path="viz_sdfactor.png", size=current_size) +fury.window.record(scene=scene, out_path="viz_sdfactor.png", size=current_size) diff --git a/docs/examples/viz_selection.py b/docs/examples/viz_selection.py index 58b71ebca..355569a6b 100644 --- a/docs/examples/viz_selection.py +++ b/docs/examples/viz_selection.py @@ -61,7 +61,7 @@ ############################################################################### # Access the memory of the colors of all the cubes -vcolors = fury.utils.colors_from_actor(cube_actor, "colors") +vcolors = fury.utils.colors_from_actor(cube_actor, array_name="colors") ############################################################################### # Create a rectangular 2d box as a texture @@ -117,7 +117,7 @@ def hover_callback(_obj, _event): # Make the window appear showm = fury.window.ShowManager( - scene, size=(1024, 768), order_transparent=True, reset_camera=False + scene=scene, size=(1024, 768), order_transparent=True, reset_camera=False ) @@ -138,4 +138,4 @@ def hover_callback(_obj, _event): ############################################################################### # Save the current framebuffer in a PNG file -fury.window.record(showm.scene, size=(1024, 768), out_path="viz_selection.png") +fury.window.record(scene=showm.scene, size=(1024, 768), out_path="viz_selection.png") diff --git a/docs/examples/viz_shader.py b/docs/examples/viz_shader.py index 479b42289..fa970d91f 100644 --- a/docs/examples/viz_shader.py +++ b/docs/examples/viz_shader.py @@ -112,7 +112,7 @@ def shader_callback(_caller, _event, calldata=None): # manager. current_size = (1024, 720) -showm = fury.window.ShowManager(scene, size=current_size, reset_camera=False) +showm = fury.window.ShowManager(scene=scene, size=current_size, reset_camera=False) showm.add_timer_callback(True, 30, timer_callback) @@ -124,4 +124,4 @@ def shader_callback(_caller, _event, calldata=None): if interactive: showm.start() -fury.window.record(showm.scene, size=current_size, out_path="viz_shader.png") +fury.window.record(scene=showm.scene, size=current_size, out_path="viz_shader.png") diff --git a/docs/examples/viz_shapes.py b/docs/examples/viz_shapes.py index 33a88ec80..588d2625e 100644 --- a/docs/examples/viz_shapes.py +++ b/docs/examples/viz_shapes.py @@ -51,4 +51,6 @@ if interactive: show_manager.start() -fury.window.record(show_manager.scene, size=current_size, out_path="viz_shapes.png") +fury.window.record( + scene=show_manager.scene, size=current_size, out_path="viz_shapes.png" +) diff --git a/docs/examples/viz_skinning.py b/docs/examples/viz_skinning.py index 553af512a..7469444a4 100644 --- a/docs/examples/viz_skinning.py +++ b/docs/examples/viz_skinning.py @@ -43,7 +43,7 @@ scene = fury.window.Scene() showm = fury.window.ShowManager( - scene, size=(900, 768), reset_camera=True, order_transparent=True + scene=scene, size=(900, 768), reset_camera=True, order_transparent=True ) showm.initialize() scene.add(animation) @@ -71,4 +71,4 @@ def timer_callback(_obj, _event): if interactive: showm.start() -fury.window.record(scene, out_path="viz_skinning.png", size=(900, 768)) +fury.window.record(scene=scene, out_path="viz_skinning.png", size=(900, 768)) diff --git a/docs/examples/viz_solar_system.py b/docs/examples/viz_solar_system.py index ffd495d0d..532fbedce 100644 --- a/docs/examples/viz_solar_system.py +++ b/docs/examples/viz_solar_system.py @@ -122,7 +122,7 @@ def init_planet(planet_data): planet_actor = fury.actor.texture_on_sphere(planet_image) planet_actor.SetPosition(planet_data["position"], 0, 0) if planet_data["filename"] != "8k_saturn_ring_alpha.png": - fury.utils.rotate(planet_actor, (90, 1, 0, 0)) + fury.utils.rotate(planet_actor, rotation=(90, 1, 0, 0)) planet_actor.SetScale(planet_data["scale"]) scene.add(planet_actor) return planet_actor @@ -188,7 +188,7 @@ def get_orbital_position(radius, time): def rotate_axial(actor, time, radius): axis = (0, radius, 0) angle = 50 / time - fury.utils.rotate(actor, (angle, axis[0], axis[1], axis[2])) + fury.utils.rotate(actor, rotation=(angle, axis[0], axis[1], axis[2])) return angle @@ -202,7 +202,7 @@ def rotate_axial(actor, time, radius): # between the scene, the window and the interactor. showm = fury.window.ShowManager( - scene, size=(900, 768), reset_camera=False, order_transparent=True + scene=scene, size=(900, 768), reset_camera=False, order_transparent=True ) scene.add(panel) @@ -335,5 +335,5 @@ def pause_animation(i_ren, _obj, _button): showm.start() fury.window.record( - showm.scene, size=(900, 768), out_path="viz_solar_system_animation.png" + scene=showm.scene, size=(900, 768), out_path="viz_solar_system_animation.png" ) diff --git a/docs/examples/viz_sphere.py b/docs/examples/viz_sphere.py index f81aae96f..ca9eb58ea 100644 --- a/docs/examples/viz_sphere.py +++ b/docs/examples/viz_sphere.py @@ -41,4 +41,4 @@ if interactive: fury.window.show(scene, size=(600, 600)) -fury.window.record(scene, out_path="viz_sphere.png", size=(600, 600)) +fury.window.record(scene=scene, out_path="viz_sphere.png", size=(600, 600)) diff --git a/docs/examples/viz_spiky.py b/docs/examples/viz_spiky.py index a8de7e3ca..0b7686f26 100644 --- a/docs/examples/viz_spiky.py +++ b/docs/examples/viz_spiky.py @@ -82,7 +82,7 @@ # interactor. showm = fury.window.ShowManager( - scene, size=(900, 768), reset_camera=False, order_transparent=True + scene=scene, size=(900, 768), reset_camera=False, order_transparent=True ) ############################################################################## @@ -108,7 +108,7 @@ def timer_callback(_obj, _event): showm.add_timer_callback(True, 200, timer_callback) showm.start() -fury.window.record(showm.scene, size=(900, 768), out_path="viz_spiky.png") +fury.window.record(scene=showm.scene, size=(900, 768), out_path="viz_spiky.png") ############################################################################## # Instead of arrows, you can choose other geometrical objects diff --git a/docs/examples/viz_spinbox.py b/docs/examples/viz_spinbox.py index d7b9fdfae..dfc2d21c1 100644 --- a/docs/examples/viz_spinbox.py +++ b/docs/examples/viz_spinbox.py @@ -75,4 +75,6 @@ def rotate_cone(spinbox): if interactive: show_manager.start() -fury.window.record(show_manager.scene, size=current_size, out_path="viz_spinbox.png") +fury.window.record( + scene=show_manager.scene, size=current_size, out_path="viz_spinbox.png" +) diff --git a/docs/examples/viz_spline_interpolator.py b/docs/examples/viz_spline_interpolator.py index eff208200..a5675985c 100644 --- a/docs/examples/viz_spline_interpolator.py +++ b/docs/examples/viz_spline_interpolator.py @@ -13,7 +13,7 @@ scene = fury.window.Scene() showm = fury.window.ShowManager( - scene, size=(900, 768), reset_camera=False, order_transparent=True + scene=scene, size=(900, 768), reset_camera=False, order_transparent=True ) @@ -37,7 +37,7 @@ # creating two timelines (one uses linear and the other uses' spline # interpolator), each timeline controls a sphere actor -sphere_linear = fury.actor.sphere(np.array([[0, 0, 0]]), (1, 0.5, 0.2), 0.5) +sphere_linear = fury.actor.sphere(np.array([[0, 0, 0]]), (1, 0.5, 0.2), radii=0.5) linear_anim = fury.animation.Animation() linear_anim.add_actor(sphere_linear) @@ -51,8 +51,8 @@ ############################################################################### # creating a second timeline that translates another larger sphere actor using # spline interpolator. -sphere_spline = fury.actor.sphere(np.array([[0, 0, 0]]), (0.3, 0.9, 0.6), 1) -spline_anim = fury.animation.Animation(sphere_spline) +sphere_spline = fury.actor.sphere(np.array([[0, 0, 0]]), (0.3, 0.9, 0.6), radii=1) +spline_anim = fury.animation.Animation(actors=sphere_spline) spline_anim.set_position_keyframes(position_keyframes) ############################################################################### @@ -92,4 +92,6 @@ if interactive: showm.start() -fury.window.record(scene, out_path="viz_keyframe_animation_spline.png", size=(900, 768)) +fury.window.record( + scene=scene, out_path="viz_keyframe_animation_spline.png", size=(900, 768) +) diff --git a/docs/examples/viz_surfaces.py b/docs/examples/viz_surfaces.py index fe19ecb91..fa09590eb 100644 --- a/docs/examples/viz_surfaces.py +++ b/docs/examples/viz_surfaces.py @@ -102,4 +102,4 @@ # display # fury.window.show(scene, size=(600, 600), reset_camera=False) -fury.window.record(scene, out_path="cube.png", size=(600, 600)) +fury.window.record(scene=scene, out_path="cube.png", size=(600, 600)) diff --git a/docs/examples/viz_tab.py b/docs/examples/viz_tab.py index a4814c71e..bf4fb5c12 100644 --- a/docs/examples/viz_tab.py +++ b/docs/examples/viz_tab.py @@ -236,4 +236,4 @@ def collapse(tab_ui): if interactive: sm.start() -fury.window.record(sm.scene, size=(500, 500), out_path="viz_tab.png") +fury.window.record(scene=sm.scene, size=(500, 500), out_path="viz_tab.png") diff --git a/docs/examples/viz_tesseract.py b/docs/examples/viz_tesseract.py index a66312ea4..0794b048c 100644 --- a/docs/examples/viz_tesseract.py +++ b/docs/examples/viz_tesseract.py @@ -121,7 +121,7 @@ def connect_points(verts3D): scene.set_camera( position=(0, 10, -1), focal_point=(0.0, 0.0, 0.0), view_up=(0.0, 0.0, 0.0) ) -showm = fury.window.ShowManager(scene, size=(1920, 1080), order_transparent=True) +showm = fury.window.ShowManager(scene=scene, size=(1920, 1080), order_transparent=True) ############################################################################### @@ -187,4 +187,4 @@ def timer_callback(_obj, _event): showm.add_timer_callback(True, 20, timer_callback) showm.start() -fury.window.record(showm.scene, size=(600, 600), out_path="viz_tesseract.png") +fury.window.record(scene=showm.scene, size=(600, 600), out_path="viz_tesseract.png") diff --git a/docs/examples/viz_texture.py b/docs/examples/viz_texture.py index fe46def4c..3a124473f 100644 --- a/docs/examples/viz_texture.py +++ b/docs/examples/viz_texture.py @@ -37,4 +37,4 @@ interactive = False if interactive: fury.window.show(scene, size=(600, 600), reset_camera=False) -fury.window.record(scene, size=(900, 768), out_path="viz_texture.png") +fury.window.record(scene=scene, size=(900, 768), out_path="viz_texture.png") diff --git a/docs/examples/viz_timeline.py b/docs/examples/viz_timeline.py index 4e579e57f..e6b8b3874 100644 --- a/docs/examples/viz_timeline.py +++ b/docs/examples/viz_timeline.py @@ -24,7 +24,7 @@ # We create our ``Scene`` and ``ShowManager`` as usual. scene = fury.window.Scene() -showm = fury.window.ShowManager(scene, size=(900, 768)) +showm = fury.window.ShowManager(scene=scene, size=(900, 768)) showm.initialize() ############################################################################### @@ -88,5 +88,5 @@ showm.start() fury.window.record( - scene, out_path="viz_keyframe_animation_timeline.png", size=(900, 768) + scene=scene, out_path="viz_keyframe_animation_timeline.png", size=(900, 768) ) diff --git a/docs/examples/viz_timers.py b/docs/examples/viz_timers.py index e0217a7a5..47953f7e0 100644 --- a/docs/examples/viz_timers.py +++ b/docs/examples/viz_timers.py @@ -30,7 +30,7 @@ scene.add(sphere_actor) showm = fury.window.ShowManager( - scene, size=(900, 768), reset_camera=False, order_transparent=True + scene=scene, size=(900, 768), reset_camera=False, order_transparent=True ) @@ -66,4 +66,4 @@ def timer_callback(_obj, _event): showm.start() -fury.window.record(showm.scene, size=(900, 768), out_path="viz_timer.png") +fury.window.record(scene=showm.scene, size=(900, 768), out_path="viz_timer.png") diff --git a/docs/examples/viz_ui.py b/docs/examples/viz_ui.py index 8d50712e2..7659df892 100644 --- a/docs/examples/viz_ui.py +++ b/docs/examples/viz_ui.py @@ -310,4 +310,6 @@ def display_element(): if interactive: show_manager.start() -fury.window.record(show_manager.scene, size=current_size, out_path="viz_fury.ui.png") +fury.window.record( + scene=show_manager.scene, size=current_size, out_path="viz_fury.ui.png" +) diff --git a/docs/examples/viz_ui_listbox.py b/docs/examples/viz_ui_listbox.py index 146d147b6..b133660c3 100644 --- a/docs/examples/viz_ui_listbox.py +++ b/docs/examples/viz_ui_listbox.py @@ -76,4 +76,6 @@ def display_element(): if interactive: show_manager.start() -fury.window.record(show_manager.scene, size=current_size, out_path="viz_listbox.png") +fury.window.record( + scene=show_manager.scene, size=current_size, out_path="viz_listbox.png" +) diff --git a/docs/examples/viz_ui_slider.py b/docs/examples/viz_ui_slider.py index 31e47f0c4..f1793f653 100644 --- a/docs/examples/viz_ui_slider.py +++ b/docs/examples/viz_ui_slider.py @@ -149,4 +149,6 @@ def translate_cube_hor(slider): if interactive: show_manager.start() -fury.window.record(show_manager.scene, size=current_size, out_path="viz_slider.png") +fury.window.record( + scene=show_manager.scene, size=current_size, out_path="viz_slider.png" +) diff --git a/docs/examples/viz_using_time_equations.py b/docs/examples/viz_using_time_equations.py index a4ae678fd..e167832b5 100644 --- a/docs/examples/viz_using_time_equations.py +++ b/docs/examples/viz_using_time_equations.py @@ -13,11 +13,13 @@ scene = fury.window.Scene() showm = fury.window.ShowManager( - scene, size=(900, 768), reset_camera=False, order_transparent=True + scene=scene, size=(900, 768), reset_camera=False, order_transparent=True ) -cube = fury.actor.cube(np.array([[0, 0, 0]]), (0, 0, 0), (1, 0, 1), scales=6) +cube = fury.actor.cube( + np.array([[0, 0, 0]]), directions=(0, 0, 0), colors=(1, 0, 1), scales=6 +) ############################################################################### # Creating an ``Animation`` to animate the actor and show its motion path. @@ -77,5 +79,5 @@ def scale_eval(t): showm.start() fury.window.record( - scene, out_path="viz_keyframe_animation_evaluators.png", size=(900, 768) + scene=scene, out_path="viz_keyframe_animation_evaluators.png", size=(900, 768) ) diff --git a/docs/examples/viz_widget.py b/docs/examples/viz_widget.py index ee7b99da8..1eea0dca2 100644 --- a/docs/examples/viz_widget.py +++ b/docs/examples/viz_widget.py @@ -52,7 +52,7 @@ actors = fury.actor.sphere(centers, opacity=0.5, radii=0.4, colors=colors) scene = fury.window.Scene() scene.add(actors) -showm = fury.window.ShowManager(scene, size=(window_size[0], window_size[1])) +showm = fury.window.ShowManager(scene=scene, size=(window_size[0], window_size[1])) ########################################################################## # Create a stream widget @@ -85,4 +85,4 @@ async def main(): time.sleep(time_sleep) widget.stop() -fury.window.record(showm.scene, size=window_size, out_path="viz_widget.png") +fury.window.record(scene=showm.scene, size=window_size, out_path="viz_widget.png")