diff --git a/brainglobe_heatmap/heatmaps.py b/brainglobe_heatmap/heatmaps.py index eac41df..8964002 100644 --- a/brainglobe_heatmap/heatmaps.py +++ b/brainglobe_heatmap/heatmaps.py @@ -19,10 +19,10 @@ # Set settings for transparent background # vedo for transparent bg -# settings.vsettings.screenshotTransparentBackground = True +# settings.vsettings.screenshot_transparent_background = True # This needs to be false for transparent bg -# settings.vsettings.useFXAA = False +# settings.vsettings.use_fxaa = False def check_values(values: dict, atlas: Atlas) -> Tuple[float, float]: @@ -157,7 +157,7 @@ def render(self, **kwargs) -> Scene: camera = self.orientation else: self.orientation = np.array(self.orientation) - com = self.slicer.plane0.centerOfMass() + com = self.slicer.plane0.center_of_mass() camera = { "pos": com - self.orientation * 2 * np.linalg.norm(com), "viewup": (0, -1, 0), diff --git a/brainglobe_heatmap/plane.py b/brainglobe_heatmap/plane.py index 6521c32..150e2c1 100644 --- a/brainglobe_heatmap/plane.py +++ b/brainglobe_heatmap/plane.py @@ -47,16 +47,16 @@ def to_mesh(self, actor: Actor): plane_mesh.width = length return plane_mesh - def centerOfMass(self): + def center_of_mass(self): return self.center - def P3toP2(self, ps): + def p3_to_p2(self, ps): # ps is a list of 3D points # returns a list of 2D point mapped on # the plane (u -> x axis, v -> y axis) return (ps - self.center) @ self.M - def intersectWith(self, mesh: vd.Mesh): + def intersect_with(self, mesh: vd.Mesh): return mesh.intersect_with_plane( origin=self.center, normal=self.normal ) @@ -66,14 +66,14 @@ def get_projections(self, actors: List[Actor]) -> Dict[str, np.ndarray]: projected = {} for actor in actors: mesh: vd.Mesh = actor._mesh - intersection = self.intersectWith(mesh) + intersection = self.intersect_with(mesh) if not intersection.vertices.shape[0]: continue pieces = intersection.split() # intersection.split() in newer vedo for piece_n, piece in enumerate(pieces): # sort coordinates points = piece.join(reset=True).vertices - projected[actor.name + f"_segment_{piece_n}"] = self.P3toP2( + projected[actor.name + f"_segment_{piece_n}"] = self.p3_to_p2( points ) return projected diff --git a/brainglobe_heatmap/slicer.py b/brainglobe_heatmap/slicer.py index 20f2346..5bbefbd 100644 --- a/brainglobe_heatmap/slicer.py +++ b/brainglobe_heatmap/slicer.py @@ -39,7 +39,7 @@ def __init__( 3D vector) + thickness (spacing between the two planes) """ if position is None: - position = root.centerOfMass() + position = root.center_of_mass() if isinstance(position, (float, int)): if isinstance(orientation, str): @@ -126,7 +126,7 @@ def show_plane_intersection( to the brainrender scene. """ for region in regions + [root]: - intersection = self.plane0.intersectWith(region._mesh) + intersection = self.plane0.intersect_with(region._mesh) if len(intersection.vertices): scene.add(intersection, transform=False)