Skip to content

Instantly share code, notes, and snippets.

View Nanguage's full-sized avatar

Weize Nanguage

View GitHub Profile
@Nanguage
Nanguage / panel.imjoy.html
Last active July 6, 2023 08:19
Image viewer ImJoy plugin
<docs lang="markdown">
The panel for upload the image file.
</docs>
<config lang="json">
{
"name": "upload-panel",
"type": "window",
"tags": [],
"ui": "",
<config lang="json">
{
"name": "mi-core",
"type": "web-python",
"tags": [],
"flags": [],
"ui": "",
"version": "0.1.0",
"cover": "",
"description": "Connect to the bioengine server, and execute operations.",
api.createWindow({src: "https://gist.githubusercontent.com/Nanguage/27a003bec90ee8fdd29859cb446c608d/raw/61cf6dd384998002a33336ca0018373c217ed61d/mi_panel.imjoy.html", data: {id: ${id}}})
@Nanguage
Nanguage / Ramen_analysis.ipynb
Last active November 10, 2023 23:31
Code for analysis MiP-Seq plus Ca image and Ramen image
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<docs>
[TODO: write documentation for this plugin.]
</docs>
<config lang="json">
{
"name": "Chatbot launcher",
"type": "web-worker",
"tags": [],
"ui": "",
import micropip
await micropip.install("kaibu-utils")
import pyodide_http
pyodide_http.patch_all()
from kaibu_utils import fetch_image
image = await fetch_image('https://zenodo.org/api/records/6647674/files/sample_input_0.tif/content')
ij = await api.createWindow(src = "https://ij.imjoy.io/", name="ImageJ.JS")
client = await api.createWindow("https://bioimage-io.github.io/bioengine-web-client/")
await client.waitForReady()
import micropip
await micropip.install(["pyotritonclient", "kaibu-utils", "pyodide-http", "requests"])
import pyodide_http
pyodide_http.patch_all() # Patch all libraries
from kaibu_utils import fetch_image
import matplotlib.pyplot as plt
import numpy as np
from pyotritonclient import execute
"""Test the triton server proxy."""
from PIL import Image
import msgpack
import numpy as np
import requests
import gzip
import json
def get_config(server_url, model_name):
response = requests.get(
<docs>
[TODO: write documentation for this plugin.]
</docs>
<config lang="json">
{
"name": "SAM-Kaibu",
"type": "iframe",
"tags": [],
"ui": "",
import numpy as np
import micropip
await micropip.install(['imjoy-rpc', 'kaibu-utils', 'pyodide-http', 'requests'])
# Patch requests
import pyodide_http
pyodide_http.patch_all() # Patch all libraries
import matplotlib.pyplot as plt
from imjoy_rpc.hypha import connect_to_server
from kaibu_utils import fetch_image