Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
print(f"Creating root mesh for atlas {self.atlas_name}")
temp_scene = Scene(
atlas=Celegans,
add_root=False,
display_inset=False,
atlas_kwargs=dict(data_folder=self.data_folder),
)
temp_scene.add_neurons(self.neurons_names)
temp_scene.render(interactive=False)
temp_scene.close()
root = merge(*temp_scene.actors["neurons"]).clean().cap()
# root = mesh2Volume(root, spacing=(0.02, 0.02, 0.02)).isosurface()
points = Points(root.points()).smoothMLS2D(f=0.8).clean(tol=0.005)
root = recoSurface(points, dims=100, radius=0.2)
# Save
write(root, rootpath)
del temp_scene
return root