From f2350a3df8666c418bffcaa498c9247bf367020c Mon Sep 17 00:00:00 2001 From: nanguage Date: Fri, 19 Apr 2024 04:08:04 +0200 Subject: [PATCH] update --- public/plugins/chatbot-extension.imjoy.html | 13 +++++++++++-- public/plugins/ufish.imjoy.html | 5 +++-- src/views/PredictView.vue | 3 ++- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/public/plugins/chatbot-extension.imjoy.html b/public/plugins/chatbot-extension.imjoy.html index 380e0d8..ef3cb5c 100644 --- a/public/plugins/chatbot-extension.imjoy.html +++ b/public/plugins/chatbot-extension.imjoy.html @@ -103,12 +103,21 @@ type: "number", description: "Diameter of the cells", default: 60, - } + }, + "model_type": { + type: "string", + description: "Model type, cyto or nuclei", + default: "cyto", + }, + "flow_threshold": { + type: "number", + description: "Flow threshold", + default: 0.4, + }, }, }; }, execute: async (config) => { - debugger const client = await this.getUfishClient() const bioengine_runner = await this.getBioengineRunner() const img = await client.getInputImage() diff --git a/public/plugins/ufish.imjoy.html b/public/plugins/ufish.imjoy.html index d864fc8..aba4250 100644 --- a/public/plugins/ufish.imjoy.html +++ b/public/plugins/ufish.imjoy.html @@ -159,8 +159,9 @@ await self.viewer.view_image(image, name=name) return image.shape - async def process_enhanced(self, enh_img): - await self.viewer.view_image(enh_img, name="enhanced") + async def process_enhanced(self, enh_img, view_enhanced=True): + if view_enhanced: + await self.viewer.view_image(enh_img, name="enhanced") df = call_spots_local_maxima(enh_img) coords = df.values self.enhanced_image = enh_img diff --git a/src/views/PredictView.vue b/src/views/PredictView.vue index 2ebcb46..b9563c7 100644 --- a/src/views/PredictView.vue +++ b/src/views/PredictView.vue @@ -132,7 +132,8 @@ export default { _rshape: modelOut.dims, _rvalue: (modelOut.data as Float32Array).buffer } - const [enhBytes, coords, numSpots] = await plugin.value.process_enhanced(outImg) + const viewEnhanced = !isPluginMode() + const [enhBytes, coords, numSpots] = await plugin.value.process_enhanced(outImg, viewEnhanced) output.value = { enhanced: enhBytes, coords: coords