From 2a4052310ca1a00d6d820bb933b8a52fbe2e3167 Mon Sep 17 00:00:00 2001 From: nanguage Date: Fri, 29 Mar 2024 02:28:41 +0100 Subject: [PATCH] add chatbot extension --- public/chatbot-extension.imjoy.html | 87 +++++++++++++++++++++++++++++ public/plugins/ufish.imjoy.html | 3 + src/views/PredictView.vue | 3 +- 3 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 public/chatbot-extension.imjoy.html diff --git a/public/chatbot-extension.imjoy.html b/public/chatbot-extension.imjoy.html new file mode 100644 index 0000000..dee96b3 --- /dev/null +++ b/public/chatbot-extension.imjoy.html @@ -0,0 +1,87 @@ + +[TODO: write documentation for this plugin.] + + + +{ + "name": "chatbot-ufish", + "type": "web-worker", + "tags": [], + "ui": "", + "version": "0.1.0", + "cover": "", + "description": "Register ufish-web to chatbot", + "icon": "extension", + "inputs": null, + "outputs": null, + "api_version": "0.1.8", + "env": "", + "permissions": [], + "requirements": [], + "dependencies": [] +} + + + diff --git a/public/plugins/ufish.imjoy.html b/public/plugins/ufish.imjoy.html index 5877fd3..640384a 100644 --- a/public/plugins/ufish.imjoy.html +++ b/public/plugins/ufish.imjoy.html @@ -169,6 +169,9 @@ csv_bytes = fake_csv_file.getvalue().encode() num_spots = df.shape[0] return enh_bytes, csv_bytes, num_spots + + async def get_spots(self): + return self.spots async def scale_image(self): image = self.image diff --git a/src/views/PredictView.vue b/src/views/PredictView.vue index 2cfd19c..51a4e94 100644 --- a/src/views/PredictView.vue +++ b/src/views/PredictView.vue @@ -138,9 +138,10 @@ export default { } if (isPluginMode()) { + const spots = await plugin.value.get_spots() runStore.setOutput({ enhanced: outImg, - spots: coords, + spots: spots, }) } runInfoText.value = `Done, ${numSpots} spots detected.`