Skip to content

Commit

Permalink
Support synchronized views
Browse files Browse the repository at this point in the history
  • Loading branch information
oeway committed Sep 27, 2023
1 parent 2d36681 commit 397310e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions public/plugins/bioengine-test-run.imjoy.html
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,7 @@
self.triton = await server.get_service("triton-client")
self.image = None
self.output = None
self.vtk_viewer = None

def set_image(self, image):
assert isinstance(image, np.ndarray)
Expand All @@ -519,12 +520,17 @@
if image is None:
await api.alert("Please load an image first.")
return
self.vtk_viewer = await api.createWindow(
vtk_viewer = await api.createWindow(
src="https://oeway.github.io/itk-vtk-viewer/",
fullscreen=False,
window_id=window_id,
)
await self.vtk_viewer.setImage(image)
await vtk_viewer.setImage(image)
if self.vtk_viewer:
await self.vtk_viewer.sync(vtk_viewer)
await vtk_viewer.sync(self.vtk_viewer)

self.vtk_viewer = vtk_viewer

async def bioengine_execute(self, model_id, inputs=None, return_rdf=False, weight_format=None):
kwargs = {"model_id": model_id, "inputs": inputs, "return_rdf": return_rdf, "weight_format": weight_format}
Expand Down

0 comments on commit 397310e

Please sign in to comment.