Skip to content

Instantly share code, notes, and snippets.

@oeway
Created February 15, 2021 12:56
Show Gist options
  • Save oeway/d1d4c85622008d177de9426e00c399ca to your computer and use it in GitHub Desktop.
Save oeway/d1d4c85622008d177de9426e00c399ca to your computer and use it in GitHub Desktop.
<docs>
[TODO: write documentation for this plugin.]
</docs>
<config lang="json">
{
"name": "BasicImageAnnotation",
"type": "web-worker",
"tags": [],
"ui": "",
"version": "0.1.0",
"cover": "",
"description": "[TODO: describe this plugin with one sentence.]",
"icon": "extension",
"inputs": null,
"outputs": null,
"api_version": "0.1.8",
"env": "",
"permissions": [],
"requirements": [],
"dependencies": []
}
</config>
<script lang="javascript">
class ImJoyPlugin {
async setup() {
api.log('initialized')
}
async run(ctx) {
const viewer = await api.createWindow({src: "https://kaibu.org/#/app", name: "Kaibu"})
await viewer.view_image("https://images.proteinatlas.org/61448/1319_C10_2_blue_red_green.jpg")
await viewer.add_shapes([], {shape_type: "polygon", edge_color: "red", name: "annotation"})
}
}
api.export(new ImJoyPlugin())
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment