Skip to content

Commit

Permalink
fixed the normal directions (it now points outwards, earlier it point…
Browse files Browse the repository at this point in the history
…ed inwards. This might affect if we introduce some optimizations), also some minor QOL changes. Deleted vtkprop because it was unused, it was introduced previously but now it is not needed
  • Loading branch information
robinroy03 committed Mar 21, 2024
1 parent 20d668d commit 62ac13c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
11 changes: 4 additions & 7 deletions fury/actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3997,8 +3997,8 @@ def texture_on_cube(negx, negy, negz, posx, posy, posz, centers=(0, 0, 0)):
"""
plane_objects = [PlaneSource() for _ in range(6)]
center_x, center_y, center_z = centers

center_x, center_y, center_z = centers
plane_centers = [
(-0.5 + center_x, 0 + center_y, 0 + center_z),
(0 + center_x, -0.5 + center_y, 0 + center_z),
Expand All @@ -4009,9 +4009,9 @@ def texture_on_cube(negx, negy, negz, posx, posy, posz, centers=(0, 0, 0)):
]

plane_normals = [
(1, 0, 0),
(0, 1, 0),
(0, 0, 1),
(-1, 0, 0),
(0, -1, 0),
(0, 0, -1),
(1, 0, 0),
(0, 1, 0),
(0, 0, 1)
Expand All @@ -4026,21 +4026,18 @@ def texture_on_cube(negx, negy, negz, posx, posy, posz, centers=(0, 0, 0)):
plane.SetNormal(*normal)

image_grids = [negx, negy, negz, posx, posy, posz]

image_data_objects = [
numpy_to_vtk_image_data(grid) for grid in image_grids
]

texture_objects = [Texture() for _ in range(6)]

for image_data, texture in zip(
image_data_objects,
texture_objects
):
texture.SetInputDataObject(image_data)

polydatamapper_objects = [PolyDataMapper() for _ in range(6)]

for mapper, plane in zip(
polydatamapper_objects,
plane_objects
Expand Down
2 changes: 0 additions & 2 deletions fury/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@
WindowToImageFilter = rcvtk.vtkWindowToImageFilter
#: class for InteractorStyle
InteractorStyle = rcvtk.vtkInteractorStyle
#: class for PropCollection
PropCollection = rcvtk.vtkPropCollection
#: class for PropPicker
PropPicker = rcvtk.vtkPropPicker
#: class for PointPicker
Expand Down

0 comments on commit 62ac13c

Please sign in to comment.