Skip to content

Commit e0c2e32

Browse files
committed
fix some vedo function calls still using lowerCamelCase instead of snake_case
1 parent ee2970b commit e0c2e32

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

brainglobe_heatmap/heatmaps.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919

2020
# Set settings for transparent background
2121
# vedo for transparent bg
22-
# settings.vsettings.screenshotTransparentBackground = True
22+
# settings.vsettings.screenshot_transparent_background = True
2323

2424
# This needs to be false for transparent bg
25-
# settings.vsettings.useFXAA = False
25+
# settings.vsettings.use_fxaa = False
2626

2727

2828
def check_values(values: dict, atlas: Atlas) -> Tuple[float, float]:
@@ -157,7 +157,7 @@ def render(self, **kwargs) -> Scene:
157157
camera = self.orientation
158158
else:
159159
self.orientation = np.array(self.orientation)
160-
com = self.slicer.plane0.centerOfMass()
160+
com = self.slicer.plane0.center_of_mass()
161161
camera = {
162162
"pos": com - self.orientation * 2 * np.linalg.norm(com),
163163
"viewup": (0, -1, 0),

brainglobe_heatmap/plane.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,16 @@ def to_mesh(self, actor: Actor):
4747
plane_mesh.width = length
4848
return plane_mesh
4949

50-
def centerOfMass(self):
50+
def center_of_mass(self):
5151
return self.center
5252

53-
def P3toP2(self, ps):
53+
def p3_to_p2(self, ps):
5454
# ps is a list of 3D points
5555
# returns a list of 2D point mapped on
5656
# the plane (u -> x axis, v -> y axis)
5757
return (ps - self.center) @ self.M
5858

59-
def intersectWith(self, mesh: vd.Mesh):
59+
def intersect_with(self, mesh: vd.Mesh):
6060
return mesh.intersect_with_plane(
6161
origin=self.center, normal=self.normal
6262
)
@@ -66,14 +66,14 @@ def get_projections(self, actors: List[Actor]) -> Dict[str, np.ndarray]:
6666
projected = {}
6767
for actor in actors:
6868
mesh: vd.Mesh = actor._mesh
69-
intersection = self.intersectWith(mesh)
69+
intersection = self.intersect_with(mesh)
7070
if not intersection.vertices.shape[0]:
7171
continue
7272
pieces = intersection.split() # intersection.split() in newer vedo
7373
for piece_n, piece in enumerate(pieces):
7474
# sort coordinates
7575
points = piece.join(reset=True).vertices
76-
projected[actor.name + f"_segment_{piece_n}"] = self.P3toP2(
76+
projected[actor.name + f"_segment_{piece_n}"] = self.p3_to_p2(
7777
points
7878
)
7979
return projected

brainglobe_heatmap/slicer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def __init__(
3939
3D vector) + thickness (spacing between the two planes)
4040
"""
4141
if position is None:
42-
position = root.centerOfMass()
42+
position = root.center_of_mass()
4343

4444
if isinstance(position, (float, int)):
4545
if isinstance(orientation, str):
@@ -126,7 +126,7 @@ def show_plane_intersection(
126126
to the brainrender scene.
127127
"""
128128
for region in regions + [root]:
129-
intersection = self.plane0.intersectWith(region._mesh)
129+
intersection = self.plane0.intersect_with(region._mesh)
130130

131131
if len(intersection.vertices):
132132
scene.add(intersection, transform=False)

0 commit comments

Comments
 (0)