Skip to content

Commit d12d005

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

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

brainglobe_heatmap/heatmaps.py

+3-3
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

+5-5
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,16 @@ def to_mesh(self, actor: Actor):
5050
plane_mesh.width = length
5151
return plane_mesh
5252

53-
def centerOfMass(self):
53+
def center_of_mass(self):
5454
return self.center
5555

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

62-
def intersectWith(self, mesh: vd.Mesh):
62+
def intersect_with(self, mesh: vd.Mesh):
6363
return mesh.intersect_with_plane(
6464
origin=self.center, normal=self.normal
6565
)
@@ -69,14 +69,14 @@ def get_projections(self, actors: List[Actor]) -> Dict[str, np.ndarray]:
6969
projected = {}
7070
for actor in actors:
7171
mesh: vd.Mesh = actor._mesh
72-
intersection = self.intersectWith(mesh)
72+
intersection = self.intersect_with(mesh)
7373
if not intersection.vertices.shape[0]:
7474
continue
7575
pieces = intersection.split() # intersection.split() in newer vedo
7676
for piece_n, piece in enumerate(pieces):
7777
# sort coordinates
7878
points = piece.join(reset=True).vertices
79-
projected[actor.name + f"_segment_{piece_n}"] = self.P3toP2(
79+
projected[actor.name + f"_segment_{piece_n}"] = self.p3_to_p2(
8080
points
8181
)
8282
return projected

brainglobe_heatmap/slicer.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def __init__(
3535
3D vector) + thickness (spacing between the two planes)
3636
"""
3737
if position is None:
38-
position = root.centerOfMass()
38+
position = root.center_of_mass()
3939

4040
if isinstance(position, (float, int)):
4141
if isinstance(orientation, str):
@@ -122,7 +122,7 @@ def show_plane_intersection(
122122
to the brainrender scene.
123123
"""
124124
for region in regions + [root]:
125-
intersection = self.plane0.intersectWith(region._mesh)
125+
intersection = self.plane0.intersect_with(region._mesh)
126126

127127
if len(intersection.vertices):
128128
scene.add(intersection, transform=False)

0 commit comments

Comments
 (0)