layout#

Layout()

Provide functionalities for laying out actors in a 3D scene.

GridLayout(*[, cell_padding, cell_shape, ...])

Provide functionalities for laying out actors in a 2D grid fashion.

HorizontalLayout(*[, cell_padding, cell_shape])

Provide functionalities for laying out actors in a horizontal layout.

VerticalLayout(*[, cell_padding, cell_shape])

Provide functionalities for laying out actors in a vertical stack.

XLayout(*[, direction, cell_padding, cell_shape])

Provide functionalities for laying out actors along x-axis.

YLayout(*[, direction, cell_padding, cell_shape])

Provide functionalities for laying out actors along y-axis.

ZLayout(*[, direction, cell_padding, cell_shape])

Provide functionalities for laying out actors along z-axis.

Layout#

class fury.layout.Layout[source]#

Bases: object

Provide functionalities for laying out actors in a 3D scene.

apply(actors)[source]#

Position the actors according to a certain layout.

compute_positions(_actors)[source]#

Compute the 3D coordinates of some actors.

GridLayout#

class fury.layout.GridLayout(*, cell_padding=0, cell_shape='rect', aspect_ratio=1.7777777777777777, dim=None, position_offset=(0, 0, 0))[source]#

Bases: Layout

Provide functionalities for laying out actors in a 2D grid fashion.

The GridLayout class lays the actors in a 2D structured grid aligned with the xy-plane.

compute_positions(actors)[source]#

Compute the 3D coordinates of some actors. The coordinates will lie on the xy-plane and form a 2D grid.

Parameters:
actorslist of vtkProp3D objects

Actors to be layout in a grid manner.

Returns:
list of 3-tuple

The computed 3D coordinates of every actors.

compute_sizes(actor)[source]#

Compute the bounding box size of the actor/UI element

Parameters:
actor: `vtkProp3D` or `UI` element

Actor/UI element whose size is to be calculated

Returns:
bounding box sizes: tuple
get_cells_shape(actors)[source]#

Get the 2D shape (on the xy-plane) of some actors according to self.cell_shape.

Parameters:
actorslist of vtkProp3D objects

Actors from which to calculate the 2D shape.

Returns:
list of 2-tuple

The 2D shape (on the xy-plane) of every actors.

HorizontalLayout#

class fury.layout.HorizontalLayout(*, cell_padding=0, cell_shape='rect')[source]#

Bases: GridLayout

Provide functionalities for laying out actors in a horizontal layout.

compute_positions(actors)[source]#

Compute the 3D coordinates of some actors. The coordinates will lie on the xy-plane and form a horizontal stack.

Parameters:
actorslist of vtkProp3D objects

Actors to be layout in a horizontal fashion.

Returns:
list of 3-tuple

The computed 3D coordinates of every actors.

VerticalLayout#

class fury.layout.VerticalLayout(*, cell_padding=0, cell_shape='rect')[source]#

Bases: GridLayout

Provide functionalities for laying out actors in a vertical stack.

compute_positions(actors)[source]#

Compute the 3D coordinates of some actors.

Parameters:
actorslist of vtkProp3D objects

Actors to be layout in a vertical stack.

Returns:
list of 3-tuple

The computed 3D coordinates of every actors.

XLayout#

class fury.layout.XLayout(*, direction='x+', cell_padding=0, cell_shape='rect')[source]#

Bases: HorizontalLayout

Provide functionalities for laying out actors along x-axis.

apply(actors)[source]#

Position the actors according to a certain layout.

compute_positions(actors)[source]#

Compute the 3D coordinates of some actors.

The coordinates will lie on the xy-plane and will be placed along x-axis.

Parameters:
actorslist of vtkProp3D objects

Actors to be layout along the x-axis.

Returns:
list of 3-tuple

The computed 3D coordinates of every actors.

get_cells_shape(actors)[source]#

Get the 2D shape (on the xy-plane) of some actors according to self.cell_shape.

Parameters:
actorslist of vtkProp3D objects

Actors from which to calculate the 2D shape.

Returns:
list of 2-tuple

The 2D shape (on the xy-plane) of every actors.

YLayout#

class fury.layout.YLayout(*, direction='y+', cell_padding=0, cell_shape='rect')[source]#

Bases: VerticalLayout

Provide functionalities for laying out actors along y-axis.

apply(actors)[source]#

Position the actors according to a certain layout.

compute_positions(actors)[source]#

Compute the 3D coordinates of some actors.

The coordinates will lie on the xy-plane and will be placed along y-axis.

Parameters:
actorslist of vtkProp3D objects

Actors to be layout along the y-axis.

Returns:
list of 3-tuple

The computed 3D coordinates of every actors.

get_cells_shape(actors)[source]#

Get the 2D shape (on the xy-plane) of some actors according to self.cell_shape.

Parameters:
actorslist of vtkProp3D objects

Actors from which to calculate the 2D shape.

Returns:
list of 2-tuple

The 2D shape (on the xy-plane) of every actors.

ZLayout#

class fury.layout.ZLayout(*, direction='z+', cell_padding=0, cell_shape='rect')[source]#

Bases: GridLayout

Provide functionalities for laying out actors along z-axis.

apply(actors)[source]#

Position the actors according to a certain layout.

compute_positions(actors)[source]#

Compute the 3D coordinates of some actors.

Parameters:
actorslist of vtkProp3D objects

Actors to be layout along the z-axis.

Returns:
list of 3-tuple

The computed 3D coordinates of every actors.

get_cells_shape(actors)[source]#

Get the shape (on the z-plane) of some actors according to self.cell_shape.

Parameters:
actorslist of vtkProp3D objects

Actors from which to calculate the shape.

Returns:
list of floats

The shape (on the z-plane) of every actors.